# what degree of accuracy does quadratic interpolation add to fft cross-correlation?

I am not a dsp engineer, so I might be missing some obvious background, but I've been doing my best to educate myself. Let me know if there's more info needed.

I am using an fft cross-correlation algorithm to process 2 channels of incoming microphone audio. The goal is to ascertain the delay between the two audio streams in order to calculate the sound origin in terms of relative distances from each microphone.

I am getting the expected results for my setup: the soundcard and software are running at 48k sample rate, and I have a resolution of 1 sample (0.02 ms) for calculating delays in the streams.

My intended application of this would require a resolution of 0.002 ms or less, and I can't increase the sample rate beyond 48k. So I am trying to get a sub-sample resolution of the cross-correlation using interpolation as described here: How to Interpolate the Peak Location of a DFT or FFT if the Frequency of Interest is Between Bins

I am wondering: Is there a way of predicting what amount of resolution can interpolation (say quadratic interpolation) add to this system?

A bonus question: I'm proposing interpolating the fft results, but would there be benefits to also interpolating/upsampling the incoming audio streams pre-fft?

• I use quadratic interpolation in autocorrelation (application is pitch detection or splice displacement estimation) and have good results. The result is guaranteed to be within $\pm \frac12$ sample from the discrete peak sample. I don't use the DFT or FFT to compute autocorrelation because my application is real time. Do you window and zero-pad the data going into the FFT? You really should and it might make your peaks smoother a little and make the quadratic location of the true peak even better. Sep 28, 2023 at 16:17
• Thanks for the info! I am windowing and zero-padding. I'm using fft because I had read that cross-correlation in the frequency domain is more resilient with noisy data. a delay of 1024 samples is close enough to real-time for my purposes. Sep 28, 2023 at 16:28
• Is the location of the correlation peak the only parameter of interest? Is the height of the peak a number that you need to use? Are you getting multiple peaks and have to decide which peak to use to match delay? Sep 28, 2023 at 16:40
• If you are properly sampled, then you ability to do peak location estimation is limited more by SNR and channel mismatch than sample rate. If you had perfectly balanced channels and infinite SNR, then you could upsample/interpolate the cross-correlation and get as fine of an estimate as you wanted. Sep 28, 2023 at 17:19
• @AnonSubmitter85, So the limit of accuracy of interpolation is system specific, based on the amount of noise, and any disparities between the two signals? I guess that's why I couldn't find any general answer. Sep 28, 2023 at 23:40

There should be plenty of literature out there on the accuracy of TDOA methods. An example is

S. Stein, "Algorithms for Ambiguity Function Processing." IEEE Transactions on Acoustics, Speach, and Signal Processing, June 1981.

In the above you will find the following formula for the standard deviation of TDOA estimates:

$$\sigma_{\mathrm{TDOA}} = { {0.55} \over { B \sqrt{ T \cdot B \cdot \mathrm{SNR}_{eff} } } },$$

where $$B$$ is the bandwidth, $$T$$ is the time duration, and $$\mathrm{SNR}_{eff}$$ is the effective SNR. The above ignores channel mismatch, but should be a good starting point.