---
title: OFDM
heading: Orthogonal frequency-division multiplexing, overlapping subcarriers that don't interfere, the FFT implementation, the cyclic prefix that turns a dispersive channel into one-tap equalization, and its costs
eyebrow: S8 · Lesson 26 · OFDM
xp: 50
---

::: hook
Equalizing a channel whose echoes span dozens of symbols takes long, power-hungry filters. OFDM sidesteps the problem by sending hundreds of slow symbols side by side on closely packed subcarriers instead of one fast stream. Each subcarrier is narrow enough that the channel looks flat across it, so equalization shrinks to a single complex multiplication per subcarrier. An FFT generates and separates the subcarriers, and a short cyclic prefix absorbs the echoes. Wi-Fi, LTE, 5G, DSL and digital TV are all built this way.
:::

::: play
- The spectra of five adjacent OFDM subcarriers, each a sinc centered on its own frequency, spaced exactly by the reciprocal of the symbol time.
- At each subcarrier's center, every other subcarrier's spectrum passes through zero: they overlap heavily but don't interfere.
- A receiver frequency offset ε (in units of the spacing) samples each subcarrier off its peak and picks up the neighbors' sidelobes: intercarrier interference. At 5% of the spacing the signal loses 0.04 dB and each neighbor leaks in at −25.6 dB.
:::
:::

```sim plot
view: graph
x: f = -2..6
y: X = -0.3..1.05
slider: e = 0..0.5 = 0.05 step 0.01
plot: sin(pi*(f + 1e-9))/(pi*(f + 1e-9)) | samples: 800 | label: subcarrier 0
plot: sin(pi*(f - 1 + 1e-9))/(pi*(f - 1 + 1e-9)) | samples: 800 | color: ch2 | label: subcarrier 1
plot: sin(pi*(f - 2 + 1e-9))/(pi*(f - 2 + 1e-9)) | samples: 800 | color: ch3 | label: subcarrier 2
plot: sin(pi*(f - 3 + 1e-9))/(pi*(f - 3 + 1e-9)) | samples: 800 | dashed | label: subcarrier 3
plot: sin(pi*(f - 4 + 1e-9))/(pi*(f - 4 + 1e-9)) | samples: 800 | dashed | color: ch2 | label: subcarrier 4
marker: f = 2 + e | label: receiver samples subcarrier 2 here
readout: signal loss, dB = 20*log(abs(sin(pi*(e + 1e-9))/(pi*(e + 1e-9))))
readout: leakage from one neighbor, dB = 20*log(abs(sin(pi*(1 - e))/(pi*(1 - e))))
```

::: predict
## Wi-Fi (802.11a) uses 64-point FFTs at 20 MHz with a 0.8 µs cyclic prefix and 48 data subcarriers. With 64-QAM at code rate 3/4, what's the data rate?

- [ ] 20 Mb/s
- [x] 54 Mb/s
- [ ] 72 Mb/s
- [ ] 120 Mb/s

::: reveal
Subcarriers are 20 MHz/64 = 312.5 kHz apart, so the useful symbol lasts 3.2 µs, plus 0.8 µs of prefix: 4 µs per OFDM symbol. Each carries 48 × 6 coded bits, 288, of which three quarters are data: 216 bits per 4 µs, 54 Mb/s.
:::
:::

::: nameit
## Orthogonal subcarriers

N subcarriers spaced $\Delta f = 1/T_u$ over a useful symbol time $T_u$ are orthogonal: $\int_0^{T_u}e^{j2\pi k\Delta ft}e^{-j2\pi l\Delta ft}dt = 0$ for k ≠ l. Each subcarrier carries one QAM symbol per OFDM symbol, and the total occupies about $N\Delta f$.

## The FFT implementation

The transmitter puts the N QAM symbols into an inverse FFT; its N outputs, sent at rate $N\Delta f$, are the OFDM symbol. The receiver's FFT recovers them. With sample rate $f_s$ and FFT size N, $\Delta f = f_s/N$.

## The cyclic prefix

Copying the last $N_{cp}$ samples of each symbol to its front makes the channel's linear convolution look circular, as long as the channel's delay spread is shorter than the prefix. Then each subcarrier simply sees one complex gain $H_k$, and the equalizer divides by it:

$$Y_k = H_kX_k + N_k \quad\Rightarrow\quad \hat{X}_k = Y_k/H_k$$

The prefix costs a fraction $T_{cp}/(T_u + T_{cp})$ of the time and energy, an SNR penalty of $10\log(1 + T_{cp}/T_u)$.

## Costs and cures

