Cross-correlation

Covariance and correlation
Part of a series on Statistics
Correlation and covariance
For random vectors
  • Autocorrelation matrix
  • Cross-correlation matrix
  • Auto-covariance matrix
  • Cross-covariance matrix
For stochastic processes
For deterministic signals
  • v
  • t
  • e
Visual comparison of convolution, cross-correlation and autocorrelation. For the operations involving function f, and assuming the height of f is 1.0, the value of the result at 5 different points is indicated by the shaded area below each point. Also, the vertical symmetry of f is the reason f g {\displaystyle f*g} and f g {\displaystyle f\star g} are identical in this example.

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 X {\displaystyle \mathbf {X} } and Y {\displaystyle \mathbf {Y} } , while the correlations of a random vector X {\displaystyle \mathbf {X} } are the correlations between the entries of X {\displaystyle \mathbf {X} } itself, those forming the correlation matrix of X {\displaystyle \mathbf {X} } . If each of X {\displaystyle \mathbf {X} } and Y {\displaystyle \mathbf {Y} } is a scalar random variable which is realized repeatedly in a time series, then the correlations of the various temporal instances of X {\displaystyle \mathbf {X} } are known as autocorrelations of X {\displaystyle \mathbf {X} } , and the cross-correlations of X {\displaystyle \mathbf {X} } with Y {\displaystyle \mathbf {Y} } 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 {\displaystyle X} and Y {\displaystyle Y} are two independent random variables with probability density functions f {\displaystyle f} and g {\displaystyle g} , respectively, then the probability density of the difference Y X {\displaystyle Y-X} is formally given by the cross-correlation (in the signal-processing sense) f g {\displaystyle f\star g} ; however, this terminology is not used in probability and statistics. In contrast, the convolution f g {\displaystyle f*g} (equivalent to the cross-correlation of f ( t ) {\displaystyle f(t)} and g ( t ) {\displaystyle g(-t)} ) gives the probability density function of the sum X + Y {\displaystyle X+Y} .

Cross-correlation of deterministic signals

For continuous functions f {\displaystyle f} and g {\displaystyle g} , the cross-correlation is defined as:[1][2][3]

( f g ) ( τ )   f ( t ) ¯ g ( t + τ ) d t {\displaystyle (f\star g)(\tau )\ \triangleq \int _{-\infty }^{\infty }{\overline {f(t)}}g(t+\tau )\,dt}
which is equivalent to
( f g ) ( τ )   f ( t τ ) ¯ g ( t ) d t {\displaystyle (f\star g)(\tau )\ \triangleq \int _{-\infty }^{\infty }{\overline {f(t-\tau )}}g(t)\,dt}
where f ( t ) ¯ {\displaystyle {\overline {f(t)}}} denotes the complex conjugate of f ( t ) {\displaystyle f(t)} , and τ {\displaystyle \tau } is called displacement or lag. For highly-correlated f {\displaystyle f} and g {\displaystyle g} which have a maximum cross-correlation at a particular τ {\displaystyle \tau } , a feature in f {\displaystyle f} at t {\displaystyle t} also occurs later in g {\displaystyle g} at t + τ {\displaystyle t+\tau } , hence g {\displaystyle g} could be described to lag f {\displaystyle f} by τ {\displaystyle \tau } .

If f {\displaystyle f} and g {\displaystyle g} are both continuous periodic functions of period T {\displaystyle T} , the integration from {\displaystyle -\infty } to {\displaystyle \infty } is replaced by integration over any interval [ t 0 , t 0 + T ] {\displaystyle [t_{0},t_{0}+T]} of length T {\displaystyle T} :

