# Signal matching: How to quantify the difference between two signals of varying frequency

I have two waves, and I would like to quantify the difference between them.

They are exponential sine waves where the frequency decreases with time.

I'm interested in the difference in decay constant between the signals. I thought maybe I could use some kind of FFT method to get the envelope, but I don't know what to do with the varying frequency.

• If these are reasonably "clean" sine waves, an electrical engineer would figure out a frequency to voltage converter (which is a diode, a resistor, and a capacitor) and just compare the rate of change of the two voltages. – Daniel R Hicks Jul 3 '12 at 20:48
• Are you trying to track the amplitude decay or the frequency decay? Or both? And do you have a model for how the frequency is changing? Is it exponential as well, or just linear? – datageist Jul 3 '12 at 20:58
• I'm just trying to compare the amplitude decay. – Christina Jul 6 '12 at 20:01

## 1 Answer

For a relatively easy answer you can use a short-time Fourier transform and use the largest value as the estimate of your sinusoid frequency. The basic idea is that you do short Fourier transforms at different points in time to see how it changes. The problem with that is that you have a tradeoff between time resolution and frequency resolution. Shortening the Fourier transform improves the time resolution at the expense of the frequency resolution. Conversely, making the Fourier transform longer improves the frequency resolution at the expense of the time resolution.

The frequency resolution can be improved by using quadratic interpolation to get a finer estimate of the true sinusoid peak.

Another way to go that can get you very good frequency estimation at every point in time is with a phase-locked loop. Phase-locked loops are a little trickier to set up though, because you have to get the feedback gains right. There is also a tradeoff in regards to responsiveness (akin to time resolution) and resistance to noise.