Cross correlation function using Fast Fourier Transforms (FFT).


fcorr(vec_expr_1, vec_expr_2)


vec_expr_1, vec_expr_2
A pair of valid vector expressions.
Curve Math Vectors Result
x = 0:(numpts(c1.y)-1):1

y = fcorr(c1.y, c2.y)

Given c1 and c2, a curve is created which is the cross-correlation between the y vectors of c1 and c2.


The fcorr function uses Fast Fourier Transforms to calculate cross-correlations, defined as:


Both vec_expr_1 and vec_expr_2 must be vectors, and they must have the same number of points. The result, a normalized, biased correlation between the two vectors, is a vector with the same number of points as vec_expr_1.

If the same vector is given as vec_expr_1 and vec_expr_2, the result is the autocorrelation function for that vector. The two vectors are said to be completely correlated at a given lag if the correlation function at that lag is one. They are said to be uncorrelated if the value is zero.

A typical x vector for plotting a cross-correlation curve is shown below:

0 : numpts(vec_expr_1)-1 : 1

This method is faster than dcorr, but less accurate, especially at large lags.