Cross-Correlation
Measuring Similarity Across Time Shift
At its core, the cross-correlation function answers a single question: at what relative shift do two signals look most alike, and how strong is that resemblance? For continuous signals x(t) and y(t), the function Rxy(τ) is formed by delaying y by a lag τ, multiplying it point-by-point against x, and integrating over all time. Sweeping τ traces out a curve whose tallest point identifies the alignment lag. In a digital receiver the same operation is a running sum over N samples, computed either directly or, for long records, far more cheaply through an FFT, multiply-conjugate, inverse-FFT chain that scales as N log N instead of N squared.
The reason this operation dominates so much of RF signal processing is that it is the optimal way to detect a known signal buried in additive white noise. Because the reference replica is correlated with itself but the noise is not, the desired component sums coherently while the noise sums incoherently. The correlation peak therefore rises far above the noise floor even when the raw input sits below it. That coherent gain is what lets a GPS receiver pull a 1023-chip C/A code out of signals 20 to 30 dB beneath thermal noise, and it is why a radar can integrate a long chirp to detect a faint target return.
A normalized form divides the raw correlation by the product of the two signals' RMS levels (the geometric mean of their autocorrelation peaks), bounding the result between -1 and +1. The normalized peak is a dimensionless similarity score: +1 for identical scaled copies, 0 for orthogonal signals such as well-designed PN sequences, and negative for inverted waveforms. This normalized coefficient is what code-division systems exploit to keep many users on the same band without mutual interference.
Governing Equations
Rxy(τ) = ∫ x(t) · y(t + τ) dt
Discrete (N samples):
Rxy[m] = ∑n x[n] · y*[n + m]
Frequency-Domain (FFT method):
Rxy(τ) = ℱ-1{ X(f) × Y*(f) }
Normalized Coefficient:
ρxy(τ) = Rxy(τ) / √(Rxx(0) × Ryy(0)), −1 ≤ ρ ≤ +1
Time Delay & Range:
τd = arg maxτ |Rxy(τ)|, Range = c × τd / 2
Where Y*(f) is the complex conjugate, Rxx(0) and Ryy(0) are autocorrelation peaks (signal energies), c ≈ 3 × 108 m/s. Example: τd = 1 μs → Range ≈ 150 m. Processing gain Gp = 10 log10(N) dB; N = 1023 → ≈ 30 dB.
Cross-Correlation vs. Related Operations
| Operation | Second signal flipped? | Peak location | Frequency domain | Primary RF use |
|---|---|---|---|---|
| Cross-correlation | No | At true delay lag | X(f) × Y*(f) | Delay estimation, ranging, sync |
| Autocorrelation | No (signal vs. itself) | At τ = 0 | |X(f)|2 = PSD | Spectral shape, code design |
| Convolution | Yes (time-reversed) | Filter-dependent | X(f) × H(f) | Linear filtering, channel modeling |
| Matched filter | Yes (conjugate replica) | At pulse arrival | X(f) × S*(f) | Optimal detection in white noise |
Frequently Asked Questions
How does cross-correlation differ from convolution?
Both are sliding-product integrals, but convolution time-reverses one signal first while cross-correlation does not. In the frequency domain convolution is X(f) × Y(f), whereas correlation is X(f) × Y*(f) using the complex conjugate. The payoff is that the correlation peak lands at the actual time delay between the signals, which is why it is the natural tool for delay estimation and alignment. A matched filter is just convolution with a time-reversed conjugate replica, making it equivalent to correlating against the transmitted template.
How do you estimate time delay with cross-correlation?
Compute Rxy(τ) between the reference and the received copy, then take the lag that maximizes |R|. That argmax lag is the propagation delay. In radar, Range = c × τd / 2, so a 1 μs delay equals 150 m of range. Sub-sample accuracy comes from parabolic interpolation around the peak or zero-padded FFTs. Delay resolution is roughly 1/B, so a 100 MHz waveform resolves about 10 ns, or 1.5 m.
What is the relationship between cross-correlation and processing gain?
Correlating against a known code or chirp sums the signal coherently while uncorrelated noise adds incoherently. For an N-chip spread-spectrum waveform the peak rises N times faster than the noise floor, giving Gp = 10 log10(N) dB. A 1023-chip GPS C/A code yields about 30 dB, letting signals 20 to 30 dB below thermal noise be detected after despreading. For a chirp the gain equals the time-bandwidth product, 10 log10(B × T) dB.