- **Frequency offset** ε (in units of Δf) loses $20\log|\text{sinc}\,\epsilon|$ of signal and leaks each neighbor in at $|\text{sinc}(1 - \epsilon)|$: OFDM needs accurate frequency synchronization.
- **Peak-to-average power**: the sum of many independent subcarriers looks Gaussian, with occasional large peaks (up to N times the average in the worst case), so amplifiers must back off (S6 lesson 46).
- Deep fades on individual subcarriers are handled by coding and interleaving across them (COFDM).
:::

::: example
## LTE uses 15 kHz subcarriers with a 4.69 µs normal cyclic prefix. What delay spread can it absorb, and what's the prefix's cost?

::: solution
1. **Useful symbol time.**
   $$\begin{aligned} T_u &= \frac{1}{15\ \text{kHz}} \\ &= 66.7\ \text{µs} \end{aligned}$$
2. **Delay spread absorbed.** Echoes up to 4.69 µs later fall inside the prefix, a path difference of
   $$3 \times 10^8 \times 4.69\ \text{µs} = 1.4\ \text{km}$$
3. **Overhead.**
   $$\frac{4.69}{71.4} = 6.6\%$$
4. **SNR penalty.**
   $$10\log\left(1 + \frac{4.69}{66.7}\right) = 0.30\ \text{dB}$$

**Answer:** it absorbs echoes up to 4.69 µs late (1.4 km of extra path), at a cost of 6.6% overhead and 0.30 dB of SNR.
:::
:::

::: example
## A receiver's frequency is off by 5% of the subcarrier spacing. What does that cost?

::: solution
1. **Signal loss.**
   $$20\log|\text{sinc}(0.05)| = -0.04\ \text{dB}$$
   negligible.
2. **Leakage.** From each adjacent subcarrier:
   $$|\text{sinc}(0.95)| = 0.052$$
   or −25.6 dB, and the many more distant subcarriers add more.
3. **For 64-QAM.** It needs about 25 dB SNR, so that interference alone would matter; receivers correct frequency to about 1% of the spacing.

**Answer:** a negligible 0.04 dB of signal loss, but −25.6 dB of leakage from each adjacent subcarrier, enough to matter for 64-QAM.
:::
:::

::: example
## Wi-Fi's 20 MHz mode uses a 64-point FFT, a 0.8 µs prefix and 48 data subcarriers. What is its subcarrier spacing, symbol time, prefix cost, and its rate with 64-QAM at code rate 3/4?

::: solution
1. **Subcarrier spacing.**
   $$\begin{aligned} \Delta f &= \frac{20\ \text{MHz}}{64} \\ &= 312.5\ \text{kHz} \end{aligned}$$
2. **Symbol time.** $T_u$ = 3.2 µs, and with its prefix the symbol lasts
   $$\begin{aligned} T &= (3.2 + 0.8)\ \text{µs} \\ &= 4.0\ \text{µs} \end{aligned}$$
3. **Prefix cost.**
   $$10\log_{10}\frac{4.0}{3.2} = 0.97\ \text{dB}$$
4. **Rate.** Each symbol carries $48 \times 6 \times \frac34$ = 216 bits:
   $$\begin{aligned} R &= \frac{216\ \text{bits}}{4\ \text{µs}} \\ &= 54\ \text{Mb/s} \end{aligned}$$
   the familiar top rate of 802.11a/g.

**Answer:** 312.5 kHz spacing, a 4.0 µs symbol (3.2 µs plus the prefix), 0.97 dB for the prefix, and 54 Mb/s.
:::
:::

::: check
given: s = 20 | 30.72 | 100; N = 64 | 1024 | 2048
answer: s*1000/N
unit: kHz
tolerance: 0.5%

## An OFDM system samples at {s} MHz with {N}-point FFTs. What's its subcarrier spacing?

::: right
Right. $f_s/N$ = {answer} kHz.
:::

::: misses
- [s*1000/(2*N)] The FFT's bins span the full sample rate.
- [any] Not yet. $\Delta f = f_s/N$.
:::
:::

::: check
given: u = 3.2 | 12.8 | 66.7; c = 0.4 | 0.8 | 4.7
answer: 10*log(1 + c/u)
unit: dB
tolerance: 0.05

## An OFDM symbol has a {u} µs useful part and a {c} µs cyclic prefix. What SNR does the prefix cost?

::: right
Right. $10\log(1 + T_{cp}/T_u)$ = {answer} dB.
:::

::: misses
- [any] Not yet. The energy spent on the prefix is wasted.
:::
:::

::: check
given: D = 48 | 600 | 3300; b = 2 | 4 | 6; r = 0.5 | 0.75; T = 4 | 71.4
answer: D*b*r/T
unit: Mb/s
tolerance: 0.5%

## An OFDM system carries {D} data subcarriers with {b} coded bits each at code rate {r}, in {T} µs symbols. What's its data rate?

::: right
Right. $N_\text{data}\,b\,r/T_\text{sym}$ = {answer} Mb/s.
:::

