In signal processing, cross-correlation is a measure of similarity of two series as a function of the displacement of one relative to the other. This is also known as a sliding dot product or sliding inner-product. It is commonly used for searching a long signal for a shorter, known feature. It has applications in pattern recognition, single particle analysis, electron tomography, averaging, cryptanalysis, and neurophysiology. The cross-correlation is similar in nature to the convolution of two functions. In an autocorrelation, which is the cross-correlation of a signal with itself, there will always be a peak at a lag of zero, and its size will be the signal energy. In probability and statistics, the term cross-correlations refers to the correlations between the entries of two random vectors 𝐗 and 𝐘, while the correlations of a random vector 𝐗 are the correlations between the entries of 𝐗 itself, those forming the correlation matrix of 𝐗. If each of 𝐗 and 𝐘 is a scalar random variable which is realized repeatedly in a time series, then the correlations of the various temporal instances of 𝐗 are known as autocorrelations of 𝐗, and the cross-correlations of 𝐗 with 𝐘 across time are temporal cross-correlations. In probability and statistics, the definition of correlation always includes a standardising factor in such a way that correlations have values between −1 and +1. If X and Y are two independent random variables with probability density functions f and g, respectively, then the probability density of the difference Y−X is formally given by the cross-correlation (in the signal-processing sense) f⋆g; however, this terminology is not used in probability and statistics. In contrast, the convolution f∗g (equivalent to the cross-correlation of f(−t)‾ and g(t)) gives the probability density function of the sum X+Y.
Cross-correlation of deterministic signals For continuous functions f and g, the cross-correlation is defined as:(f⋆g)(τ) ≜∫−∞∞f(t)‾g(t+τ)dtwhich is equivalent to(f⋆g)(τ) ≜∫−∞∞f(t−τ)‾g(t)dtwhere f(t)‾ denotes the complex conjugate of f(t), and τ is called displacement or lag. For highly-correlated f and g which have a maximum cross-correlation at a particular τ, a feature in f at t also occurs later in g at t+τ, hence g could be described to lag f by τ. If f and g are both continuous periodic functions of period T, the integration from −∞ to ∞ is replaced by integration over any interval [t0,t0+T] of length T:(f⋆g)(τ) ≜∫t0t0+Tf(t)‾g(t+τ)dtwhich is equivalent to(f⋆g)(τ) ≜∫t0t0+Tf(t−τ)‾g(t)dtSimilarly, for discrete functions, the cross-correlation is defined as:(f⋆g)[n] ≜∑m=−∞∞f[m]‾g[m+n]which is equivalent to:(f⋆g)[n] ≜∑m=−∞∞f[m−n]‾g[m]For finite discrete functions f,g∈ℂN, the (circular) cross-correlation is defined as:(f⋆g)[n] ≜∑m=0N−1f[m]‾g[(m+n)mod N]which is equivalent to:(f⋆g)[n] ≜∑m=0N−1f[(m−n)mod N]‾g[m]For finite discrete functions f∈ℂN, g∈ℂM, the kernel cross-correlation is defined as:(f⋆g)[n] ≜∑m=0N−1f[m]‾Kg[(m+n)mod N]where Kg=[k(g,T0(g)),k(g,T1(g)),…,k(g,TN−1(g))] is a vector of kernel functions k(⋅,⋅):ℂM×ℂM→ℝ and Ti(⋅):ℂM→ℂM is an affine transform. Specifically, Ti(⋅) can be circular translation transform, rotation transform, or scale transform, etc. The kernel cross-correlation extends cross-correlation from linear space to kernel space. Cross-correlation is equivariant to translation; kernel cross-correlation is equivariant to any affine transforms, including translation, rotation, and scale, etc.
Explanation As an example, consider two real valued functions f and g differing only by an unknown shift along the x-axis. One can use the cross-correlation to find how much g must be shifted along the x-axis to make it identical to f. The formula essentially slides the g function along the x-axis, calculating the integral of their product at each position. When the functions match, the value of (f⋆g) is maximized. This is because when peaks (positive areas) are aligned, they make a large contribution to the integral. Similarly, when troughs (negative areas) align, they also make a positive contribution to the integral because the product of two negative numbers is positive.
With complex-valued functions f and g, taking the conjugate of f ensures that aligned peaks (or aligned troughs) with imaginary components will contribute positively to the integral. In econometrics, lagged cross-correlation is sometimes referred to as cross-autocorrelation.
Properties
Cross-correlation of random vectors
Definition For random vectors 𝐗=(X1,…,Xm) and 𝐘=(Y1,…,Yn), each containing random elements whose expected value and variance exist, the cross-correlation matrix of 𝐗 and 𝐘 is defined byR𝐗𝐘≜ E[𝐗𝐘]and has dimensions m×n. Written component-wise:R𝐗𝐘=[E[X1Y1]E[X1Y2]⋯E[X1Yn]E[X2Y1]E[X2Y2]⋯E[X2Yn]⋮⋮⋱⋮E[XmY1]E[XmY2]⋯E[XmYn]]The random vectors 𝐗 and 𝐘 need not have the same dimension, and either might be a scalar value. Where E is the expectation value.
Example For example, if 𝐗=(X1,X2,X3) and 𝐘=(Y1,Y2) are random vectors, then R𝐗𝐘 is a 3×2 matrix whose (i,j)-th entry is E[XiYj].
Definition for complex random vectors If 𝐙=(Z1,…,Zm) and 𝐖=(W1,…,Wn) are complex random vectors, each containing random variables whose expected value and variance exist, the cross-correlation matrix of 𝐙 and 𝐖 is defined byR𝐙𝐖≜ E[𝐙𝐖H]where H denotes Hermitian transposition.
Cross-correlation of stochastic processes In time series analysis and statistics, the cross-correlation of a pair of random process is the correlation between values of the processes at different times, as a function of the two times. Let (Xt,Yt) be a pair of random processes, and t be any point in time (t may be an integer for a discrete-time process or a real number for a continuous-time process). Then Xt is the value (or realization) produced by a given run of the process at time t.
Cross-correlation function Suppose that the process has means μX(t) and μY(t) and variances σX2(t) and σY2(t) at time t, for each t. Then the definition of the cross-correlation between times t1 and t2 isRXY(t1,t2)≜ E[Xt1‾Yt2]where E is the expected value operator. Note that this expression may be not defined.
Cross-covariance function Subtracting the mean before multiplication yields the cross-covariance between times t1 and t2:KXY(t1,t2)≜ E[(Xt1−μX(t1))‾(Yt2−μY(t2))]Note that this expression is not well-defined for all time series or processes, because the mean or variance may not exist.
… excerpt ends here. Continue reading the full article.



