# Frequency dependent phase difference between signals arriving at two microphones

I wish to calculate the time difference between a signal (may or may not be periodic), arriving at the right and left channel of a stereo microphone pair kept at a distance of about 30 cm. I am doing so to localize the acoustic source.

I compute the FFT of the left channel and the right channel, and then find the values of the FFT at a particular frequency bin of interest. I then divide the (complex) values to get the phase difference in radians. I then convert the phase difference to a time difference ( time difference = phase difference / 2* pi ) and use this to calculate the angle of arrival of the acoustic source.

What are the ambiguities that could occur in this method of calculating the time difference, as compared to a cross-correlation method of finding time difference?

I am using this method rather than cross-correlation due to the frequency dependence of the phase difference.

• Samyukta - Please see my response to this post on equalizing the left and right channels including the compact Matlab code that can be used; the delay of the equalizer response would be the delay between the channels; accounting for all multipath effects. dsp.stackexchange.com/questions/31318/… – Dan Boschen Nov 4 '16 at 4:01

• what hot says is true. but, at high frequencies, you might somehow get off by a whole multiple of $2 \pi$. really the safest thing to say is to say that difference of the principle values of the phase (what is between $-\pi$ and $+\pi$) between the two is, ideally, $$\phi_y[k] - \phi_x[k] = 2 \pi (\tfrac{k}{N} \tau_{yx} + m[k])$$ where $m[k]$ is an integer and $m[0]=0$ and $0 \le m[k+1]-m[k] \le 1$. And $\tau_{yx}$ is the distance, measured in sample periods, that microphone $y$ is further from the source than microphone $x$. And $N$ is the FFT size. – robert bristow-johnson Jun 2 '17 at 3:18
Also bare in mind that to avoid Spatial Aliasing, the distance between microphones must be < $\frac{\lambda}{2}$ where $\lambda$ is the wavelength of the frequency of interest. At 30cm the highest frequency you can localize without ambiguity would be about 560Hz