Signal Processing Toolbox
  Go to function:
    Search    Help Desk 
xcov    Examples   See Also

Cross-covariance function estimate (equal to mean-removed cross-correlation).

Syntax

Description

xcov estimates the cross-covariance sequence of random processes. Autocovariance is handled as a special case.

The true cross-covariance sequence is the mean-removed cross-correlation sequence

where mx and my are the mean values of the two stationary random processes, 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.

v = xcov(x) is the autocovariance sequence for the vector x. Where x is an N-by-P array, v = xcov(X) returns am 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:

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.

Examples

The second output lags is useful when plotting. For example, the estimated autocovariance of uniform white noise cww(m) can be displayed for -10 m 10 using

Algorithm

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] and [2].

Diagnostics

xcov does not check for any errors other than the correct number of input arguments. Instead, it relies on the error checking in xcorr, which it calls.

See Also

conv
Convolution and polynomial multiplication.
corrcoef
Correlation coefficient matrix.
cov
Covariance matrix.
xcorr
Cross-correlation function estimate.
xcorr2
Two-dimensional cross-correlation.

References

[1] Bendat, J.S., and A.G. Piersol. Random Data: Analysis and Measurement Procedures. New York: John Wiley & Sons, 1971. Pg. 332.

[2] Oppenheim, A.V., and R.W. Schafer. Digital Signal Processing. Englewood Cliffs, NJ: Prentice Hall, 1975. Pgs. 63-67, 746-747, 839-842.



[ Previous | Help Desk | Next ]