4
$\begingroup$

I'm looking for an algorithm which can accurately estimate the time-offset/delay between two audio signals in real-time. One audio signal is a loudspeaker signal and the other signal is the microphone signal.

Audio is processed in blocks of 10ms (sample frequency 16kHz).

  • There is light office noise embedded in the signals
  • The algorithm must be able to estimate delays up to 500ms.
  • The delay is usually constant for a period of time (with some variability -10ms to 10ms), but occasionally the delay "jumps". Those sudden jumps can be in the order of 50 to 80 ms. The algorithm must be able to handle that.

I've read that GCC PHAT is one algorithm which can be used, but I'm not sure how it would work in a real-time environment.

$\endgroup$
5
$\begingroup$

There are a variety of techniques available. See this thesis for a nice write-up.

See the list of algorithms:

enter image description here

In particular, note that they recommend pre-whitening the signals before correlation --- to ensure that the cross-correlation has a nice, narrow peak for better "localization".

$\endgroup$
4
$\begingroup$

Cross correlation is what you want. If the two signals are similar then the cross correlation should produce a large peak. The location of the peak would tell you what the sample offset is, and the sample offset together with the sample frequency tells you the time delay between the two.

$\endgroup$

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.