802.11a/g SER Simulation

This example shows how to perform a symbol error rate (SER) simulation of an 802.11 a/g radio link.

A basic 802.11 communications link using OFDM modulation with QPSK symbols is simulated. Consistent with the standard, there is a single transmit and a single receive antenna.

Construct the QPSK modulator and demodulator objects.

hQMod = comm.QPSKModulator;
hQDemod = comm.QPSKDemodulator;

Construct the OFDM modulator and demodulator pair using the default parameters. The default parameters are based on the 802.11 a/g standard.

hOFDMMod = comm.OFDMModulator;
hOFDMDemod = comm.OFDMDemodulator(hOFDMMod);

Use the info method to determine the required input dimensions for the OFDM modulator and display the results.

modDim = info(hOFDMMod);

disp(modDim)
    DataInputSize: [53 1]
       OutputSize: [80 1]

Create an AWGN channel object with a signal-to-noise ratio of 23 dB.

hAWGN = comm.AWGNChannel('NoiseMethod',...
    'Signal to noise ratio (SNR)','SNR', 23);

Set the random number generator to its default value to ensure that the results are repeatable. Determine the number of OFDM symbols per frame by using the first value of the modDim.DataInputSize array.

rng('default')      % Initialize random number generator
nFrames = 100;      % Number of OFDM frames to transmit
nSymbolsPerFrame = modDim.DataInputSize(1);

Create an error rate object for tracking error statistics and enable the object to be reset during each loop iteration.

hError = comm.ErrorRate('ResetInputPort',true);
SER = zeros(nFrames, 1);

Run the simulation over 100 OFDM frames (5300 symbols). During loop execution, generate a random data vector with length equal to the required number of symbols per frame, Apply QPSK modulation and then apply OFDM modulation. Pass the OFDM modulated data through the AWGN channel and then apply OFDM demodulation. Demodulate the resultant QPSK data and compare it with the original data to determine the symbol error rate.

for k = 1:nFrames
    % Generate random data for each OFDM frame
    data = randi([0 3], nSymbolsPerFrame, 1);

    % Apply QPSK modulation
    modData = step(hQMod, data);

    % Modulate QPSK symbols using OFDM
    dataOFDM = step(hOFDMMod, modData);

    % Pass OFDM signal through AWGN channel
    receivedSignal = step(hAWGN, dataOFDM);

    % Demodulate OFDM data
    receivedOFDMData = step(hOFDMDemod, receivedSignal);

    % Demodulate QPSK data
    receivedData = step(hQDemod, receivedOFDMData);

    % Compute BER
    errors = step(hError, data, receivedData, 1);
    SER(k) = errors(1);
end

Display the symbol error data for the first ten frames.

disp(SER(1:10))
    0.0377
    0.0566
    0.0566
    0.1132
    0.0755
    0.0566
    0.0566
    0.0566
    0.0755
    0.1509
Was this topic helpful?