Calculation of Bit Error Rate (BER) of Orthogonal Frequency Division Multiplexing (OFDM) through MATLAB

 


 Design a basic OFDM system utilizing an IFFT as the OFDM modulator and an FFT as the OFDM demodulator.

I am showing you a figure by which we can under the basic fundamentals of OFDM.



OFDM Modulation with IFFT


Step-1 Firstly, define the number of bits. it will be in the power of 2. which means the QAM signal's length is also a power of 2. The ifft and fft functions are significantly faster for signals of certain lengths, including those whose length is a power of 2.
Syntax- numBits = 32768;

Step-2 Define the modulation order

Syntax- modOrder = 16; % for 16-QAM


Step-3 Generate the random signal

Syntax- srcBits = randi([0,1],numBits,1);

Step-4 Modulate the Signal (Here we are doing QAM Modulation)

Syntax- qamModOut = qammod(srcBits,modOrder,"InputType","bit","UnitAveragePower",true);

Step-5 Calculate the Inverse Fast Fourier Transform (IFFT) of the 16-QAM signal.

Syntax- ofdmModOut = ifft(qamModOut)


Addition of Noise


Step-6 Now add the AWGN (Additive Gaussian White Noise) to the signal.

Syntax- if exist("ofdmModOut","var") % code runs after you complete Task 1
SNR = 15; % dB
chanOut = awgn(ofdmModOut,SNR,"measured");
end

OFDM Demodulation with FFT

Step-7 Calculate the Fast Fourier Transform (FFT)

Syntax- ofdmDemodOut = fft(chanOut)

Step-8 Now we can plot this.

Syntax - scatterplot(ofdmDemodOut)

# BER

Step- 9 Calculation of BER

Syntax- if exist("ofdmDemodOut","var") % code runs after you complete Task 2

qamDemodOut = qamdemod(ofdmDemodOut,modOrder,"OutputType","bit","UnitAveragePower",true);
numBitErrors = nnz(srcBits~=qamDemodOut)
BER = numBitErrors/numBits
end









Comments

Popular posts from this blog