Skip to main content

Module fft_cross_correlation

Module fft_cross_correlation 

Source
Expand description

FFT-based cross-correlation, similar to scipy.signal.correlate(..., method="fft").

See the book entry Convolution and correlation.

Functionsยง

fft_autocorrelate
Autocorrelation of x with itself (full mode: lags -(n-1)..=n-1, peak at lag 0).
fft_correlation_peak
Finds the lag at which in1 best matches in2 (the peak of the magnitude of their full cross-correlation). A positive lag means in1 is in2 delayed by that many samples. Returns (lag, correlation value at the peak).
fft_cross_correlate
Cross-correlation of in1 with in2 computed with FFTs: correlate(a, b) = convolve(a, reverse(conj(b))), so out[k] measures how well in2 delayed by the corresponding lag matches in1 (see cross_correlation_lags for the lag of each output).