Simulation of OFDM system in Matlab – BER Vs Eb/N0 for OFDM in AWGN channel

1 Star2 Stars3 Stars4 Stars5 Stars (13 votes, average: 4.46 out of 5)

This article is a part of the ebook : Simulation of digital communication systems using Matlab – available in both PDF and EPUB format.

To simulate an OFDM system, following design parameters are essential. Lets consider the OFDM system parameters as defined in IEEE 802.11[1] specifications

Given parameters in the spec:
N=64; %FFT size or total number of subcarriers (used + unused) 64
Nsd = 48; %Number of data subcarriers 48
Nsp = 4 ; %Number of pilot subcarriers 4
ofdmBW = 20 * 10^6 ; % OFDM bandwidth

Derived Parameters:
deltaF = ofdmBW/N; % Bandwidth for each subcarrier – include all used and unused subcarries
Tfft = 1/deltaF; % IFFT or FFT period = 3.2us
Tgi = Tfft/4; % Guard interval duration – duration of cyclic prefix – 1/4th portion of OFDM symbols
Tsignal = Tgi+Tfft; % Total duration of BPSK-OFDM symbol = Guard time + FFT period
Ncp = N*Tgi/Tfft; %Number of symbols allocated to cyclic prefix
Nst = Nsd + Nsp; % Number of total used subcarriers
nBitsPerSym=Nst; %For BPSK the number of Bits per Symbol is same as number of subcarriers

We will use the following model for simulating the OFDM system.

An OFDM communication Architecture with Cyclic Prefix
An OFDM communication Architecture with Cyclic Prefix

The channel in this case is modeled as a simple AWGN channel. Since the channel is considered to be an AWGN channel, there is no need for the frequency domain equalizer in the OFDM receiver ( Frequency domain equalizer will be helpful only if the channel introduces multipath fading). Since our channel is an AWGN channel, the frequency domain equalizer block in the above diagram can be removed.

Calculating Es/N0 or Eb/N0 for OFDM system:

In order to do a Monte Carlo simulation of an OFDM system, required amount of channel noise has to be generated that is representative of required Eb/N0. In Matlab it is easier to generate a Gaussian noise with zero mean and unit variance. The generated zero-mean-unit-variance noise has to be scaled accordingly to represent the required Eb/N0 or Es/N0. If we have Es/N0, the required noise can be generated from zero-mean-unit-variance-noise by,

$$ required\;noise = 10^{-\frac{E_s}{N_0} \frac{1}{20}} \times noise$$

Since the OFDM system transmits and received the data in symbols, it is appropriate/easier to generate required noise based on Es/N0 instead of Eb/N0 (as given above). But we are interested in plotting BER against Eb/N0. Ok!!! Then… how do we convert given Eb/N0 to Es/N0 for an OFDM system ?

Normally for a simple BPSK system, bit energy and symbol energy are same. So Eb/N0 and Es/N0 are same for a BPSK system. But for a OFDM BPSK system, they are not the same. This is because, each OFDM symbol contains additional overhead in both time domain and frequency domain. In the time domain, the cyclic prefix is an additional overhead added to each OFDM symbol that is being transmitted. In the frequency domain, not all the subcarriers are utilized for transmitted the actual data bits, rather a few subcarriers are unused and are reserved as guard bands.

Effect of Cyclic Prefix on Es/N0:

The following diagram illustrates the concept of cyclic prefix. Each OFDM symbol contains both useful data and overhead (in the form of cyclic prefix). The bit energy represents the energy contained in the useful bits. In this case, the bit energy is spread over N bits (where N is the FFT size). On top of the useful data, additional Ncp bits are added as cyclic prefix, which forms the overhead. So if the entire OFDM symbol is considered, the symbol energy is spread across N+Ncp bits.

This relationship is given as

$$ Es(N+N_{cp})=NE_{b}$$

which translates to,

$$ E_{s}=\frac{N}{N+N_{cp}}E_{b} \;\;\;\;\;\;\;\; (1)$$

Effect of unused subcarriers on Es/N0:

As mentioned earlier, not all the subcarriers are used for transmission. Out of the total N subcarriers, only Nst carriers are used for OFDM symbols transmission (this includes both data and pilot subcarriers). Again, in the frequency domain, the useful bit energy is spread across Nst subcarriers, whereas the symbol energy is spread across N subcarriers. This gives us another relationship between Es and Eb as given below

$$ E_{s}\times {N}=N_{st}\times E_{b}$$

which translates to,

$$ E_{s}=\frac{N_{st}}{N}\times E_{b} \;\;\;\;\;\;\;\;(2)$$

From (1) and (2), the overall effect of both cyclic prefix and unused subcarriers on Es/N0 is given by

