>
section 4 of 146 min read

4. Detection in Noise: The Matched Filter

We send a known waveform; the channel adds noise; the receiver guesses what was sent. In Chapter 3 we built the math of cross-correlation. Here we use it.

4.1 The setup

Assume additive white Gaussian noise (AWGN): r(t)=s(t)+n(t)r(t) = s(t) + n(t), where n(t)n(t) has flat power spectral density N0/2N_0 / 2 (two-sided) and Gaussian distribution at every instant. The receiver wants the highest possible signal-to-noise ratio at the sampling instant, because that is when it makes the decision.

4.2 The matched filter, derived

We pass r(t)r(t) through a linear filter with impulse response h(t)h(t) and sample the output at t=Tt = T. The output is

y(T)=r(τ)h(Tτ)dτ=s(τ)h(Tτ)dτ+n(τ)h(Tτ)dτ.y(T) = \int_{-\infty}^{\infty} r(\tau) h(T - \tau) d\tau = \int s(\tau) h(T - \tau) d\tau + \int n(\tau) h(T - \tau) d\tau.

The signal part of the output is so(T)=s(τ)h(Tτ)dτs_o(T) = \int s(\tau) h(T - \tau) d\tau and the noise part is a Gaussian with variance σn2=(N0/2)h(t)2dt\sigma_n^2 = (N_0 / 2) \int |h(t)|^2 dt. The output SNR at sample time is

ρ=so(T)2σn2=s(τ)h(Tτ)dτ2(N0/2)h(t)2dt.\rho = \frac{|s_o(T)|^2}{\sigma_n^2} = \frac{\big| \int s(\tau) h(T-\tau) d\tau \big|^2}{(N_0/2)\int |h(t)|^2 dt}.

Cauchy-Schwarz inequality says s(τ)h(Tτ)dτ2s(τ)2dτh(Tτ)2dτ,\big| \int s(\tau) h(T-\tau) d\tau \big|^2 \le \int |s(\tau)|^2 d\tau \cdot \int |h(T-\tau)|^2 d\tau, with equality if and only if h(Tτ)=Ks(τ)h(T-\tau) = K \cdot s(\tau)^* for some constant KK, i.e., the filter's impulse response is a time-reversed conjugate of the transmitted pulse. Then

ρmax=s(τ)2dτN0/2=2EN0,\rho_\text{max} = \frac{\int |s(\tau)|^2 d\tau}{N_0 / 2} = \frac{2E}{N_0},

where EE is the signal energy. The maximum achievable SNR depends only on energy and noise PSD, not on pulse shape. This is the matched filter, and its name comes from the way its impulse response is matched to the transmitted pulse.

4.3 Matched filter and correlator are the same thing

Two equivalent realisations.

rendering diagram...
rendering diagram...

The first is a filter; the second is a correlator. They produce the same output at t=Tt = T. Hardware realises whichever is cheaper. Wi-Fi and Bluetooth use FIR filters whose taps are the matched impulse response. GPS uses correlators because the spreading code is so long that storing it as a filter would be unwieldy. The two views are mathematically identical, and Chapter 3's section on cross-correlation is exactly the same operation, dressed in receiver clothing.

4.4 The Q-function and BPSK BER, derived

For BPSK, the two possible signals are s0(t)=Ebϕ(t)s_0(t) = -\sqrt{E_b} \phi(t) and s1(t)=+Ebϕ(t)s_1(t) = +\sqrt{E_b} \phi(t), where ϕ(t)\phi(t) is a unit-energy pulse. After matched filtering, the sample is

y=±Eb+n,y = \pm \sqrt{E_b} + n,

with nN(0,N0/2)n \sim \mathcal{N}(0, N_0 / 2). The decision threshold is zero. An error occurs when s1s_1 was sent but y<0y < 0, or s0s_0 was sent but y>0y > 0. By symmetry,

Pe=Pr[y<0s1]=Pr[Eb+n<0]=Pr[n<Eb].P_e = \Pr[ y < 0 | s_1 ] = \Pr[ \sqrt{E_b} + n < 0 ] = \Pr[ n < -\sqrt{E_b} ].

Since nn is zero-mean Gaussian with variance N0/2N_0 / 2,

Pe=Eb1πN0et2/N0dt=Q ⁣(2EbN0).P_e = \int_{-\infty}^{-\sqrt{E_b}} \frac{1}{\sqrt{\pi N_0}} e^{-t^2 / N_0} dt = Q\!\left(\sqrt{\frac{2 E_b}{N_0}}\right).