( f g ) ( τ )   t 0 t 0 + T f ( t ) ¯ g ( t + τ ) d t {\displaystyle (f\star g)(\tau )\ \triangleq \int _{t_{0}}^{t_{0}+T}{\overline {f(t)}}g(t+\tau )\,dt}
which is equivalent to
( f g ) ( τ )   t 0 t 0 + T f ( t τ ) ¯ g ( t ) d t {\displaystyle (f\star g)(\tau )\ \triangleq \int _{t_{0}}^{t_{0}+T}{\overline {f(t-\tau )}}g(t)\,dt}
Similarly, for discrete functions, the cross-correlation is defined as:[4][5]
( f g ) [ n ]   m = f [ m ] ¯ g [ m + n ] {\displaystyle (f\star g)[n]\ \triangleq \sum _{m=-\infty }^{\infty }{\overline {f[m]}}g[m+n]}
which is equivalent to:
( f g ) [ n ]   m = f [ m n ] ¯ g [ m ] {\displaystyle (f\star g)[n]\ \triangleq \sum _{m=-\infty }^{\infty }{\overline {f[m-n]}}g[m]}
For finite discrete functions f , g C N {\displaystyle f,g\in \mathbb {C} ^{N}} , the (circular) cross-correlation is defined as:[6]
( f g ) [ n ]   m = 0 N 1 f [ m ] ¯ g [ ( m + n ) mod   N ] {\displaystyle (f\star g)[n]\ \triangleq \sum _{m=0}^{N-1}{\overline {f[m]}}g[(m+n)_{{\text{mod}}~N}]}
which is equivalent to:
( f g ) [ n ]   m = 0 N 1 f [ ( m n ) mod   N ] ¯ g [ m ] {\displaystyle (f\star g)[n]\ \triangleq \sum _{m=0}^{N-1}{\overline {f[(m-n)_{{\text{mod}}~N}]}}g[m]}
For finite discrete functions f C N {\displaystyle f\in \mathbb {C} ^{N}} , g C M {\displaystyle g\in \mathbb {C} ^{M}} , the kernel cross-correlation is defined as:[7]
( f g ) [ n ]   m = 0 N 1 f [ m ] ¯ K g [ ( m + n ) mod   N ] {\displaystyle (f\star g)[n]\ \triangleq \sum _{m=0}^{N-1}{\overline {f[m]}}K_{g}[(m+n)_{{\text{mod}}~N}]}
where K g = [ k ( g , T 0 ( g ) ) , k ( g , T 1 ( g ) ) , , k ( g , T N 1 ( g ) ) ] {\displaystyle K_{g}=[k(g,T_{0}(g)),k(g,T_{1}(g)),\dots ,k(g,T_{N-1}(g))]} is a vector of kernel functions k ( , ) : C M × C M R {\displaystyle k(\cdot ,\cdot )\colon \mathbb {C} ^{M}\times \mathbb {C} ^{M}\to \mathbb {R} } and T i ( ) : C M C M {\displaystyle T_{i}(\cdot )\colon \mathbb {C} ^{M}\to \mathbb {C} ^{M}} is an affine transform.

