Web Simulation 

 

 

 

 

Matched Filter & Correlation Explorer 

This interactive tutorial shows how a matched filter (cross-correlation with a known template) makes a weak signal “pop out” of noise. Used in radar (pulse compression with chirps) and telecom (sync with BPSK sequences), it exploits processing gain: coherent addition of the signal versus incoherent growth of noise.

What You See

Panel A plots the received signal r[n]: Re(r) upper, Im(r) lower, with Gaussian noise. At low SNR the signal is invisible. Hover over Panel B to overlay the clean template (orange dashed) at that lag. Panel B plots the matched-filter output |c[k]|—the magnitude of the cross-correlation between r and the clean template. A distinct peak appears at the true delay even when Panel A looks like pure noise. The Ground Truth line (Panel A) and correlation peak (Panel B) align vertically. Panel C is split: left shows the Phasor Walkr[ns*[nk] with fixed scale; right shows the Constellation of r[n] and s[n] in the complex plane. When the template matches (correct lag), phasors add tip-to-tail in a straight line (coherent). When mismatched, they form a random walk and stay near the origin.

Math

Template s[n], received r[n] = s[nn0] + noise. Cross-correlation: c[k] = ∑n r[n] s*[nk]. At k = n0 the sum is large (matched); elsewhere it stays small. Processing gain ∝ √N: signal grows linearly with N, noise grows as √N, so SNR improves by √N.

Signals

Chirp (Radar): cos(2π(f0n + ½kn2)). Long-duration waveform compresses to a sharp peak. BPSK (Telecom): Oversampled Barker-13 sequence (+1/−1). Simple pulse: Rectangular burst. Use the Lag slider or hover on Panel B to sweep the Phasor Walk and see matched vs mismatched.

Panel A: Received signal r[n]
Re(r[n])
Im(r[n])
Panel B: Matched filter output |c[k]|
Panel C: Phasor walk & Constellation
Phasor walk ∑ r[ns*[nk]
Constellation: r[n] & s[n]

 

Usage

  1. Pick Chirp or BPSK. Set SNR to −10 dB: Panel A looks like noise; Panel B shows a clear peak.
  2. Move Delay to shift the hidden signal; the peak in B moves. Enable Show ground truth to see where the signal lives in A.
  3. Hover over the correlation plot (Panel B): the template overlay (orange dashed) appears on Panel A at that lag, and the Phasor Walk (Panel C left) updates. At the peak, phasors align (straight line); off-peak, random walk.
  4. Use the Lag slider, Run button, or Step buttons (◀ ▶) to sweep k and watch the transition from random walk → straight line → random walk.
  5. Increase Template length N to see processing gain: peak grows relative to the floor.
  6. Add CFO to simulate Doppler/mismatch: peak drops and broadens.

Parameters

  • Signal type: Chirp (radar-style), BPSK (Barker-13), or simple pulse.
  • SNR: Input signal-to-noise ratio in dB. Low values make the signal invisible in the time plot.
  • Delay n0: Sample index where the template is placed in the received buffer.
  • CFO: Normalized frequency offset (phase rotation) simulating Doppler or LO mismatch.
  • Template length N: Integration length; processing gain ∝ √N.
  • Lag k: Selects which correlation lag drives the Phasor Walk.

Panels

  • A: Re(r[n]) cyan, Im(r[n]) magenta. At low SNR, mostly noise.
  • B: |c[k]|; amber. Peak at true delay. Threshold (dotted) at half peak.
  • C: Left—Phasor walk ∑ r[n]s*[nk] with fixed scale. Green = matched; red/orange = mismatched. Right—Constellation: r[n] (cyan) and s[n] (orange) in I/Q plane. Both rotate with CFO.

Concepts

  • Matched filter: Correlate with the conjugate of the expected waveform. Maximizes SNR at the correct delay.
  • Processing gain: Coherent (signal) vs incoherent (noise) addition. SNR improves by √N.
  • Phasor walk: Visual proof—matched lag gives aligned phasors (long resultant); mismatched gives random walk (short resultant).