[PD] Cross correlation using FFT

Jamie Bullock jamie at postlude.co.uk
Mon Apr 3 21:20:21 CEST 2006


Hi,

Has anyone implemented cross correlation in PD using rifft~? I am confident with performing cross correlation in the time domain, but am a little confused about how the equivalent operation can be conducted using FFTs. So far I understand the algorithm to be:

1. Zero pad the signal vectors to twice the vector size
2. Take their ffts: fft(x) fft(y)
3. Take the complex conjugate of fft(x) and multiply this by fft(y)
4. Take the inverse fft of the result.

Whatever I try doesn't seem to give the correct output. In particular - I am unsure of step 3 above. Can anyone give some clarification or an example patch.

TIA,

Jamie




More information about the Pd-list mailing list