The Optimal Detector
In the previous lesson we established that the cross-correlation of a received signal with a known template is the Neyman–Pearson-optimal test statistic for detecting that template in additive white Gaussian noise (AWGN). Now we turn this insight into a filter design problem: is there a linear filter whose output, sampled at the right moment, achieves the maximum possible signal-to-noise ratio (SNR)? The answer is yes, and that filter is called the matched filter.
Matched filtering is everywhere in modern engineering. A radar receiver uses it to compress long pulses into sharp spikes, improving range resolution without sacrificing detection range. A digital communications receiver applies it to maximize the SNR at the sampling instant before making a bit decision. A GPS receiver correlates the incoming signal with a local copy of the satellite’s pseudorandom code to pull the navigation message out of noise 20–30 dB below the thermal noise floor.
The matched filter is the linear filter that maximizes the output SNR at a specified sampling instant when the input is a known signal plus white noise. Its impulse response is the time-reversed, conjugated copy of the signal being detected.
h[n] = s*[N−1−n] — the matched filter impulse responseDeriving the Matched Filter
Suppose a signal s[n] of length N is buried in white Gaussian noise w[n] with variance σ². We pass the received signal y[n] = s[n] + w[n] through a linear filter h[n] and sample the output at time n = N−1. We want to choose h[n] to maximize the output SNR at that instant.
The output signal component at n = N−1 is the convolution sum evaluated at that instant. The output noise power is σ² Σ|h[k]|². The SNR is therefore:
This expression can be maximized using the Cauchy–Schwarz inequality, which states that |Σ a[k]b[k]|² ≤ (Σ|a[k]|²)(Σ|b[k]|²), with equality when b[k] = c a*[k] for any nonzero constant c. Identifying a[k] = s[k] and b[k] = h[N−1−k], the maximum SNR is:
The maximum achievable SNR is 2Es/N0 (or Es/σ² in discrete-time notation), regardless of the signal shape. This remarkable result says that the only way to improve detection performance is to increase the signal energy Es or reduce the noise power σ² — no filtering trick can do better than the matched filter.
The Matched Filter is a Correlator
The output of the matched filter h[n] = s*[N−1−n] at time n = N−1 is:
This confirms the connection from the previous lesson: the NP-optimal test statistic (cross-correlation) is exactly the output of the matched filter sampled at the right time. The matched filter is simply the efficient implementation of the correlator receiver as a single convolution operation.
Filtering with the matched filter h[n] = s*[N−1−n] and sampling at n = N−1 is exactly equivalent to computing the cross-correlation of the received signal with the known signal template. Use whichever form is more convenient computationally.
Frequency-Domain Perspective
In the frequency domain, the matched filter has a frequency response H(ejω) = S*(ejω) (ignoring the time-reversal phase term e−jω(N−1)). The magnitude response of the matched filter therefore equals the magnitude spectrum of the signal: |H(ejω)| = |S(ejω)|.
This has a beautiful interpretation: the matched filter boosts frequencies where the signal is strong and suppresses frequencies where the signal is weak. Since white noise has a flat power spectrum, the filter maximally emphasizes the signal’s spectral content relative to the uniform noise. The output is then a coherent sum of all the signal’s spectral components, which is exactly what maximizes the SNR.
Pulse Compression in Radar
Radar faces a fundamental trade-off. A long pulse carries more energy (good for detection range) but produces poor range resolution because echoes from closely spaced targets overlap in time. A short pulse gives sharp range resolution but carries little energy and suffers at long range. Pulse compression resolves this dilemma: transmit a long, coded pulse and apply a matched filter in the receiver to compress it into a short spike.
The most common coding scheme is linear frequency modulation (LFM) or “chirp,” where the instantaneous frequency sweeps linearly across a bandwidth B over the pulse duration T. The time-bandwidth product TB — called the compression ratio — is the factor by which the pulse is compressed. A typical radar chirp with TB = 1000 transmits a 1 ms pulse but after matched filtering behaves like a 1 μs pulse, gaining 30 dB of SNR while maintaining the range resolution of the short pulse.
Matched Filtering in Digital Communications
In a digital communications system, the transmitter sends a pulse shape g[n] for each bit (e.g., a rectangular pulse for bit 1, nothing for bit 0 in on-off keying). The channel adds AWGN. The optimal receiver applies a filter matched to g[n] and samples the output at the end of each symbol period to make a bit decision.
This correlator receiver is the standard architecture for coherent digital demodulation. For binary signaling in AWGN, it achieves the minimum possible bit error rate (BER) for a given Eb/N0. In practice, the matched filter also serves as an inter-symbol interference (ISI) reducer when combined with a Nyquist pulse shaping filter — the split-root raised-cosine (RRC) filter used in modern cellular systems is a matched pair: one RRC at the transmitter, one at the receiver, together forming the full raised-cosine Nyquist filter.
Modern cellular standards (LTE, 5G NR) use a root raised cosine (RRC) pulse at the transmitter. The receiver also applies an RRC filter. The cascade of the two RRC filters equals the raised cosine Nyquist filter, which has zero ISI at the sampling instants. Each RRC filter is the matched filter for the other.
GPS: Matched Filtering Below the Noise Floor
GPS is perhaps the most striking example of matched filtering in everyday life. Each GPS satellite broadcasts a signal at about −130 dBm at the Earth’s surface, which is approximately 20 dB below the thermal noise floor in a typical receiver bandwidth. The signal is completely invisible to a conventional spectrum analyzer. Yet GPS receivers reliably acquire and track these signals.
The key is the pseudorandom noise (PRN) code — a 1023-chip binary sequence with near-ideal autocorrelation properties (sharp peak, very low sidelobes). The receiver generates a local copy of the PRN code for each satellite and correlates it with the incoming signal. The correlation integrates for 1 ms (one code period), coherently summing 1023 chips. This provides a processing gain of 10 log10(1023) ≈ 30 dB, lifting the satellite signal ~10 dB above the noise. GPS is a textbook demonstration of the matched filter’s power.
- The matched filter is the linear filter that maximizes the output SNR when a known signal is corrupted by AWGN. Its impulse response is h[n] = s*[N−1−n] — the time-reversed conjugate of the signal.
- The maximum achievable SNR equals 2Es/N0, where Es is the signal energy. No linear filter can exceed this bound.
- Sampling the matched filter output at n = N−1 is mathematically identical to computing the cross-correlation of the received signal with the known signal template.
- In the frequency domain, the matched filter’s magnitude response equals the signal’s magnitude spectrum: it boosts frequencies where the signal is strong.
- Pulse compression uses a coded waveform (e.g., LFM chirp) matched filter to gain the SNR of a long pulse while achieving the range resolution of a short pulse. Processing gain = 10 log(TB) dB.
- In digital communications, the matched filter (correlator receiver) achieves the minimum BER for a given Eb/N0. Root raised cosine filters form matched pairs in modern standards.
- GPS exploits matched filtering to detect satellite signals 20 dB below the noise floor, achieving ~30 dB processing gain from 1023-chip PRN correlation.