DSP 101
M10 · L01
Module 10: Correlation & Detection

Auto-correlation & Cross-correlation

How similar is a signal to a delayed copy of itself? How well do two signals align at different time shifts? Correlation answers these questions — and it unlocks GPS, radar, and speech analysis.

01 / 11
DSP 101
M10 · L01
The Concept

Measuring Similarity

Correlation slides one signal past another and measures their overlap at each position. A large value means strong resemblance; zero means no common structure at that lag.

Two Flavors
Auto-correlation — signal vs. shifted self. Cross-correlation — signal vs. a different signal.
02 / 11
DSP 101
M10 · L01
Auto-correlation

A Signal Looking at Itself

Multiply x[n] by x[n−l] and sum over all n. The result at lag l tells you how much the signal resembles a version delayed by l samples.

Auto-correlation
R_{xx}[l]=\sum_{n}x[n]\,x[n-l]
03 / 11
DSP 101
M10 · L01
Key Properties

What the Peak Tells You

  • Rxx[0] = total signal energy — always maximum
  • Symmetric: Rxx[l] = Rxx[−l]
  • Periodic signal → peaks at lags 0, ±N, ±2N
  • Random noise → sharp spike at 0, near-zero elsewhere
04 / 11
DSP 101
M10 · L01
Cross-correlation

Finding the Time Delay

If y[n] is x[n] delayed by d samples, the cross-correlation Rxy[l] peaks at l = d. This is how you find an echo, a reflection, or a satellite signal.

Cross-correlation
R_{xy}[l]=\sum_{n}x[n]\,y[n-l]
05 / 11
DSP 101
Interactive
Try It

Visualizing Correlation

Drag the delay slider. Watch the correlation peak shift to match the time offset between the two signals.

Delay5 samples
06 / 11
DSP 101
M10 · L01
The Relationship

Correlation via Convolution

Cross-correlation = convolution with the time-reversed signal. So you can use FFT-based convolution to compute any correlation in O(N log N) instead of O(N²).

Key Relation
R_{xy}[l]=x[l]*y[-l]
07 / 11
DSP 101
M10 · L01
Normalization

The Normalized Coefficient

Divide by both signals’ energies to get a scale-free similarity measure always between −1 and +1. Perfect shape match = ±1. No match = 0.

Normalized Cross-correlation
\rho_{xy}[l]=\dfrac{R_{xy}[l]}{\sqrt{R_{xx}[0]\,R_{yy}[0]}}
08 / 11
DSP 101
Applications
Real-World Use

Where It Appears

  • GPS — correlates PRN codes to find satellite range
  • Radar — pulse compression, target ranging
  • Microphone arrays — direction-of-arrival via time delay
  • Speech — pitch detection via auto-correlation peaks
  • Communications — receiver synchronization & detection
09 / 11
DSP 101
Quick check

Check what stuck

Four questions from this lesson. Answer to see why — the explanation shows whether you got it right or wrong. Nothing is scored or saved.

Question 1 of 0
Score 0/0

10 / 11
DSP 101
Up Next
Coming Up

Signal Detection in Noise

Now that you can measure similarity, the next question is: is the signal there at all? We’ll cover hypothesis testing, the Neyman–Pearson criterion, and ROC curves.

11 / 11