ENع
←OFDM
Lesson 70 · Noise, errors and OFDM

OFDM: many slow carriers instead of one fast one

18 min11 steps5 questionsAdvanced
About this lesson

Wi-Fi, 4G and 5G all use OFDM: they send data not on one fast carrier, but on many slow ones side by side. Follow 16 bits through a toy link with 8 carriers and Wi-Fi's 20 MHz timing. On one carrier a wall echo lands each symbol on top of the symbol two places later; on 8 orthogonal carriers built with one inverse FFT, a short cyclic prefix swallows the echo, and the receiver undoes it with one FFT and one division per carrier. It builds on the DFT and FFT lessons, circular convolution, QPSK from the modulation module, and ISI from the baseband module.

You'll learn to

Tick what you feel confident about. These self-checks do not affect your lesson score.

Fig 70 · Interactive
01 / 11

One fast carrier

Send 16 bits as 8 QPSK symbols on one carrier, one after another. Each symbol lasts 50 ns, so the carrier changes 20 million times a second. A fast carrier means short symbols.

bits     11 01 10 00 11 10 01 00
QPSK     first bit -> sign of the real part
         second bit -> sign of the imaginary part
         (1 -> +, 0 -> −)
X[k]     1+j  −1+j  1−j  −1−j  1+j  1−j  −1+j  −1−j

