
Computing the Doppler shift of a frequency is directly proportional to its speed.  For a target approaching, the Doppler frequency is given by:

1) fapproach = fsrc*( c / (c-v)), where fsrc is the original frequency of the source, c is the speed of light, and v is the velocity of the target

For a target retreating, the Doppler frequency is given by:
2) fdepart = fsrc*(c / (c+v))

In these equations, it assumes we know the source's original frequency.  In RC flight, typically we do not know the source (plane motor) frequency, but we can measure the approaching and retreating frequencies when the plane passes overhead of our recording mic.

To deduce speed, we can divide equation 1) by 2) and solve for velocity:

here we get fapproach/fdepart = (c+v)/(c-v)

So that v = c*(fapproach-fdepart)/(fapproach + fdepart)

From this measured velocity, we can even estimate the source's original frequency by sticking the result back into eq 1).

fsrc = 2*fdepart*fapproach/(fapproach + fdepart)

Auido Doppler speed processing is the method of using recorded audio to deduce the speed of a target passing overhead.  Doing this typically utilizes a time-frequency plot known as a spectrogram.  The spectrogram is a plot that shows all the frequencies of a signal over a time period. 

For a target passing overhead, we will be able to see an incoming frequency that changes as the target passes overhead.  This is typically seen as an "S" shaped curve in the spectrogram.  From this curve we can measure fapproach and fdepart as the plane goes overhead.  These are called the frequency "endpoints" of the curve.  

We will also see multiple "S" curves in the spectogram plot (depending on the audio's sample rate), with the leftmost curve being at the lowest frequency range.  This is called the fundamental.  The higher frequency curves are known as harmonics, and they typically show up at integer multiples of the fundamental frequency.

For computing speed, using a harmonic frequency Doppler curve is beneficial. When computing the RPM of the motor, we need to use the fundamental Doppler curve.


Using the program:
------------------

Load up a wav file. Pick the FFT size so that you get somewhere between 5-10Hz of spectral resolution. 

Do the spectrogram on the signal.  You will see the S-shaped curves in the spectrogram plot if you have a clean enough signal.


Selecting your frequency endpts:
--------------------------------

There is a zoom button on the top of the graph (magnifying glass with + inside of it).  Use the zoom button on the plot to drag and zoom to one of the doppler curves. The rightmost curve is usually good for speed measurements since it is a harmonic of the fundamental freq and will spread over a larger freq range.

The before (approaching) frequency and after (retreating) frequency endpts will be right to left. The x axis on the plot is frequency, and the y axis is time. 

When the plane is approaching the frequency will appear higher. When the plane passes over, the frequency will get lower. Also the bottom part of the spectrogram plot is when the recording started, and the top of the plot is the end of the recording (time wise). So imagine the plane traveling from bottom to top of the plot. The s-curve shows you where the plane passed overhead and the frequency went from high to low.  We are concerned about accurately determining the time when the plane passed overhead so we can measure the 2 frequency endpoints that equal the approaching and retreating frequencies.

Chooing good endpts are before and after the s-shaped curve. This is where the plane goes overhead, and you are trying to estimate the approaching and retreating frequency of the plane to deduce speed.  For the high freq point, select a place on the line before this curve happens. Typically where the curve starts to resemble a line is a good starting point. Do the same for the low frequency, but right after the curve ends and starts to go linear again. These will be the bracketed freq points where the plane passed over.

To compute speed, try to use the rightmost harmonic doppler curve. Why? Because its spread in frequency will be the greatest by definition, and any error in picking the endpts will be greatly reduced when computing the doppler speed.

You can see this by computing speed using the rightmost doppler curve, then repeating it using the leftmost curve. The leftmost curve will give results that differ more each time you do this based on the chosen endpts. The rightmost curve will easily give results +/- 1mph when choosing slightly different endpts. So a small freq endpt error (around 5Hz) will give greater speed variation when using the leftmost curve versus rightmost curve.

Now change the temperature to match the outside temp of when the audio was recorded.  This is because the speed of sound travels faster in warmer air, and this needs to be taken into account for accurate Doppler calculations (default is 0 deg C).  Next hit the compute doppler button. It will spit out a speed based on the freq pts chosen.


Warning, some technical info below!
----------------------------------

You want to use an FFT length that gives you somewhere around 5-10Hz of spectral resolution or 50-100ms of time resoultion. That is a good starting point.

Increasing the FFT length will allow you to better estimate frequencies that are constant in the plot (you will see the lines get much tighter) but the area of changing freqs (like the overhead pass part of the curve) will get "blockier". The is the classic compromise in the spectrogram method. Likewise, decreasing the FFT length will give more error in the constant frequency areas, but it will give the overhead pass better resolution.

This is called time-bandwidth product. Increasing the FFT length gives better freq. determination (a constant tone in the file) at the cost of worse time resolution (being able to tell when a tone started and stopped in the file). Decreasing the FFT length gives better time resolution at the cost of worse freq. determination. There are ways to mitigate these issues, like moving to wavelet processing. But that is probably overkill here.

For the user, determining the best compromise between freq. and time resolution to estimate the doppler frequencies is part of the process. You want to be able to tell exactly when the overhead pass started and ended with impeccable frequency resolution, but this is something you cant do. In short, improving accuracy of one requirement makes the other one worse. But there is a middle ground.  I have found that a 10Hz freq resolution gives a good compromise and allows very accurate Doppler measurements!


