📶 OFDM & WiFi Subcarriers

Orthogonal subcarriers · Cyclic prefix · Multipath · 802.11

📶 OFDM & WiFi Subcarriers

WiFi doesn't use one radio carrier — it uses hundreds, all transmitting at once. OFDM (Orthogonal Frequency-Division Multiplexing) packs data onto dozens of narrow orthogonal subcarriers simultaneously, achieving very high spectral efficiency while remaining robust to multipath fading.

🔬 What It Demonstrates

A set of N sinusoidal subcarriers, each at a different frequency fn = n·Δf where Δf = 1/Tsymbol, are mathematically orthogonal: their cross-products integrate to zero over one symbol period. This means each subcarrier can be decoded independently despite overlapping spectra. The cyclic prefix — a copy of the last part of the IFFT symbol prepended at the start — acts as a guard interval, converting linear convolution (multipath) into circular convolution and allowing a simple 1-tap equaliser per subcarrier. 802.11g (WiFi 4) uses a 64-point FFT, 48 data subcarriers, 4 pilots, 16-sample CP, at 20 MHz bandwidth.

🎮 How to Use

Switch between WiFi modes to see how the 52 active subcarriers are arranged, with null subcarriers around DC and at the band edges (spectral mask). Turn on Multipath delay and increase the delay slider — with CP off, ISI ruins the orthogonality (bar heights distort); with CP on, each subcarrier is still cleanly separated. Increase Noise to watch how 64-QAM needs high SNR (>25 dB) while BPSK works down to ~5 dB.

💡 Did You Know?

Every smartphone WiFi chip contains a 64-point FFT/IFFT running at 20 million symbols per second. WiFi 6 (802.11ax) increased to a 1024-point FFT with 980 data subcarriers in an 80 MHz channel. 5G NR also uses OFDM — with configurable subcarrier spacings of 15, 30, 60, 120, or 240 kHz depending on the frequency band. Robert Chang's 1966 Bell Labs paper is considered one of the foundational multicarrier works.

About this simulation

This simulation builds an OFDM signal from a bank of N orthogonal subcarriers, each drawn as symbols[n]·cos(2π·fn·s + phases[n]) with fn = (n+1)/N, then sums and renders them as a single composite time-domain waveform. A cyclic prefix equal to 25% of the symbol length (matching real 802.11) can be toggled on or off, a multipath echo can be added with a configurable delay, and Gaussian-like noise is mixed in according to the chosen SNR. The frequency-domain panel below shows the magnitude of every subcarrier as a coloured bar, with visible distortion when the cyclic prefix is switched off in the presence of multipath.

🔬 What it shows

The top panel plots each of the N individual subcarrier cosines in a faint colour plus the bright composite OFDM waveform, with the cyclic-prefix region shaded and a dashed line marking where it is copied from the end of the symbol. The bottom panel renders each subcarrier's magnitude as a gradient-filled bar; when the cyclic prefix is off and a multipath echo is active, random distortion is spread into neighbouring bins to depict inter-symbol interference (ISI), and for N ≤ 16 faint sinc-shaped lobes are drawn to illustrate why the subcarriers are mathematically orthogonal.

🎮 How to use

Choose the WiFi 802.11g preset (16 visualised subcarriers, real parameters: 64-point FFT, 48 data subcarriers, 20 MHz bandwidth) or 802.11n (20 subcarriers, 52 data subcarriers), or switch to Custom to unlock the N Subcarriers slider (4–64, steps of 4). Toggle Cyclic Prefix, pick a modulation (BPSK/QPSK/16-QAM/64-QAM — this changes the bits-per-symbol figure in the stats panel), then drag Multipath Delay (0–5) with the prefix off to watch orthogonality break down, or raise the Noise (SNR) slider from 40 dB down to 5 dB to see the waveform get noisier.

💡 Did you know?

Real 802.11g WiFi transmits its 64-point FFT symbols with a 16-sample cyclic prefix — exactly the 25% ratio reproduced here — every 4 microseconds (3.2 µs symbol + 0.8 µs prefix), giving a 312.5 kHz subcarrier spacing across a 20 MHz channel. The cyclic prefix works because it turns the linear convolution caused by multipath echoes into a circular one, which lets a receiver undo channel distortion with one multiplication per subcarrier instead of a complex equalizer.

Frequently asked questions

What does OFDM actually stand for and why use many subcarriers?

OFDM stands for Orthogonal Frequency-Division Multiplexing. Instead of sending all data on one fast carrier, it splits it across many slower, narrowband subcarriers transmitted simultaneously. Because the subcarriers are mathematically orthogonal — their frequencies are spaced at exact multiples of 1/symbol-duration — they can overlap in frequency without interfering, which packs more data into the same bandwidth than sending each subcarrier separately.

What is the cyclic prefix for, and what happens if I turn it off?

The cyclic prefix is a copy of the tail of each OFDM symbol, prepended to the front before transmission; in this simulation it is fixed at 25% of the symbol length, matching real WiFi. It acts as a guard interval that absorbs the reflected multipath echo before the "real" symbol data arrives. Turn it off while the Multipath Delay slider is above zero and the frequency-domain bars become visibly distorted, with the simulation flagging "ISI — orthogonality broken", because the delayed echo now bleeds into the next symbol.

How do the WiFi presets differ from Custom mode?

The 802.11g preset fixes 16 visualised subcarriers (representing 48 real data subcarriers plus 4 pilots on a 64-point FFT) and 802.11n uses 20 (52 data subcarriers), both with a 20 MHz channel and a locked N-slider. Custom mode unlocks the N Subcarriers slider from 4 to 64 in steps of 4, letting you see directly how the frequency-domain bar count and the time-domain waveform's complexity scale with subcarrier count.

Why does raising the modulation order (BPSK to 64-QAM) matter?

Each modulation choice sets a fixed bits-per-subcarrier value in the stats panel — 1 for BPSK, 2 for QPSK, 4 for 16-QAM, 6 for 64-QAM — which directly multiplies into the "Bits / symbol" and "Spectral eff." readouts. Higher-order modulations pack more bits into the same subcarrier and symbol duration, which is why real WiFi and 5G systems switch to 64-QAM or higher only when the link has enough SNR to distinguish the denser constellation points.

What do the Multipath Delay and Noise (SNR) sliders model?

Multipath Delay (0–5) adds a delayed, amplitude-reduced echo of the composite waveform, drawn as a faint amber trace, simulating a signal reflecting off a wall or object before reaching the receiver. Noise (SNR) ranges from 40 dB down to 5 dB and mixes random amplitude noise into the time-domain samples, scaled so that lower SNR values produce a visibly rougher waveform — reflecting why high-order modulations need a cleaner (higher-SNR) channel to be decoded reliably.