one carrier: symbol k sent from k·50 ns
Ts = 50 ns  ->  1/Ts = 20 million symbols/s
8 symbols take 400 ns
plot: real part of what is sent
Loading figure…
or ← →
Read the lesson step by step
  1. One fast carrier

    Send 16 bits as 8 QPSK symbols on one carrier, one after another. Each symbol lasts 50 ns, so the carrier changes 20 million times a second. A fast carrier means short symbols.

    bits     11 01 10 00 11 10 01 00
    QPSK     first bit -> sign of the real part
             second bit -> sign of the imaginary part
             (1 -> +, 0 -> −)
    X[k]     1+j  −1+j  1−j  −1−j  1+j  1−j  −1+j  −1−j
    
    one carrier: symbol k sent from k·50 ns
    Ts = 50 ns  ->  1/Ts = 20 million symbols/s
    8 symbols take 400 ns
    plot: real part of what is sent
  2. An echo smears the symbols

    Radio also bounces off walls. This echo travels about 30 m further, so it arrives 100 ns late: two whole symbols. Each symbol's echo lands on top of the symbol two places later. That smear is intersymbol interference (ISI).

    extra path  100 ns × c = 29.98 m
                (c = 299 792 458 m/s)
    echo gain   0.4 (an example)
    
    received r(t) = s(t) + 0.4·s(t − 100 ns)
    
    100 ns / 50 ns = 2 symbols late
    symbol k is mixed with symbol k − 2
    the levels ±1 become ±1.4 or ±0.6
    fixing it needs a long equaliser filter
  3. Eight slow carriers instead

    Instead, give each symbol its own carrier and send all 8 at once. Now every symbol lasts 400 ns, 8 times longer. The same 100 ns echo now covers a quarter of a symbol, not two whole ones.

    serial -> parallel
      X[0] on carrier 0, X[1] on carrier 1, ...
    
    symbol length  T = 8 × 50 ns = 400 ns
    same bit rate:  16 bits per 400 ns
    
    echo / symbol:  100 / 400 = 1/4
    (one carrier:   100 / 50 = 2 whole symbols)
    
    plot: the spectrum of each carrier
  4. Spaced 1/T apart: orthogonal

    Carrier k makes exactly k cycles in T = 400 ns, so the carriers sit Δf = 1/T = 2.5 MHz apart. Their spectra overlap, yet each peak sits on the zeros of all the others. They are orthogonal.

    carrier k:  e^(j2π·k·t/T),  0 ≤ t < T
    spacing     Δf = 1/T = 1/400 ns = 2.5 MHz
    
    spectrum of carrier k over one symbol:
      sinc((f − k·Δf)/Δf)
      peak at k·Δf, zero at every other m·Δf
    
    over one symbol, for k ≠ m:
      ∫ e^(j2πkt/T)·e^(−j2πmt/T) dt = 0
    
    at f = 7.5 MHz only carrier 3 is non-zero
  5. One inverse FFT adds them all

    Adding 8 carriers is exactly an inverse DFT: x[n] = (1/8)·Σ X[k]·e^(j2πkn/8). One inverse FFT turns the 8 symbols X[k] into 8 time samples, 50 ns apart.

    x[n] = (1/8) Σ X[k]·e^(j2π·k·n/8),  n = 0..7
         = the sum of the 8 carriers at t = n·50 ns
    
    x[0..3] = 0, −0.1+0.25j, 0.5j, −0.25−0.6j
    x[4..7] = 0.5+0.5j, 0.6+0.25j, 0.5, −0.25+0.1j
    
    an FFT needs about N·log2(N) operations,
    not N² (Wi-Fi: N = 64)
    plot: real part of x(t); dots = samples
  6. A cyclic prefix as a guard

    Copy the last 2 samples (100 ns) to the front. This cyclic prefix is a guard. The waveform just carries on, because x(t) repeats every 400 ns. The block is now 500 ns long.

    tx = [x[6], x[7], x[0], x[1], ..., x[7]]
         2 + 8 = 10 samples = 500 ns
    
    x(t) repeats every T = 400 ns,
    so x(t) for −100 ≤ t < 0 equals x(t + 400)
    
    cost: 2 of every 10 samples carry no new data
          (20% of the time)
    Wi-Fi: 0.8 µs guard on 3.2 µs, also 1/4
  7. The echo stays inside the guard

    The echo is 100 ns late, no longer than the 100 ns prefix. Its tail spills only into the next block's prefix, which is thrown away. In the 400 ns the receiver keeps, the echo is just x rotated in a circle.

    rx = tx + 0.4·(tx delayed 2 samples)
    
    rule: prefix length ≥ echo delay
          100 ns ≥ 100 ns  ✓
    
    kept samples n = 2..9:
      y[n] = x[n] + 0.4·x[(n − 2) mod 8]
      a circular convolution of x with h
    
    plot: sent (prefix shaded) and received
  8. The FFT splits the carriers again

    Drop the prefix and run an FFT. A circular echo only scales and turns each carrier, so Y[k] = H[k]·X[k]. Carrier 5 arrives as (1−j)(1−0.4j) = 0.6−1.4j. No carrier leaks into another.

    Y = FFT(y)
    H = FFT of h = [1, 0, 0.4, 0, 0, 0, 0, 0]
      H[k] = 1 + 0.4·e^(−jπk/2)
      H    = 1.4, 1−0.4j, 0.6, 1+0.4j, 1.4, 1−0.4j, 0.6, 1+0.4j
    
    circular convolution  ->  Y[k] = H[k]·X[k]
    Y = 1.4+1.4j, −0.6+1.4j, 0.6−0.6j, −0.6−1.4j,
        1.4+1.4j, 0.6−1.4j, −0.6+0.6j, −0.6−1.4j
    
    plot: Y[k] in the complex plane
  9. One division per carrier

    The receiver measures H[k] from a known symbol at the start, then divides: X̂[k] = Y[k]/H[k]. One complex division per carrier, no long equaliser. All 8 points land back on QPSK, and the 16 bits come out.

    X̂[k] = Y[k] / H[k]
    carrier 5: (0.6−1.4j) / (1−0.4j) = 1−j
    
    X̂ = 1+j  −1+j  1−j  −1−j  1+j  1−j  −1+j  −1−j
        = X exactly (no noise in this example)
    
    bits out: 11 01 10 00 11 10 01 00
    
    with noise, a carrier with small |H[k]|
    (here |H| = 0.6) is the first to flip a bit
  10. OFDM in numpy

    In Python with numpy: ifft builds the block, np.r_ adds the prefix, convolve applies the echo, and fft splits it again. Dividing by H = fft(h, 8) returns X exactly, because this example has no noise.

    import numpy as np
    X = np.array([1+1j, -1+1j, 1-1j, -1-1j, 1+1j, 1-1j, -1+1j, -1-1j])
    h = np.array([1, 0, 0.4])        # direct path + echo 2 samples late
    x = np.fft.ifft(X)               # 8 time samples
    tx = np.r_[x[-2:], x]            # cyclic prefix: 10 samples
    rx = np.convolve(tx, h)[:10]     # the channel
    H = np.fft.fft(h, 8)
    Xh = np.fft.fft(rx[2:]) / H      # drop prefix, FFT, divide
    
    >>> np.allclose(Xh, X)
    True
    
    (Python 3 with numpy)
  11. Wi-Fi, 4G and 5G

    Wi-Fi (802.11a/g) does this with a 64-point FFT at 20 MHz: carriers 312.5 kHz apart, 3.2 µs symbols plus a 0.8 µs guard. LTE spaces its carriers 15 kHz apart; 5G NR uses 15 kHz up to 960 kHz.

                  this lesson   802.11a Wi-Fi
    sample rate   20 MHz        20 MHz
    FFT size      8             64
    carriers      8             52 (48 data + 4 pilots)
    spacing       2.5 MHz       312.5 kHz
    symbol        400 ns        3.2 µs
    guard         100 ns        0.8 µs
    
    LTE: 15 kHz · 5G NR: 15, 30, 60 ... 960 kHz
    longer symbols tolerate longer echoes

Quiz Unlocks after the last step.