M. T. Homer Reid MIT Home Page
Physics Problems Research teaching My Music About Me Miscellany

OFDMPKT: Packet Encoding and OFDM Modulation
for IEEE 802.11A 5 GHz Wireless LAN

I recently embarked on a project to investigate transmitter and power amp architectures for IEEE 802.11A, only to realize I knew almost nothing about the signal I was trying to transmit. In order to get a slightly better idea of what the transmitted waveform in IEEE 802.11a looks like, I turned to the standard document, where I found a thorough and easy-to-follow description of the digital coding and modulation process. However, the standard document doesn't include pictures or spectra of the transmitted waveforms, so I decided to implement the coding and modulation processes in a C program, which I could then use to generate time-domain plots and frequency spectra of the transmitted signal.
The result if OFDMPKT. It takes an input file containing the data you want to send, and produces a list of numbers representing the values of the I and Q waveforms a baseband transmitter would output to an RF front end. In between, OFDMPKT handles preamble (training symbol) generation, scrambling, convolutional coding, block interleaving, modulation of bits onto subcarriers, and IDFT computation. Here's an example of its invocation:
% ofdmpkt -file OdeToJoy -rate 36 > iqout

ofdmpkt     --   IEEE 802.11a OFDM packet encoding 
Homer Reid  --   5/2001

Reading data from file OdeToJoy.

Using data rate 36 MBPS.
Thank you for your support.
Notice that the program takes two command line options: -file specifies the input file, and -rate specifies the coding rate in MBPS (6, 9, 12, 18, 24, 36, 48 or 54). If no coding rate is specified, a default of 36 MBPS is assumed.
Notice also that I used the > redirection operator to redirect the output of the program to a file called, in this case, iqout. (If you don't do this, a huge list of numbers will pour out onto your console, which is probably not what you want.) After running the program, the contents of iqout look like this:
    0 0.0000e+00    0.016  0.016
    1 5.0000e-08   -0.090  0.002
    2 1.0000e-07   -0.009 -0.053
    3 1.5000e-07    0.097 -0.009
    4 2.0000e-07    0.062 -0.000
    5 2.5000e-07    0.097 -0.009
    6 3.0000e-07   -0.009 -0.053
    7 3.5000e-07   -0.090  0.002
  874 4.3700e-05   -0.118 -0.149
  875 4.3750e-05    0.019 -0.019
  876 4.3800e-05   -0.042  0.026
  877 4.3850e-05    0.041  0.009
  878 4.3900e-05    0.028 -0.076
  879 4.3950e-05   -0.038 -0.068
  880 4.4000e-05   -0.006  0.005
The first column is the sample number; the second column is the time at which that sample would be output (the first sample is output at time 0); the third and fourth columns, respectively, are the I and Q voltages that appear at the outputs of the D/A converters.
Download OFDMPKT:

Source code: ofdmpkt.tar.gz

View OFDMPKT source code with syntax highlighting:

Main C file: ofdmpkt.c.shtml
Complex number routines: complex.c.shtml
Convolutional coding: conv.c.shtml
Block interleaving: intrleav.c.shtml
Inverse discrete Fourier transform routine: idft.c.shtml
Modulation of bits onto subcarriers: modulate.c.shtml
Global variables: ofdmglob.c.shtml
Pilot tone insertion: pilots.c.shtml
Packet preamble generation: preamble.c.shtml
Bit string scrambler: scramble.c.shtml
SIGNAL field encoding and modulation: signal.c.shtml

Sample output: Baseband waveform, RATE=6 MBPS

Baseband waveforms, 6 MBPS

Sample output: Baseband waveform, RATE=54 MBPS

Baseband waveforms, 54 MBPS

Homer Reid's OFDMPKT, by Homer Reid
Last Modified: 11/16/16