Computes discrete auto or cross covariance
[c [,lagindex]] = xcov(x [,maxlags [,scaling]])
[c [,lagindex]] = xcov(x,y [,maxlags [,scaling]])
:x a vector of real or complex floating point numbers. : :y a vector of real or complex floating point numbers. The default
value is x.
:
If the maxlags argument is given xcov returns in c the sequence of covariance lags . If maxlags is greater than length(x), the first and last values of c are zero.
The scaling argument decribes how is normalized before being returned in c:
The `corr`_ function computes the “biased” covariance of x and y and only return in c the sequence of covariance lags .
This function computes using xcorr(x-mean(x),y-mean(y),...).
t = `linspace`_(0, 100,2 000);
y = 0.8 * `sin`_(t) + 0.8 * `sin`_(2 * t);
[c, ind] = xcov(y, "biased");
`plot`_(ind, c)
Version Description 5.4.0 xcov added. .. _xcorr: xcorr.html .. _corr: corr.html .. _fft: fft.html