$$ \frac{E_{s}}{N_{0}}=\left ( \frac{N}{N_{cp}+N} \right )\left ( \frac{N_{st}}{N} \right )\frac{E_{b}}{N_{0}} \;\;\;\;\;\;\;\;(3)$$

which, when converted to dB yields the following relationship.

$$ \left (\frac{E_{s}}{N_{0}}\right ){dB}=\left ( \frac{N}{N{cp}+N} \right ){dB}+\left ( \frac{N{st}}{N} \right ){dB}+\left( \frac{E{b}}{N_{0}}\right)_{dB} \;\;\;\;\;\;\;\;(4) $$

Since Ncp cylic prefix are added to the OFDM symbol, the output signal from the parallel to serial converter has to be boosted to compensate for the wastage of energy associated with the addition of cyclic prefix. To properly generate the required SNR in Matlab, the signal term at the output of the parallel to serial converter has to be scaled as follows

$$ Boosted\;OFDM\;signal = \sqrt{\frac{N_{cp}+N}{N}}\times OFDM\;signal $$

The received signal is represented as (for the given Eb/N0)

$$ y = boosted \; OFDM \; signal + required \; noise $$

Arrangement of subcarriers:

The IEEE 802.11 specification, specifies how to arrange the given subcarriers. The 52 used subcarriers (data + pilot) are assigned numbers from -26,-25,…-2,,-1 and 1,2,…,25,26. The following figure illustrates the scheme of assigning these subcarriers to the IFFT inputs.

Assignment of OFDM Subcarriers
Assignment of OFDM Subcarriers


Check this book for full Matlab code.
Simulation of Digital Communication Systems Using Matlab – by Mathuranathan Viswanathan

Simulated Result:

From the simulated result, it can be ascertained that the OFDM- BPSK modulation has no advantage over a normal BPSK system in AWGN. OFDM proves to be effective in multipath environments.

Eb/N0 Vs BER for BPSK-OFDM over AWGN
Eb/N0 Vs BER for BPSK-OFDM over AWGN


[1] IEEE 802.11 specification – “Orthogonal frequency division multiplexing (OFDM) PHY specification for the 5 GHz band” – chapter 17

Books on OFDM

More Recommended Books at our Integrated Book Store

See Also:

(1) Introduction to OFDM – Orthogonal Frequency Division Multiplexing
(2) An OFDM Communication System – Implementation Details
(3) Role of Cyclic Prefix in OFDM

  • naga raja

    hello sir ,i bought your book from amazon kindle ….i found code for ofdm over awgn channel bt pls help me for ofdm over rician fading channel

    • Abdulbagi Elsanousi

      hello naga raja if u get could you could u send it to me i’m also looking for it

  • Ibar Osman Ibrahim

    Hi sir iam doing ofdm system in the channel modeling instead of AWGN i want to use rayleigh channel but my code isn’t complete can you help me plz


    Hello sir.!
    Recently I’ve been working with OFDM and doing my research on Index Modulation using OFDM.

    Can you help me with the block that generates index bits and data bits separately and use them for OFDM?

  • namch

    Hi Sir,
    In your book:
    in OFDM transmitter: x_Time=N/sqrt(Nst)*ifft(X_Freq);
    and receiver: r_Time=sqrt(Nst)/N*(fft(r_Parallel));

    Could you explain what is “N/sqrt(Nst)” for? Is it for scaling and must do?
    Thank you for your time.

  • sakshama ghoslya

    Hello Sir,

    > Your final expression for transmitted signal power management “Boosted OFDM signal” is bit confusing for me. As we are just repeating some symbols for cyclic prefix, so CP and DMRS signals must not come in the expression.
    > Your final expression doesn’t contain extra bits due to IFFT block. We zero pad in IFFT inputs so it must effect the power of transmitted signal and simulated BER.
    For example: If we have 100 PRBs (= 1200 resource elements in frequency domain) and IFFT size is 2048. then the boosting factor must me “sqrt(2048/1200)”.
    **Why the CP and DMRS will effect the BER? Please clear this point**
    > Let suppose there are total 9792 (for 68 PRBs and 1 subframe = 68*12*12) modulated symbols. These symbols are mapped to 100 PRBs in uplink and DMRS signals are inserted in 2 columns. Now, the total symbols will be 100*12*14 = 16800 (1200 rows with 384 rows zero padded and 14 columns). For IFFT size 2048 this 1200*14 matrix is converted into 2048*14 (= 28672) size matrix with zero padding and then CP is inserted in each column. and according to 3gpp standard total 160*2 + 144*12 (= 2048) symbols inserted and total 30720 bits transmitted. Here we are zero padding two times and DMRS signals are also inserted. How will you solve this problem to get better BER in matlab simulation? Your above explanation doesn’t explain anything in detail.