Matlab provides xcorr to calculate the cross/auto-correlation of two/one random variables.
will calculate the cross-correlation of x and y using
Here “coeff” optional keyword is used to normalize the result with L2-norm.
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