xcorr1
Estimates the cross-correlation.
Calling Sequence
[R, lag] = xcorr1 (X, Y, maxlag, scale)
[R, lag] = xcorr1 (X, Y, maxlag)
[R, lag] = xcorr1 (X, Y)
Parameters
X:
[non-empty; real or complex; vector or matrix] data.
Y:
[real or complex vector] data.
maxlag:
[integer scalar] maximum correlation lag If omitted, the default value is N-1, where N is the greater of the lengths of X and Y or, if X is a matrix, the number of rows in X.
scale:
[character string] specifies the type of scaling applied to the correlation vector (or matrix). is one of:
Description
This is an Octave function.
Estimate the cross correlation R_xy(k) of vector arguments X and Y or, if Y is omitted, estimate autocorrelation R_xx(k) of vector X, for a range of lags k specified by argument "maxlag". If X is a
matrix, each column of X is correlated with itself and every other column.
The cross-correlation estimate between vectors "x" and "y" (of length N) for lag "k" is given by
N
R_xy(k) = sum x_{i+k} conj(y_i),
i=1
where data not provided (for example x(-1), y(N+1)) is zero. Note the definition of cross-correlation given above. To compute a cross-correlation consistent with the field of statistics, see xcov.
Examples