S853 of 56
0 XP
  1. Hook
  2. Predict
  3. Name it
  4. Check
  5. Explain

S8 · Lesson 53 · Project

Building an OFDM transmitter and receiver with a cyclic prefix, passing it through a multipath channel, equalizing with one tap per subcarrier, and predicting its error rate from the channel's frequency response

This project builds the core of every Wi-Fi and LTE modem. You'll write the OFDM modulator that turns blocks of QPSK symbols into a time signal with a cyclic prefix, the demodulator that recovers them with an FFT, and the one-tap equalizer that undoes a multipath channel subcarrier by subcarrier. The final test sends 51,200 bits through a three-path channel with noise and checks the bit error rate against a prediction made from nothing but the channel's frequency response: each subcarrier behaves as its own QPSK link at its own SNR.

Predict

A three-path channel is normalized to unit energy and the link runs at 10 dB Eb/N0. Compared with a flat channel at the same Eb/N0, what happens to the OFDM link's error rate?

Name it

The transmitter

For each OFDM symbol, N subcarrier symbols X[k] go through an orthonormal inverse FFT, x[n]=1N∑kX[k]ej2πkn/N, which in NumPy is np.fft.ifft(X)*np.sqrt(N). The last Ncp samples are copied to the front, and the symbols are sent one after another.

The channel

y=h*x+n: a short multipath impulse response (fewer taps than the prefix) and complex white noise. With unit-energy QPSK on each subcarrier, the noise variance per complex sample is 1/(2Eb/N0) (ignoring the prefix's energy).

The receiver

Drop each prefix and take the orthonormal FFT, np.fft.fft(body)/np.sqrt(N). Because the prefix makes the channel's convolution circular, Y[k]=H[k]X[k]+W[k] with H=FFTN(h).

Equalization and performance

X^[k]=Y[k]/H[k], then QPSK decisions. Subcarrier k has Eb/N0 multiplied by |H[k]|2, so the predicted bit error rate is the average over subcarriers:

Pb=1N∑kQ(2|H[k]|2EbN0)

Worked example

A 64-subcarrier system uses a 16-sample prefix at 20 MHz. How long a channel can it handle, and what does the prefix cost?

Show the solution
  1. Prefix length. Tcp=1620MHz=0.8µs the Wi-Fi guard interval.
  2. Longest echo. It handles echoes up to 240 m longer than the direct path: 3×108m/s×0.8µs=240m
  3. Cost. The prefix uses 1680=20% of the time, 0.97 dB of SNR, as lesson 26 computed.

Answer echoes up to 0.8 µs (240 m of extra path), at a cost of 20% of the time, or 0.97 dB.

Worked example

The project's channel, normalized, has taps proportional to 0.8, 0.5j and −0.3. Where are its weakest subcarriers?

Show the solution
  1. Range of the gain. |H[k]|2 ranges from 0.19 to 2.61 across the band, averaging 1.
  2. The deepest dip. It runs 10log10⁡0.19=−7.2dB below average, so at 10 dB average those subcarriers see only about 2.8 dB and make most of the errors.
  3. Predicted error rate. The average is 5.9 × 10⁻³, about 1,500 times the flat-channel value of 3.9 × 10⁻⁶.

Answer the weakest subcarriers sit at the deepest dip, 7.2 dB below average (about 2.8 dB at 10 dB average SNR), and they make most of the errors.

Check

Step 1. Write ofdm_mod(X, ncp): orthonormal IFFT of each symbol plus a cyclic prefix.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 2. Write ofdm_demod(y, N, ncp, nsym): drop the prefixes and FFT each symbol.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Step 3. Write equalize(Y, h, N): the one-tap zero-forcing equalizer.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Explain why

Why does OFDM need only one complex multiplication per subcarrier to equalize a multipath channel?

Practice

Keep practicing

3 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.