Function File: [R, lag] = xcov ( X )
Function File: … = xcov ( X, Y )
Function File: … = xcov ( …, maxlag)
Function File: … = xcov ( …, scale)

Compute covariance at various lags [=correlation(x-mean(x),y-mean(y))].

X

input vector

Y

if specified, compute cross-covariance between X and Y, otherwise compute autocovariance of X.

maxlag

is specified, use lag range [-maxlag:maxlag], otherwise use range [-n+1:n-1].

scale:
biased

for covariance=raw/N,

unbiased

for covariance=raw/(N-|lag|),

coeff

for covariance=raw/(covariance at lag 0),

none

for covariance=raw

none

is the default.

Returns the covariance for each lag in the range, plus an optional vector of lags.

See also: xcorr.

Package: signal