I'm working on a sound source localization project and am interested in using GCC-PHAT as a feature. I'm quite new to this transformation and I've been reading a few papers about it and I'm still struggling with understanding what it actually is. One of the papers I'm interested in contains the following:

The maximum possible time delay between any 2 microphones is $τ = 0.2/340 = 0.5882ms$ where the sound speed is assume to be $340m/s$. Suppose we are using a sampling rate of 16kHz, then the maximum delay in samples is $n = 16000τ ≈ 21$. Hence, for each microphone pair, only the 21 correlation coefficients near the center contains useful information for DOA estimation.

First of all I'm not sure where $n = 21$ is coming from, seing as $0.2/340 * 16000 = 9.411$, but perhaps its simply an error on their part, but I was curious if this has something to do with GCC-PHAT. I've found several implementations and when I take a 10ms audio sample with a sample rate of 44.1kHz (441 samples) I get the following plot:

10ms of Audio at 44.1kHz after GCC-PHAT

So this is where I start to have questions as to what the actual feature is. But more to the point about the quote above, what exactly are the coefficients that are being referenced? Are these simply the correlation values around the center? And by transforming my x-axis to milliseconds, it seems that the peak is around 6ms. So does this mean that the signal arrived at microphone-1 6ms after microphone 0? Also any literature on the topic would be greatly appreciated, as I've so far only really been able to find code implementations but I'm trying to get a more intuitive understanding of the thing itself. Any help is greatly appreciated.


Let there be two microphones, $x_1(t), x_2(t)$ capturing a source, $s(t)$, with some additive noise $n_{1,2}(t)$ that is uncorrelated with the source and with each other (i.e., its effect can be ignored while calculating the cross-correlation). Let $\tau_0$ (in seconds) be the time difference of arrival between the two microphones. The time domain equations of the microphones are $$x_1(t) = s(t) + n_1(t) \\ x_2(t) = \alpha_0 s(t - \tau_0) + n_2(t) $$

Now, taking the FFT and converting these to the frequency domain would give us, $$ X_1(\omega) = S(\omega) + N_1(\omega) \\ X_2(\omega) = \alpha_0 S(\omega) \exp{(-j\omega \tau_0)} + N_2(t) $$

The cross correlation function of the two microphone signals (or the cross-power spectrum in the frequency domain), can be written as

$$ \begin{aligned} R_{x_1,x_2}(l) &= \mathbb{E}[x_1(t) x_2(t-l)] \\ R_{x_1, x_2}(\omega) &= X_1(\omega)X_2^*(\omega) \\ &= |S(\omega)|^2 \alpha_0 \exp{(j\omega \tau_0)} \end{aligned} $$

The Generalized Cross-Correlation function with Phase Transform (GCC-PHAT) at lag $l$ is defined as $$ \begin{aligned} \tilde{R}_{x_1,x_2}(l) =& \frac{1}{2\pi} \int_{-\pi}^{\pi} \frac{R_{x_1,x_2}(\omega)}{|R_{x_1,x_2}(\omega)|}e^{j\omega l}d\omega \\ =& \frac{1}{2\pi} \int_{-\pi}^{\pi} e^{j\omega(l + \tau_0)} d\omega \\ &= \delta(l - \tau_0) \end{aligned} $$ where $\delta$ is the Dirac-delta function which is non-zero at $l = \tau_0$, which is the time-difference of arrival (TDOA). Typically, the lag is calculated in samples, so to convert that to seconds, you have to divide it by the sampling rate.

I hope this helps in understanding GCC-PHAT, which is useful tool for TDOA estimation, and hence, source localization.

  • $\begingroup$ Yeah that gives me a slightly better understanding. Thanks for your time! $\endgroup$ – user25758 Apr 19 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.