What is the definition of Generalized Cross Correlation?
I need it for estimating the delay (time offset) between two audio signals. The time offset between the two signals might be as large as 500ms.
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It only takes a minute to sign up.
Sign up to join this communityCross-correlation implies that you have 2 signals, and there is a delay between them. A 'basic' frequency domain cross-correlator does an FFT on each signal, conjugates one of them, multiplies one versus the other, then inverse transforms. A peak in the result indicates a time delay.
There are a lot of problems with this simple approach. For instance: you want a linear cross-correlation instead of a circular one; you may have strong sinusoidal interference which will generates multiple peaks; you may have very low SNR; the noise may not be what you expect it to be, etc.
A 'generalized' cross-correlation adds a windowing (or filtering) function prior to the inverse transform. It's purpose is to improve the estimation of the time delay, depending on the specific characteristics of the signals and noise (broadband/narrowband/interference signals, Gaussian noise, etc.). Since there are many different types of signals and noise, there are many different window functions (eg.: SCOT, Ekhart, etc.) Each one is designed for specific problems. Understanding these differences is not trivial, nor is proper calculation of the window function. They are typically dealt with in graduate-level time delay estimation or sonar/radar courses.
Some references for generalized cross-correlation are:
J. C. Hassab, R. E. Boucher, “Optimum Estimation of Time Delay by a Generalized Correlator,” IEEE T-ASSP, vol. 27, no. 4, Aug. 1979, pp. 373-380 (discusses various window types).
J. C. Hassab, R. E. Boucher, “Performance of the Generalized Cross Correlator in the Presence of a Strong Spectral Peak in the Signal,” IEEE T-ASSP, vol. 29, no. 3, June 1981, pp. 549-555.
J. C. Hassab, R. E. Boucher, “An Experimental Comparison of Optimum and Sub-Optimum Filters’ Effectiveness in the Generalized Correlator,” J. Sound and Vibration, 1981, pp. 4+ (12 pages total)(Fig. 1 contains a block diagram of a generalized cross-correlator).
There are many others.
EDIT The OP mentions below Deve's answer that this was not the "Generalized Cross Correlation" algorithm referred to. The real one seems to be this one:
This paper seems to give equations about how to implement it in the time domain.
The equation they give is basically what Deve reports below. The key point they make is that the "input" to the cross-correlation is not the bare signals, but the residuals of an LMS algorithm applied to the bare signals.
This as the effect of pre-whitening the input signals.
The method seems to be from this paper:
doi: 10.1109/TASSP.1984.1164314
Abstract: The problem of estimating time delay by cross correlation methods is reexamined for the whole class of stationary signals. Expressions are derived for the estimation mean square error (MSE) by the cross correlation method, and are shown to be identical to previously published results for Gaussian signals. The generalized cross correlation method is also analyzed, and the optimal weight function for this method is derived. It is shown to be identical to that derived for Gaussian signals by the maximum likelihood method. For the cross correlation method a simplified MSE expression is derived, which is to be used instead of a previously published result.
keywords: {Autocorrelation;Bandwidth;Correlation;Delay effects;Delay estimation;Error analysis;Estimation error;Maximum likelihood estimation;Mean square error methods;Signal to noise ratio}
From which the key formula appears to be:
where
I'm not sure what the "generalized" exactly refers to. But to calculate the time offset between two (discrete time) audio signals $r(n)$ and $s(n)$ I would use the following cross correlation function: $$ R(m) = \sum_{n=0}^{N-1}r(n)s^*(n-m) $$ Here, $()^*$ denotes the conjugate complex and $N$ is the length of the audio signals assuming they have the same length. The position of the maximum of $R(m)$ is expected to be the time offset.
d
array defined ? (it is a array of time) Because ifxi
andxj
signals have a lengthLi
andLj
, the simple cross correlation is given byR(tau)
whereR
andtau
are arrays of length(Li+Lj)-1
But here, for the generalized cross correlation,Rgcc
has a lengthLi
(orLj
, it works only if they have the same length). Does someone has the answer ? Thanks in advance (I add references : xavieranguera.com/phdthesis/node92.html and xavieranguera.com/phdthesis/node $\endgroup$