0
$\begingroup$

I currently have a real-time noise suppression algorithm based on two inputs from different microphones. It has passed most tests that I have thrown at it, however when the signal I am trying to retrieve has a slight delay one mic relative to the other it works poorly.

I have done preprocessing delay estimation in the input signal through cross-correlation just for testing and it works, however in the final algorithm I can't preprocess the signal as it is supposed to be real-time.

I am taking sub windows of signals and applying my algorithm, what I tried to do is apply the cross-correlation to each sub window, it takes the FFT of the sub windows does the calculation and then the IFFT just to get the delay each time. I later have to take the FFT of the sub window with a different windowing function for my filtering algorithm. This much extra processing will drastically reduce the sub window size my algorithm can keep up with in real-time.

The question is, is there a faster way to do this delay estimation? Maybe something that works with each input sample to get a better estimation each time? Something like a control loop?

Thanks in advance!

$\endgroup$
  • $\begingroup$ if the relative delay difference between the two signals is not rapidly varying, you can still use cross-correlation to estimate the delay difference. the result of this operation need not be updated as often as each audio sample. $\endgroup$ – robert bristow-johnson Mar 6 '16 at 6:38
  • $\begingroup$ @robert That could be one option however the cross-correlation calculated with just the sub window samples seems a little unstable due to the noise in the input signals, this could lead to an extended period of time without correct delay correction, if another algorithm is possible that would probably be the chosen path to take. However that could be a good way to go around the problem in case of no other solutions. Thanks mate! $\endgroup$ – João Victor Manke Mar 6 '16 at 19:53
  • $\begingroup$ @robertbristow-johnson actually I just realized that I am doing most of the calculations for cross-correlation anyway in my algorithm. Do you know if there is a way to retrieve the delay directly from the frequency domain rather than having to transform back to the time domain? $\endgroup$ – João Victor Manke Mar 8 '16 at 13:48
  • $\begingroup$ i don't quite get it. the data original comes to you in the time domain. you say you're already doing most of the cross-correlation anyway. to do cross-correlation in the frequency domain you multiply the spectrum of one times the complex conjugate of the spectrum of the other. but what you look for are maximums in the time domain result. my suggestion is to fix the buffer of one signal (the reference) to a specific time and allow the other to slide one sample per sample. so you are correlating the most recent N samples of the "other" to a fixed segment of the reference. $\endgroup$ – robert bristow-johnson Mar 8 '16 at 19:15
  • $\begingroup$ do that once per sample. so the non-reference signal window slides one sample for each sample of the input. so you get the result of one point of the cross-correlation per sample. after N samples you can judge which is the maximum correlation and reset the frame of the reference signal. the cost is one N-point FIR per sample. $\endgroup$ – robert bristow-johnson Mar 8 '16 at 19:16
1
$\begingroup$

I can't comment because I'm a new user... have a look to these questions:

Estimating the time offset (delay) between two audio signals in real-time

Generalized Cross Correlation

Time delay estimation of oscilloscope signals using cross correlation

$\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.