The Q-function Q(x)=12πxeu2/2duQ(x) = \frac{1}{\sqrt{2\pi}} \int_x^\infty e^{-u^2/2} du is the tail of the standard normal distribution. It captures the probability that a unit Gaussian exceeds xx standard deviations. There is no closed-form expression for QQ in elementary functions, but numerically it is easy and many useful bounds exist (a tight one: Q(x)12ex2/2Q(x) \le \frac{1}{2} e^{-x^2 / 2} for x0x \ge 0).

So BPSK BER = Q(2Eb/N0)Q(\sqrt{2 E_b / N_0}), the most-printed formula in digital communications. Solve for various BER targets:

BERRequired Eb/N0E_b/N_0
10110^{-1}1.6-1.6 dB
10210^{-2}4.3 dB
10310^{-3}6.8 dB
10410^{-4}8.4 dB
10510^{-5}9.6 dB
10610^{-6}10.5 dB
10910^{-9}12.6 dB

Each decade of BER costs about 1 dB at high SNR.

4.5 BER for other schemes

A short cheat sheet (all assume Gray coding and AWGN, BER per bit not per symbol):

  • BPSK: Pb=Q(2Eb/N0)P_b = Q(\sqrt{2 E_b/N_0})
  • QPSK: Pb=Q(2Eb/N0)P_b = Q(\sqrt{2 E_b/N_0}) (same as BPSK, with twice the bit rate)
  • Coherent BFSK: Pb=Q(Eb/N0)P_b = Q(\sqrt{E_b/N_0}) (3 dB worse than BPSK, because the two BFSK signals are orthogonal not antipodal)
  • Non-coherent BFSK: Pb=12eEb/(2N0)P_b = \frac{1}{2} e^{-E_b/(2 N_0)} (about 0.8 dB worse than coherent BFSK)
  • DPSK: Pb=12eEb/N0P_b = \frac{1}{2} e^{-E_b/N_0} (about 1 dB worse than BPSK)
  • M-PSK (M4M \ge 4): Pb2log2MQ(2log2MEb/N0sin(π/M))P_b \approx \frac{2}{\log_2 M} Q(\sqrt{2 \log_2 M \cdot E_b/N_0} \sin(\pi/M))
  • M-QAM (square, Gray coded): Pb4(M1)Mlog2MQ ⁣(3log2MM1EbN0)P_b \approx \frac{4(\sqrt{M}-1)}{\sqrt{M} \log_2 M} Q\!\left(\sqrt{\frac{3 \log_2 M}{M - 1} \cdot \frac{E_b}{N_0}}\right)

Why coherent BPSK and DPSK are close but not equal. BPSK uses the absolute phase. The decision distance between the two signals is 2Eb2\sqrt{E_b}. DPSK uses the difference of two consecutive samples; each carries phase noise, and the difference inherits twice the noise variance. The result is a slightly worse BER, by about 1 dB, in exchange for not needing carrier phase recovery.

4.6 The classical BER curve picture

Plot log10(Pb)\log_{10}(P_b) versus Eb/N0E_b/N_0 in dB for each scheme and the curves all look like cliffs that get steeper at higher SNR. The closer the curve to the y-axis, the more power-efficient the scheme. The closer to the upper-left, the more bandwidth-efficient (per Hz) it can be. There is always a tradeoff between bandwidth efficiency and SNR efficiency, and the BER curve is where you read it off. The vertical asymptote on the left is the Shannon limit for that bandwidth and SNR, the absolute lower bound below which no system can operate. We will derive that next.

python
# Simulate BPSK BER over AWGN and compare to theory.
import numpy as np
from scipy.special import erfc
 
def Q(x): return 0.5 * erfc(x / np.sqrt(2))
 
EbN0_dB = np.arange(0, 11)
EbN0    = 10 ** (EbN0_dB / 10)
N       = 1_000_000     # bits per point
 
ber_sim, ber_theory = [], []
rng = np.random.default_rng(0)
for snr in EbN0:
    bits   = rng.integers(0, 2, N)
    sym    = 2*bits - 1                               # 0 -> -1, 1 -> +1
    noise  = rng.standard_normal(N) / np.sqrt(2*snr)  # variance 1/(2 Eb/N0)
    rx     = sym + noise
    decided = (rx > 0).astype(int)
    ber_sim.append((decided != bits).mean())
    ber_theory.append(Q(np.sqrt(2*snr)))
 
# ber_sim and ber_theory will overlay neatly on a log plot.

Run that and you see the simulated points hug the theoretical Q(2Eb/N0)Q(\sqrt{2 E_b/N_0}) curve to within statistical scatter. That precise overlay is one of the satisfying confirmations that the math is right.