| Contents | Index |
v=xcov(x,y)
v=xcov(x)
v = xcov(x,'option')
[c,lags]=xcov(x,y,maxlags)
[c,lags]=xcov(x,maxlags)
[c,lags]=xcov(x,maxlags)
[c,lags]=xcov(x,y,maxlags,'option')
xcov estimates the cross-covariance sequence of random processes. Autocovariance is handled as a special case.
The true cross-covariance sequence is the cross-correlation of mean-removed sequences
![]()
where μx and μy are
the mean values of the two stationary random processes,
denotes the complex conjugate,
and E{·} is the expected value operator. xcov estimates
the sequence because, in practice, access is available to only a finite
segment of the infinite-length random process.
v = xcov(x,y) returns the cross-covariance sequence in a length 2N-1 vector, where x and y are length N vectors. For information on how arrays are processed with xcov, see Multiple Channels.
v = xcov(x) is the autocovariance sequence for the vector x. Where x is an N-by-P array, v = xcov(x) returns an array with 2N-1 rows whose P2 columns contain the cross-covariance sequences for all combinations of the columns of x.
By default, xcov computes raw covariances with no normalization. For a length N vector

The output vector c has elements given by c(m) = cxy(m-N), m = 1, ..., 2N-1.
The covariance function requires normalization to estimate the function properly.
v = xcov(x,'option') specifies a scaling option, where 'option' is
'biased', for biased estimates of the cross-covariance function
'unbiased', for unbiased estimates of the cross-covariance function
'coeff', to normalize the sequence so the auto-covariances at zero lag are identically 1.0
'none', to use the raw, unscaled cross-covariances (default)
See [1] for more information on the properties of biased and unbiased correlation and covariance estimates.
[c,lags] = xcov(x,y,maxlags) where x and y are length m vectors, returns the cross-covariance sequence in a length 2*maxlags+1 vector c. lags is a vector of the lag indices where c was estimated, that is, [-maxlags:maxlags].
[c,lags] = xcov(x,maxlags) is the autocovariance sequence over the range of lags [-maxlags:maxlags].
[c,lags] = xcov(x,maxlags) where x is an m-by-p array, returns array c with 2*maxlags+1 rows whose P2 columns contain the cross-covariance sequences for all combinations of the columns of x.
[c,lags] = xcov(x,y,maxlags,'option') specifies a scaling option, where 'option' is the last input argument.
In all cases, xcov gives an output such that the zeroth lag of the covariance vector is in the middle of the sequence, at element or row maxlag+1 or at m.
The second output lags is useful when plotting. For example, the estimated autocovariance of white Gaussian noise cww(m) can be displayed for -10 ≤ m ≤ 10 using:
ww = randn(1000,1); % White Gaussian noise [cov_ww,lags] = xcov(ww,10,'coeff'); stem(lags,cov_ww)
xcov computes the mean of its inputs, subtracts the mean, and then calls xcorr. For more information on estimating covariance and correlation functions, see [1].
xcov does not check for any errors other than the correct number of input arguments. Instead, it relies on the error checking in xcorr.
[1] Orfanidis, S.J., Optimum Signal Processing. An Introduction. 2nd Edition, Prentice-Hall, Englewood Cliffs, NJ, 1996.
conv | corrcoef | cov | xcorr | xcorr2

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |