File Exchange

image thumbnail

BER of OFDM in rayleigh enviroment using BPSK modulation

version 1.0 (2.07 KB) by

script utilizing communication toolbox functions.

6 Ratings



View License

the results i.e theoretical and simulated are in good agreement with each other...communication toolbox is very handy

Comments and Ratings (14)

Anil Karatay

kawtar barri


Ray (view profile)

M=modem.pskmod(2) is a bpsk modulation funciton. It takes the data generated by the random function and maps it to -1 and 1.

What is M = modem.pskmod(2); % modulation object
it is giving me error.
How can i solve this error to run the code?


Bruno n1ng

Hi Mohammad,

When simulating 16-QAM, there is an error:

??? Subscript indices must either be real positive integers or

Error in ==> BER_OFDM_RAYLEIGH at 32
pilot_ins_data=[zeros(nsym,6) par_data(:,[1:nbitpersym/16])
zeros(nsym,1) par_data(:,[nbitpersym/16+1:nbitpersym])
zeros(nsym,5)] ;

How may this be resolved?


what is the purpose of the pilot insertion?


Kei (view profile)

Your code specifies sample time is 1/10000 in rayleighchan. However, I think the sample time of the code is 1/80. Is my understanding wrong?

> h=rayleighchan(1/10000,10);


what are the terms: 10log10(52/64) and 10log10(64/80) and the minus term in the snr definition?


Mohammad Tahir

Mohammad Tahir (view profile)

Because we have assumed ideal channel estimation in this case and the improvement of OFDM over BPSK rayleigh will be seen when we have imperfect channel equalization of frequency selective channel which cause ISI at the receiver. (please ignore the first one due to typo)

Luís Miguel

Why OFDM RAYLEIGH is equal to the BPSK RAYLEIGH , should not it be better?

please help me

Imran Ali

Hope this answer is not too late.
The modulation object in the program uses modem.pskmod (see line 15 in program). You need to change it modem.qammod, if you want to carry out M-QAM simulation with this program.

Huy Nguyen

Hi Mohammad,

Thanks alot for your code.

I'm trying to simulate for BER of OFDM in rayleigh fading using BPSK and M-QAM. It's working fine with AWGN. When I applied the rayleigh function as your code, its working only with BPSK and QPSK....not for other M-QAM.

Please give me an idea!

Many thanks.

MATLAB Release
MATLAB 7.9 (R2009b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video