Documentation

SER Simulation for OFDM Link

This example shows how to perform a symbol error rate (SER) simulation of an over-the-air OFDM communication link.

A basic communications link using OFDM modulation with QPSK symbols is simulated. There is a single transmit and a single receive antenna.

Create QPSK modulator and demodulator objects.

qpskMod = comm.QPSKModulator;
qpskDemod = comm.QPSKDemodulator;

Create a default OFDM modulator and demodulator pair.

ofdmMod = comm.OFDMModulator;
ofdmDemod = comm.OFDMDemodulator;

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

modDim = info(ofdmMod)
modDim = 

    DataInputSize: [53 1]
       OutputSize: [80 1]

Create an AWGN channel.

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

Set the number of frames. Determine the number of OFDM symbols per frame from the modDim.DataInputSize array.

nFrames = 100;
nSymbolsPerFrame = modDim.DataInputSize(1);

Create an error rate counter with a reset input port. Initialize the symbol error rate vector, SER.

err = 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(qpskMod,data);

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

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

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

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

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

Display the symbol error data for the first ten frames.

SER(1:10)
ans =

    0.0377
    0.0566
    0.0566
    0.1132
    0.0755
    0.0566
    0.0566
    0.0566
    0.0755
    0.1509

Was this topic helpful?