Matlab provides xcorr to calculate the cross/auto-correlation of two/one random variables.

[r,lags]=xcorr(x,y,’coeff’)

will calculate the cross-correlation of x and y using

Here “coeff” optional keyword is used to normalize the result with L2-norm.

However

[c,lags]=xcov(x,y,’coeff’)

calculates the cross-variance of x and y using

Here “coeff” keyword will normalize the result with the variance of X and Y. The factor comes from the unbiased variance

### Like this:

Like Loading...

*Related*