May 8, 2017

Understanding Doppler phase

I wanted to fuse the real-time mic recording on my iPhone with the accelerometer/gyro signals for my hobby indoor location project.  But for reasons I discussed in my previous blog entry, I am currently stuck.  To get unstuck, I started thinking about the range rate estimation used in radars, which are primarily Doppler based.  Doppler frequency shift is covered in high school physics, but it's been a long time since I've had to think about Doppler, so I derived it out myself.

Consider a mic M initially at rest, being subject to a sound wave of frequency F, and wave speed c, as shown below.  For convenience, let's pick the beginning of sample to coincide with phase 0 of the sine wave.  This is just picking the constant offset phase, so using 0 initial phase does not invalidate the ensuing derivation.
Since the mic is at rest (v_M = 0), the sound wave passes by the mic at c [m/s].  After t [s] passes, the mic will experience the phase 𝛟 = 2𝛑Ft of the sound wave, as shown below.
Now suppose the mic is moving at v [m/s].  Then the situation is exactly analogous to a race between the mic and the sound wave; so relative to the mic, the sound wave is moving slower than when the mic was stationary, as shown below.
How much slower?  After the same t [s], the wave phase will have moved -2𝛑Ft * v/c less than previous case, so that the mic is now experiencing the phase 𝛟 = 2𝛑F(1-v/c)t.  When I divide the difference of phase between the 2 cases -2𝛑t * v/c by the elapsed time t, I get -2𝛑F v/c, which is exactly the Doppler frequency shift.  This also make sense because the derivative of phase is frequency.

This derivation might be helpful if you want to measure Doppler from the raw waveform rather than by measuring the received wave frequency, as in radar processing.  The problem I find with frequency based estimation is that I cannot get the instantaneous frequency; since frequency requires several waveforms to estimate (the more the more accurate).  So while the Doppler from frequency domain processing may be fine in an average sense, I have to give up some resolution in the process.  Since radar waves are typically microwave frequency, requiring lots of periods is not a problem for radar applications (even after the signal is heterodyned and down-sampled).  But for sound waves sampled at CD sample rate, requiring say 20 periods (I would not go below due to noise concerns) of 10 kHz wave would equate to 10 / F = 2 ms, which may start to be a problem for high dynamics applications.
Estimating the wave phase directly as a function of the range rate might also be helpful for estimating the distance change directly from the raw audio signal.  I actually just read The Doppler Equation in Range and Range Rate Measurement, NASA Technical Note X-55373, dating back to 1965 (!) for the Apollo program, where the debate seems to have been over how best to track both the range and range rate of the rocket.  Even though the author (NASA Goddard) seems to have decided in favor of obtaining the range by integrating the estimated range rate (from Doppler), you might find the direct estimation of the range (without the random walk noise inducing integration step) useful.  In the next month, I hope to find some time to implement a Kalman filter to do just that.