# Cross-covariance

In statistics, the term cross-covariance is sometimes used to refer to the covariance cov(XY) between two random vectors X and Y, in order to distinguish that concept from the "covariance" of a random vector X, which is understood to be the matrix of covariances between the scalar components of X.

In signal processing, the cross-covariance is often called cross-correlation and is a measure of similarity of two signals, commonly used to find features in an unknown signal by comparing it to a known one. It is a function of the relative time between the signals, is sometimes called the sliding dot product, and has applications in pattern recognition and cryptanalysis.

## Statistics

For random vectors X and Y, each containing random elements whose expected value and variance exist, the cross-covariance matrix of X and Y is defined by

$\operatorname{cov}(X,Y)=\operatorname{E}[(X-\mu_X)(Y-\mu_Y)'],$

where μX and μY are vectors containing the expected values of X and Y. The vectors X and Y need not have the same dimension, and either might be a scalar value. Any element of the cross-covariance matrix is itself a "cross-covariance".

## Signal Processing

The cross-covariance is also relevant in signal processing where the cross-covariance between two wide-sense stationary random processes can be estimated by averaging the product of samples measured from one process and samples measured from the other (and its time shifts). The samples included in the average can be an arbitrary subset of all the samples in the signal (e.g., samples within a finite time window or a sub-sampling of one of the signals). For a large number of samples, the average converges to the true covariance.

Cross-covariance may also refer to a "deterministic" cross-covariance between two signals. This consists of summing over all time indices. For example, for discrete signals fi and gi the cross-covariance is defined as

$(f\star g)_i \ \stackrel{\mathrm{def}}{=}\ \sum_j f^*_j\,g_{i+j}$

where the asterisk indicates that the complex conjugate is taken when the signals are complex-valued.

For continuous functions f (x) and g (x) the (deterministic) cross-covariance is defined as

$(f\star g)(x) \ \stackrel{\mathrm{def}}{=}\ \int f^*(t) g(x+t)\,dt$

### Properties

The cross-covariance of two signals is related to the convolution by:

$f(t)\star g(t) = f^*(-t)*g(t),$