::: misses
- [D*b/T] Multiply by the code rate.
- [any] Not yet. Data bits per symbol over the symbol time.
:::
:::

::: check
given: c = 0.8 | 4.7 | 16.7
answer: 299.792458*c
unit: m
tolerance: 0.5%

## A cyclic prefix lasts {c} µs. What's the longest echo path difference it can absorb?

::: right
Right. $cT_{cp}$ = {answer} m.
:::

::: misses
- [299.792458*c/2] Unlike radar, the echo travels the extra distance only once.
- [any] Not yet. Distance light travels in the prefix time.
:::
:::

::: check
given: e = 0.02 | 0.05 | 0.1 | 0.2
answer: 20*log(abs(sin(pi*(1 - e))/(pi*(1 - e))))
unit: dB
tolerance: 0.05

## An OFDM receiver's frequency is off by {e} of the subcarrier spacing. How strongly does each adjacent subcarrier leak in?

::: right
Right. $20\log|\text{sinc}(1 - \epsilon)|$ = {answer} dB.
:::

::: misses
- [20*log(abs(sin(pi*e)/(pi*e)))] That's the signal's own loss.
- [any] Not yet. Evaluate the neighbor's sinc one spacing minus ε away.
:::
:::

::: check
given: s = 15 | 30 | 120
answer: 1000/s
unit: µs
tolerance: 0.5%

## What's the useful symbol time of an OFDM system with {s} kHz subcarrier spacing?

::: right
Right. $T_u = 1/\Delta f$ = {answer} µs.
:::

::: misses
- [any] Not yet. Orthogonality needs $\Delta f = 1/T_u$.
:::
:::

::: check
kind: parts
given: s = 10 | 20 | 30.72; N = 64 | 256 | 2048; c = 0.0625 | 0.25

## An OFDM system samples at {s} MHz with {N}-point FFTs and a cyclic prefix of {c} of the useful symbol.

::: part
answer: s*1e6/N/1000
unit: kHz
tolerance: 0.5%

### What is the subcarrier spacing?

::: misses
- [any] $f_s/N$.
:::
:::

::: part
answer: N/(s*1e6)*(1 + c)*1e6
unit: µs
tolerance: 0.5%

### How long is each symbol, prefix included?

::: misses
- [N/(s*1e6)*1e6] Add the prefix.
- [any] $T_u(1 + T_{cp}/T_u)$.
:::
:::

::: part
answer: 10*log(1 + c)
unit: dB
tolerance: 0.5%

### What does the prefix cost in SNR?

::: misses
- [any] $10\log_{10}(1 + T_{cp}/T_u)$.
:::
:::
:::

::: check
kind: derivation
vars: D = 12..3000, b = 1..10, r = 0.3..1, T = 1e-6..1e-3

## An OFDM system carries D data subcarriers of b coded bits each at code rate r in symbols of duration T (prefix included).

::: step
answer: D*b*r

### How many data bits does each symbol carry?
:::

::: step
answer: D*b*r/T

### What data rate results?
:::

::: right
Right. The prefix lengthens T without adding bits, which is its rate cost.
:::
:::

::: explain
## Why does a cyclic prefix make a dispersive channel act like one complex gain per subcarrier?

::: model
A channel with echoes convolves the transmitted signal with its impulse response, so each OFDM symbol's start is contaminated by the previous symbol's tail and its subcarriers no longer line up as whole numbers of cycles. Prefixing each symbol with a copy of its own last few samples changes that: as long as the echoes are shorter than the prefix, the receiver can discard the prefix and the remaining samples are exactly what a circular convolution of the symbol with the channel would produce. Circular convolution becomes multiplication in the DFT domain, so after the receiver's FFT each subcarrier is simply multiplied by the channel's frequency response at that frequency. Undoing the channel is then one complex division per subcarrier.
:::
:::

::: practice

::: check
given: s = 10 | 61.44; N = 256 | 4096
answer: s*1000/N
unit: kHz
tolerance: 0.5%

## Subcarrier spacing: {s} MHz, N = {N}?

::: misses
- [any] $f_s/N$.
:::
:::

::: check
given: u = 6.4 | 33.3; c = 0.8 | 2.3
answer: 10*log(1 + c/u)
unit: dB
tolerance: 0.05

## CP cost: {u} µs useful, {c} µs prefix?

::: misses
- [any] $10\log(1 + T_{cp}/T_u)$.
:::
:::

::: check
given: D = 234 | 1200; b = 4 | 8; r = 0.5 | 0.83; T = 4 | 71.4
answer: D*b*r/T
unit: Mb/s
tolerance: 0.5%

## OFDM rate: {D} subcarriers, {b} bits, rate {r}, {T} µs?

::: misses
- [any] $N_\text{data}br/T$.
:::
:::
:::
