rpatel: That's an interesting Tex. Instruments Application Note. On pages 8 & 9 they mention the sliding-mode DFT (known as the "sliding DFT") and the Goertzel algorithm. They wrote:
"The disadvantages of these techniques are that the computational overhead is slightly higher and the data memory requirements increase, because a sample-block-length number of samples (N) must be retained for the calculations."
I don't believe that statement is true. The sliding DFT computes updated spectral results upon the arrival of each new input sample, and past input samples need NOT be saved (retained). The Goertzel algorithm computes updated temporary results upon the arrival of each new input sample, and past input samples need NOT be saved (retained). Upon the arrival of the Nth input sample the Goertzel algorithm computes its final spectral result. (I'm merely telling you this for your information.) Maybe the sliding DFT or the Goertzel algorithm would be useful to you. But if the Tex. Instr. Application Note's method does what you want then stick with its method.
To start, try the following code to generate an increasing-freq chirp signal plus its first harmonic, followed by a decreasing-freq chirp signal plus its first harmonic:
Fs = 1000; % Sample rate in Hz
Dur = 1; % One second time duration
Time = 0:1/Fs:Dur;
% Generate the fundamental increasing-freq chirp
Fstart = 100; % Start at 100 Hz
Fstop = 150; % Final freq of chirp
Sig_1 = chirp(Time,Fstart,Dur,Fstop); % Sweep from 100 –to- 150 Hz
% Generate 1st harmonic of the increasing-freq fundamental chirp
Fstart = 200; % Start at 200 Hz
Fstop = 300; % Final freq of chirp
Sig_2 = chirp(Time,Fstart,Dur,Fstop); % Sweep from 200 –to- 300 Hz
Sig = Sig_1 + Sig_2; % Increasing-freq chirp plus 1st harmonic
Sig = [Sig, fliplr(Sig)]; % Increasing-freq chirp followed by decreasing-freq chirp
Change the above variables to suit your needs, add your noise and ping signal, and start experimenting with your 'ping detection' method. (Add higher-freq harmonics if necessary.)
Now if you need a fundamental sine wave signal that randomly changes in frequency (plus its harmonics) then that's a whole different ballgame. To satisfy that need I'd have to think about ways of using 'continuous multitone FSK (freq shift keying) signal generation' techniques. Let's keep in touch on this.