I am using cross-correlation for time delay estimation of two synchronized recordings ($x_1$ and $x_2$) of a fixed sound source from two different locations.

I understand that the delay is associated with the maximum cross-correlation coefficient.

My question: should I use the maximum of the cross-correlation coefficient vector or absolute cross-correlation coefficient vector?


$\Delta t \approx \tau_{peak} = \underset{\tau}{\arg\max} (\rho_{x_1 x_2}(\tau))$

or this

$\Delta t \approx \tau_{peak} = \underset{\tau}{\arg\max} (|\rho_{x_1 x_2}(\tau)|)$

enter image description here


1 Answer 1


As your plot shows, the second form allows for the correlation peak to be negative. Now, what does a strong negative cross correlation mean? It means the signals are very similar, except one has a negative sign in front of it, i.e., $x_1 \approx -x_2$. Whether or not this makes sense depends a lot on the actual application.

In the application you describe, it would totally make sense to me. See, signals that are transmitted from a source and travel to a destination through some medium are subject to changes in their phase, either due to reflections or the transmission itself. A minus sign corresponds to the opposite phase, which can very likely represent the signal you are looking for, only having gone through an appropriate phase change.

So if I were you, I would allow for the correlation to be negative and look for peaks in the magnitude of the correlation function. Eventually, it still depends on the exact requirements of your application.

If you have the chance, I'd suggest to try some calibration measurements with known source and receiver positions to see what's going on. Then you could even compare both approaches.

  • $\begingroup$ Thanks, Florian! Helpful indeed. More context: this is actual sound recordings by a pair of submerged hydrophones (600m apart) of a water leak on a straight pipe. Since the two returned delays (from max & max of absolute) are close in this case & given all the other uncertainties (e.g., wave speed), it is hard to verify experimentally. Would this extra info alter your answer? $\endgroup$
    – Reveille
    Commented Jul 2, 2019 at 16:07
  • 1
    $\begingroup$ I still can't say for sure, but my gut feeling would be to allow for the correlation to be negative, i.e., go with the second formula. If you're not sure, best you can do is try and see if the results look plausible either way, I guess. $\endgroup$
    – Florian
    Commented Jul 3, 2019 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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