ArticleslgStudy

science

Cross-correlation

Cross-correlation is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Cross-correlation rather than just read about it. In short: 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.

Cross-correlation — main illustration
Cross-correlation — illustration

Key takeaways

  • Cross-correlation belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Cross-correlation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Cross-correlation from memory before moving on to harder problems.

Reference excerpt

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.

Illustrations

Cross-correlation illustration
Cross-correlation: Visual comparison of convolution, cross-correlation and autocorrelation.  For the operations involving function .mw-parser-output .texhtml{font-family:"Nimbus Roman No9 L","Times New Roman",Times,serif;font-size:118%;line-height:1;font-variant-numeric:lining-nums tabular-nums;font-kerning:none}.mw-parser-output .texhtml .texhtml{font-size:100%}.mw-parser-output .texhtml-big{font-size:165%}.mw-parser-output .mvar{font-style:italic}@media(min-width:420px){.mw-parser-output .texhtml{white-space:nowrap}}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 and f⋆g are identical in this example.
Visual comparison of convolution, cross-correlation and autocorrelation. For the operations involving function .mw-parser-output .texhtml{font-family:"Nimbus Roman No9 L","Times New Roman",Times,serif;font-size:118%;line-height:1;font-variant-numeric:lining-nums tabular-nums;font-kerning:none}.mw-parser-output .texhtml .texhtml{font-size:100%}.mw-parser-output .texhtml-big{font-size:165%}.mw-parser-output .mvar{font-style:italic}@media(min-width:420px){.mw-parser-output .texhtml{white-space:nowrap}}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 and f⋆g are identical in this example.
Cross-correlation: 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 𝜏.
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 𝜏.

Worked examples

Example 1 — a first encounter with Cross-correlation

Start with the simplest possible case. Write down what Cross-correlation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Cross-correlation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Cross-correlation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Cross-correlation

In research
Cross-correlation appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Cross-correlation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Cross-correlation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Bilinear maps, Covariance and correlation, Signal processing, so understanding it makes those chapters shorter.
In everyday life
Look for Cross-correlation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Cross-correlation” →

How to study Cross-correlation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Cross-correlation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Cross-correlation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Cross-correlation in simple terms?

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.

Why does Cross-correlation matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Cross-correlation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Cross-correlation.

Tags

  • Bilinear maps
  • Covariance and correlation
  • Signal processing
  • Time domain analysis

Keep exploring