Specifically, T i ( ) {\displaystyle T_{i}(\cdot )} 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 {\displaystyle f} and g {\displaystyle g} differing only by an unknown shift along the x-axis. One can use the cross-correlation to find how much g {\displaystyle g} must be shifted along the x-axis to make it identical to f {\displaystyle f} . The formula essentially slides the g {\displaystyle g} function along the x-axis, calculating the integral of their product at each position. When the functions match, the value of ( f g ) {\displaystyle (f\star 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.

Animation of how cross-correlation is calculated. The left graph shows a green function G that is phase-shifted relative to function F by a time displacement of 𝜏. The middle graph shows the function F and the phase-shifted G represented together as a Lissajous curve. Integrating F multiplied by the phase-shifted G produces the right graph, the cross-correlation across all values of 𝜏.

With complex-valued functions f {\displaystyle f} and g {\displaystyle g} , taking the conjugate of f {\displaystyle 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.[8]: p. 74 

Properties

  • The cross-correlation of functions f ( t ) {\displaystyle f(t)} and g ( t ) {\displaystyle g(t)} is equivalent to the convolution (denoted by {\displaystyle *} ) of f ( t ) ¯ {\displaystyle {\overline {f(-t)}}} and g ( t ) {\displaystyle g(t)} . That is:
    [ f ( t ) g ( t ) ] ( t ) = [ f ( t ) ¯ g ( t ) ] ( t ) . {\displaystyle [f(t)\star g(t)](t)=[{\overline {f(-t)}}*g(t)](t).}
  • [ f ( t ) g ( t ) ] ( t ) = [ g ( t ) ¯ f ( t ) ¯ ] ( t ) . {\displaystyle [f(t)\star g(t)](t)=[{\overline {g(t)}}\star {\overline {f(t)}}](-t).}
  • If f {\displaystyle f} is a Hermitian function, then f g = f g . {\displaystyle f\star g=f*g.}
  • If both f {\displaystyle f} and g {\displaystyle g} are Hermitian, then f g = g f {\displaystyle f\star g=g\star f} .
  • ( f g ) ( f g ) = ( f f ) ( g g ) {\displaystyle \left(f\star g\right)\star \left(f\star g\right)=\left(f\star f\right)\star \left(g\star g\right)} .
  • Analogous to the convolution theorem, the cross-correlation satisfies
    F { f g } = F { f } ¯ F { g } , {\displaystyle {\mathcal {F}}\left\{f\star g\right\}={\overline {{\mathcal {F}}\left\{f\right\}}}\cdot {\mathcal {F}}\left\{g\right\},}
    where F {\displaystyle {\mathcal {F}}} denotes the Fourier transform, and an f ¯ {\displaystyle {\overline {f}}} again indicates the complex conjugate of f {\displaystyle f} , since F { f ( t ) ¯ } = F { f ( t ) } ¯ {\displaystyle {\mathcal {F}}\left\{{\overline {f(-t)}}\right\}={\overline {{\mathcal {F}}\left\{f(t)\right\}}}} . Coupled with fast Fourier transform algorithms, this property is often exploited for the efficient numerical computation of cross-correlations[9] (see circular cross-correlation).
  • The cross-correlation is related to the spectral density (see Wiener–Khinchin theorem).
  • The cross-correlation of a convolution of f {\displaystyle f} and h {\displaystyle h} with a function g {\displaystyle g} is the convolution of the cross-correlation of g {\displaystyle g} and f {\displaystyle f} with the kernel h {\displaystyle h} :
    g ( f h ) = ( g f ) h {\displaystyle g\star \left(f*h\right)=\left(g\star f\right)*h} .

Cross-correlation of random vectors

Definition

For random vectors X = ( X 1 , , X m ) {\displaystyle \mathbf {X} =(X_{1},\ldots ,X_{m})} and Y = ( Y 1 , , Y n ) {\displaystyle \mathbf {Y} =(Y_{1},\ldots ,Y_{n})} , each containing random elements whose expected value and variance exist, the cross-correlation matrix of X {\displaystyle \mathbf {X} } and Y {\displaystyle \mathbf {Y} } is defined by[10]: p.337 

R X Y   E [ X Y ] {\displaystyle \operatorname {R} _{\mathbf {X} \mathbf {Y} }\triangleq \ \operatorname {E} \left[\mathbf {X} \mathbf {Y} \right]}
and has dimensions m × n {\displaystyle m\times n} . Written component-wise:
R X Y = [ E [ X 1 Y 1 ] E [ X 1 Y 2 ] E [ X 1 Y n ] E [ X 2 Y 1 ] E [ X 2 Y 2 ] E [ X 2 Y n ] E [ X m Y 1 ] E [ X m Y 2 ] E [ X m Y n ] ] {\displaystyle \operatorname {R} _{\mathbf {X} \mathbf {Y} }={\begin{bmatrix}\operatorname {E} [X_{1}Y_{1}]&\operatorname {E} [X_{1}Y_{2}]&\cdots &\operatorname {E} [X_{1}Y_{n}]\\\\\operatorname {E} [X_{2}Y_{1}]&\operatorname {E} [X_{2}Y_{2}]&\cdots &\operatorname {E} [X_{2}Y_{n}]\\\\\vdots &\vdots &\ddots &\vdots \\\\\operatorname {E} [X_{m}Y_{1}]&\operatorname {E} [X_{m}Y_{2}]&\cdots &\operatorname {E} [X_{m}Y_{n}]\end{bmatrix}}}
The random vectors X {\displaystyle \mathbf {X} } and Y {\displaystyle \mathbf {Y} } need not have the same dimension, and either might be a scalar value. Where E {\displaystyle \operatorname {E} } is the expectation value.

Example

For example, if X = ( X 1 , X 2 , X 3 ) {\displaystyle \mathbf {X} =\left(X_{1},X_{2},X_{3}\right)} and Y = ( Y 1 , Y 2 ) {\displaystyle \mathbf {Y} =\left(Y_{1},Y_{2}\right)} are random vectors, then R X Y {\displaystyle \operatorname {R} _{\mathbf {X} \mathbf {Y} }} is a 3 × 2 {\displaystyle 3\times 2} matrix whose ( i , j ) {\displaystyle (i,j)} -th entry is E [ X i Y j ] {\displaystyle \operatorname {E} [X_{i}Y_{j}]} .

Definition for complex random vectors

If Z = ( Z 1 , , Z m ) {\displaystyle \mathbf {Z} =(Z_{1},\ldots ,Z_{m})} and W = ( W 1 , , W n ) {\displaystyle \mathbf {W} =(W_{1},\ldots ,W_{n})} are complex random vectors, each containing random variables whose expected value and variance exist, the cross-correlation matrix of Z {\displaystyle \mathbf {Z} } and W {\displaystyle \mathbf {W} } is defined by

R Z W   E [ Z W H ] {\displaystyle \operatorname {R} _{\mathbf {Z} \mathbf {W} }\triangleq \ \operatorname {E} [\mathbf {Z} \mathbf {W} ^{\rm {H}}]}
where H {\displaystyle {}^{\rm {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 ( X t , Y t ) {\displaystyle (X_{t},Y_{t})} be a pair of random processes, and t {\displaystyle t} be any point in time ( t {\displaystyle t} may be an integer for a discrete-time process or a real number for a continuous-time process). Then X t {\displaystyle X_{t}} is the value (or realization) produced by a given run of the process at time t {\displaystyle t} .

Cross-correlation function

Suppose that the process has means μ X ( t ) {\displaystyle \mu _{X}(t)} and μ Y ( t ) {\displaystyle \mu _{Y}(t)} and variances σ X 2 ( t ) {\displaystyle \sigma _{X}^{2}(t)} and σ Y 2 ( t ) {\displaystyle \sigma _{Y}^{2}(t)} at time t {\displaystyle t} , for each t {\displaystyle t} . Then the definition of the cross-correlation between times t 1 {\displaystyle t_{1}} and t 2 {\displaystyle t_{2}} is[10]: p.392 

R X Y ( t 1 , t 2 )   E [ X t 1 Y t 2 ¯ ] {\displaystyle \operatorname {R} _{XY}(t_{1},t_{2})\triangleq \ \operatorname {E} \left[X_{t_{1}}{\overline {Y_{t_{2}}}}\right]}
where E {\displaystyle \operatorname {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 t 1 {\displaystyle t_{1}} and t 2 {\displaystyle t_{2}} :[10]: p.392 

K X Y ( t 1 , t 2 )   E [ ( X t 1 μ X ( t 1 ) ) ( Y t 2 μ Y ( t 2 ) ) ¯ ] {\displaystyle \operatorname {K} _{XY}(t_{1},t_{2})\triangleq \ \operatorname {E} \left[\left(X_{t_{1}}-\mu _{X}(t_{1})\right){\overline {(Y_{t_{2}}-\mu _{Y}(t_{2}))}}\right]}
Note that this expression is not well-defined for all time series or processes, because the mean or variance may not exist.

Definition for wide-sense stationary stochastic process

Let ( X t , Y t ) {\displaystyle (X_{t},Y_{t})} represent a pair of stochastic processes that are jointly wide-sense stationary. Then the cross-covariance function and the cross-correlation function are given as follows.

Cross-correlation function

R X Y ( τ )   E [ X t Y t + τ ¯ ] {\displaystyle \operatorname {R} _{XY}(\tau )\triangleq \ \operatorname {E} \left[X_{t}{\overline {Y_{t+\tau }}}\right]}
or equivalently
R X Y ( τ ) = E [ X t τ Y t ¯ ] {\displaystyle \operatorname {R} _{XY}(\tau )=\operatorname {E} \left[X_{t-\tau }{\overline {Y_{t}}}\right]}

Cross-covariance function

K X Y ( τ )   E [ ( X t μ X ) ( Y t + τ μ Y ) ¯ ] {\displaystyle \operatorname {K} _{XY}(\tau )\triangleq \ \operatorname {E} \left[\left(X_{t}-\mu _{X}\right){\overline {\left(Y_{t+\tau }-\mu _{Y}\right)}}\right]}
or equivalently
K X Y ( τ ) = E [ ( X t τ μ X ) ( Y t μ Y ) ¯ ] {\displaystyle \operatorname {K} _{XY}(\tau )=\operatorname {E} \left[\left(X_{t-\tau }-\mu _{X}\right){\overline {\left(Y_{t}-\mu _{Y}\right)}}\right]}
where μ X {\displaystyle \mu _{X}} and σ X {\displaystyle \sigma _{X}} are the mean and standard deviation of the process ( X t ) {\displaystyle (X_{t})} , which are constant over time due to stationarity; and similarly for ( Y t ) {\displaystyle (Y_{t})} , respectively. E [   ] {\displaystyle \operatorname {E} [\ ]} indicates the expected value. That the cross-covariance and cross-correlation are independent of t {\displaystyle t} is precisely the additional information (beyond being individually wide-sense stationary) conveyed by the requirement that ( X t , Y t ) {\displaystyle (X_{t},Y_{t})} are jointly wide-sense stationary.

The cross-correlation of a pair of jointly wide sense stationary stochastic 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[which?] of one of the signals). For a large number of samples, the average converges to the true cross-correlation.

Normalization

It is common practice in some disciplines (e.g. statistics and time series analysis) to normalize the cross-correlation function to get a time-dependent Pearson correlation coefficient. However, in other disciplines (e.g. engineering) the normalization is usually dropped and the terms "cross-correlation" and "cross-covariance" are used interchangeably.

The definition of the normalized cross-correlation of a stochastic process is

ρ X X ( t 1 , t 2 ) = K X X ( t 1 , t 2 ) σ X ( t 1 ) σ X ( t 2 ) = E [ ( X t 1 μ t 1 ) ( X t 2 μ t 2 ) ¯ ] σ X ( t 1 ) σ X ( t 2 ) {\displaystyle \rho _{XX}(t_{1},t_{2})={\frac {\operatorname {K} _{XX}(t_{1},t_{2})}{\sigma _{X}(t_{1})\sigma _{X}(t_{2})}}={\frac {\operatorname {E} \left[\left(X_{t_{1}}-\mu _{t_{1}}\right){\overline {\left(X_{t_{2}}-\mu _{t_{2}}\right)}}\right]}{\sigma _{X}(t_{1})\sigma _{X}(t_{2})}}}
If the function ρ X X {\displaystyle \rho _{XX}} is well-defined, its value must lie in the range [ 1 , 1 ] {\displaystyle [-1,1]} , with 1 indicating perfect correlation and −1 indicating perfect anti-correlation.

For jointly wide-sense stationary stochastic processes, the definition is

ρ X Y ( τ ) = K X Y ( τ ) σ X σ Y = E [ ( X t μ X ) ( Y t + τ μ Y ) ¯ ] σ X σ Y {\displaystyle \rho _{XY}(\tau )={\frac {\operatorname {K} _{XY}(\tau )}{\sigma _{X}\sigma _{Y}}}={\frac {\operatorname {E} \left[\left(X_{t}-\mu _{X}\right){\overline {\left(Y_{t+\tau }-\mu _{Y}\right)}}\right]}{\sigma _{X}\sigma _{Y}}}}
The normalization is important both because the interpretation of the autocorrelation as a correlation provides a scale-free measure of the strength of statistical dependence, and because the normalization has an effect on the statistical properties of the estimated autocorrelations.

Properties

Symmetry property

For jointly wide-sense stationary stochastic processes, the cross-correlation function has the following symmetry property:[11]: p.173 

R X Y ( t 1 , t 2 ) = R Y X ( t 2 , t 1 ) ¯ {\displaystyle \operatorname {R} _{XY}(t_{1},t_{2})={\overline {\operatorname {R} _{YX}(t_{2},t_{1})}}}
Respectively for jointly WSS processes:
R X Y ( τ ) = R Y X ( τ ) ¯ {\displaystyle \operatorname {R} _{XY}(\tau )={\overline {\operatorname {R} _{YX}(-\tau )}}}

Time delay analysis

Cross-correlations are useful for determining the time delay between two signals, e.g., for determining time delays for the propagation of acoustic signals across a microphone array.[12][13][clarification needed] After calculating the cross-correlation between the two signals, the maximum (or minimum if the signals are negatively correlated) of the cross-correlation function indicates the point in time where the signals are best aligned; i.e., the time delay between the two signals is determined by the argument of the maximum, or arg max of the cross-correlation, as in

τ d e l a y = a r g m a x t R ( ( f g ) ( t ) ) {\displaystyle \tau _{\mathrm {delay} }={\underset {t\in \mathbb {R} }{\operatorname {arg\,max} }}((f\star g)(t))}
Terminology in image processing

Zero-normalized cross-correlation (ZNCC)

Animation of the normalized cross-correlation sliding a template over an image. Image and template are consecutive frames of particles in a flow field. This technique is also called Particle Image Velocimetry.
Animation of the normalized cross-correlation sliding a template over an image. Image and template are consecutive frames of particles in a flow field. This technique is also called Particle Image Velocimetry.

For image-processing applications in which the brightness of the image and template can vary due to lighting and exposure conditions, the images can be first normalized. This is typically done at every step by subtracting the mean and dividing by the standard deviation. That is, the cross-correlation of a template t ( x , y ) {\displaystyle t(x,y)} with a subimage f ( x , y ) {\displaystyle f(x,y)} is


1 n x , y 1 σ f σ t ( f ( x , y ) μ f ) ( t ( x , y ) μ t ) {\displaystyle {\frac {1}{n}}\sum _{x,y}{\frac {1}{\sigma _{f}\sigma _{t}}}\left(f(x,y)-\mu _{f}\right)\left(t(x,y)-\mu _{t}\right)}


where n {\displaystyle n} is the number of pixels in t ( x , y ) {\displaystyle t(x,y)} and f ( x , y ) {\displaystyle f(x,y)} , μ f {\displaystyle \mu _{f}} is the average of f {\displaystyle f} and σ f {\displaystyle \sigma _{f}} is standard deviation of f {\displaystyle f} .

In functional analysis terms, this can be thought of as the dot product of two normalized vectors. That is, if

F ( x , y ) = f ( x , y ) μ f {\displaystyle F(x,y)=f(x,y)-\mu _{f}}
and
T ( x , y ) = t ( x , y ) μ t {\displaystyle T(x,y)=t(x,y)-\mu _{t}}
then the above sum is equal to
F F , T T {\displaystyle \left\langle {\frac {F}{\|F\|}},{\frac {T}{\|T\|}}\right\rangle }
where , {\displaystyle \langle \cdot ,\cdot \rangle } is the inner product and {\displaystyle \|\cdot \|} is the L² norm. Cauchy–Schwarz then implies that ZNCC has a range of [ 1 , 1 ] {\displaystyle [-1,1]} .

Thus, if f {\displaystyle f} and t {\displaystyle t} are real matrices, their normalized cross-correlation equals the cosine of the angle between the unit vectors F {\displaystyle F} and T {\displaystyle T} , being thus 1 {\displaystyle 1} if and only if F {\displaystyle F} equals T {\displaystyle T} multiplied by a positive scalar.

Normalized correlation is one of the methods used for template matching, a process used for finding instances of a pattern or object within an image. It is also the 2-dimensional version of Pearson product-moment correlation coefficient.

Normalized cross-correlation (NCC)

NCC is similar to ZNCC with the only difference of not subtracting the local mean value of intensities:

1 n x , y 1 σ f σ t f ( x , y ) t ( x , y ) {\displaystyle {\frac {1}{n}}\sum _{x,y}{\frac {1}{\sigma _{f}\sigma _{t}}}f(x,y)t(x,y)}

Nonlinear systems

Caution must be applied when using cross correlation for nonlinear systems. In certain circumstances, which depend on the properties of the input, cross correlation between the input and output of a system with nonlinear dynamics can be completely blind to certain nonlinear effects.[14] This problem arises because some quadratic moments can equal zero and this can incorrectly suggest that there is little "correlation" (in the sense of statistical dependence) between two signals, when in fact the two signals are strongly related by nonlinear dynamics.

See also

References

  1. ^ Bracewell, R. "Pentagram Notation for Cross Correlation." The Fourier Transform and Its Applications. New York: McGraw-Hill, pp. 46 and 243, 1965.
  2. ^ Papoulis, A. The Fourier Integral and Its Applications. New York: McGraw-Hill, pp. 244–245 and 252-253, 1962.
  3. ^ Weisstein, Eric W. "Cross-Correlation." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Cross-Correlation.html
  4. ^ Rabiner, L.R.; Schafer, R.W. (1978). Digital Processing of Speech Signals. Signal Processing Series. Upper Saddle River, NJ: Prentice Hall. pp. 147–148. ISBN 0132136031.
  5. ^ Rabiner, Lawrence R.; Gold, Bernard (1975). Theory and Application of Digital Signal Processing. Englewood Cliffs, NJ: Prentice-Hall. pp. 401. ISBN 0139141014.
  6. ^ Wang, Chen (2019). Kernel learning for visual perception, Chapter 2.2.1 (Doctoral thesis). Nanyang Technological University, Singapore. pp. 17–18. doi:10.32657/10220/47835. hdl:10356/105527.
  7. ^ Wang, Chen; Zhang, Le; Yuan, Junsong; Xie, Lihua (2018). "Kernel Cross-Correlator". Proceedings of the AAAI Conference on Artificial Intelligence. The Thirty-second AAAI Conference On Artificial Intelligence. 32. Association for the Advancement of Artificial Intelligence: 4179–4186. doi:10.1609/aaai.v32i1.11710. S2CID 3544911.
  8. ^ Campbell; Lo; MacKinlay (1996). The Econometrics of Financial Markets. NJ: Princeton University Press. ISBN 0691043019.
  9. ^ Kapinchev, Konstantin; Bradu, Adrian; Barnes, Frederick; Podoleanu, Adrian (2015). "GPU implementation of cross-correlation for image generation in real time". 2015 9th International Conference on Signal Processing and Communication Systems (ICSPCS). pp. 1–6. doi:10.1109/ICSPCS.2015.7391783. ISBN 978-1-4673-8118-5. S2CID 17108908.
  10. ^ a b c Gubner, John A. (2006). Probability and Random Processes for Electrical and Computer Engineers. Cambridge University Press. ISBN 978-0-521-86470-1.
  11. ^ Kun Il Park, Fundamentals of Probability and Stochastic Processes with Applications to Communications, Springer, 2018, 978-3-319-68074-3
  12. ^ Rhudy, Matthew; Brian Bucci; Jeffrey Vipperman; Jeffrey Allanach; Bruce Abraham (November 2009). Microphone Array Analysis Methods Using Cross-Correlations. Proceedings of 2009 ASME International Mechanical Engineering Congress, Lake Buena Vista, FL. pp. 281–288. doi:10.1115/IMECE2009-10798. ISBN 978-0-7918-4388-8.
  13. ^ Rhudy, Matthew (November 2009). Real Time Implementation of a Military Impulse Classifier (MS thesis). University of Pittsburgh.
  14. ^ Billings, S. A. (2013). Nonlinear System Identification: NARMAX Methods in the Time, Frequency, and Spatio-Temporal Domains. Wiley. ISBN 978-1-118-53556-1.

Further reading

  • Tahmasebi, Pejman; Hezarkhani, Ardeshir; Sahimi, Muhammad (2012). "Multiple-point geostatistical modeling based on the cross-correlation functions". Computational Geosciences. 16 (3): 779–797. Bibcode:2012CmpGe..16..779T. doi:10.1007/s10596-012-9287-1. S2CID 62710397.

External links

  • Cross Correlation from Mathworld
  • http://scribblethink.org/Work/nvisionInterface/nip.html
  • http://www.staff.ncl.ac.uk/oliver.hinton/eee305/Chapter6.pdf
  • v
  • t
  • e
Continuous data
Center
Dispersion
Shape
Count data
Summary tables
Dependence
Graphics
Study design
Survey methodology
Controlled experiments
Adaptive designs
Observational studies
Statistical theory
Frequentist inference
Point estimation
Interval estimation
Testing hypotheses
Parametric tests
Specific tests
  • Z-test (normal)
  • Student's t-test
  • F-test
Goodness of fit
Rank statistics
Bayesian inference
Correlation
Regression analysis
Linear regression
Non-standard predictors
Generalized linear model
Partition of variance
Categorical
Multivariate
Time-series
General
Specific tests
Time domain
Frequency domain
Survival
Survival function
Hazard function
Test
Biostatistics
Engineering statistics
Social statistics
Spatial statistics
  • Category
  • icon Mathematics portal
  • Commons
  • WikiProject