1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)
Print Print



Thanks for comment and hoping that you liked the article. I will look into your comment and expect to respond with in two/three days if there is a query.

Further, you may join the email subscription (to get new articles delivered to your inbox).

Note: Joining the email subscription list entitles you to receive the free e-Book on Probability of Error for BPSK/QPSK/16QAM/16PSK/64QAM in AWGN.

Subscribe and download the free e-Book

Alternatively, you may subscribe to the RSS feed by clicking here.


Symbol and Bit error rate computation for various modulation scheme in AWGN

  1. Bit error rate for BPSK
  2. Bit error rate for FSK (frequency shift keying)
  3. Bit error rate for differential binary phase shift keying (DBPSK)
  4. Symbol error rate for 4-PAM
  5. Symbol error rate for QPSK
  6. Symbol error rate for 16-QAM
  7. Symbol error rate for 16-PSK
  8. Comparing symbol error rate for 16QAM and 16PSK modulation

Orthogonal signals

  1. Minimum frequency spacing for having orthogonal sinusoidals
  2. OFDM transmission
  3. Cyclic prefix in orthogonal frequency division multiplexing
  4. Peak to average power ratio in OFDM signalling

Receiver synchronization

  1. Frequency offset estimation using 802.11a short preamble
  2. First order PLL for tracking constant phase offset


  1. Cascaded Integrator Comb (CIC) filter
  2. Digital implementation of RC low pass filter
  3. Transmit pulse shaping filter

Hardware efficient signal processing circuits

  1. Polyphase filters for interpolation
  2. Using CORDIC for phase rotation
  3. Using CORDIC for phase and magnitude computation


  1. Straight line fit using Least Squares (LS) estimate
  2. Interpreting the output of FFT()


  1. MIMO with Zero Forcing equalizer
  2. MIMO with MMSE equalizer
  3. MIMO with ZF Successive Interference Cancellation equalizer
  4. MIMO with ML equalization
  5. MIMO with MMSE SIC and optimal ordering

Hope you like the blog.

D id you like this article? Make sure that you do not miss a new article by subscribing to RSS feed OR subscribing to e-mail newsletter. Note: Subscribing via e-mail entitles you to download the free e-Book on BER of BPSK/QPSK/16QAM/16PSK in AWGN.

{ 130 comments… read them below or add one }

Bhavani January 7, 2015 at 12:25 pm

Hello sir,
can u please provide the matlab code for MIMO-OFDM with cyclic delay diversty using QAM


Harshini January 7, 2015 at 12:19 pm

Hi sir,
I am looking for the matlab code in transmit diversity for spatial modulation in MIMO
can you please provide me the code….


anju December 15, 2014 at 9:29 pm

please give me the code for wavelet ofdm..its urgent


dddannyy July 13, 2014 at 5:22 pm

hey friends give good dsp sites notes………………………


jigs May 24, 2014 at 11:03 am

can u give me matlab code for comparision of outage capacity for M-QAM – OFDM where M = 64,128,256,512…
or any similar code which can help me in simulation..


akash May 19, 2014 at 2:44 pm

I need stbc ofdm codes. Its urgent. Can anyone help me with this


semih April 7, 2014 at 3:19 pm

hi could you please send me a matlab code for nakagami channel fading matlab code


priya April 3, 2014 at 11:45 pm

i need matlab code for sis0-ofdm


Rohit May 3, 2014 at 5:18 pm

Hi Priya,
I am also doing project on MIMO OFDM (IIT Kharagpur).
Below is the code which I wrote for SISO OFDM .

close all;
clear all;

Fs = 8000;
nFFT = 64; % fft size
nDSC = 52; % number of data subcarriers
nBitData = nDSC*6; % number of bits of data to be transmitted
M = 64; % Modulation Type – Here 64 for 64-QAM
nSym = ceil(nBitData/6); % number of symbols
nBlock = nSym/nDSC;
n_pos = 0:63;
n_plot = -32:1:31;

% modulation
% k = sqrt(1/((2/3)*(M-1))); % normalizing factor ??????????????????????????
m = 1:sqrt(M)/2; % alphabets
alphaMqam = [-(2*m-1) 2*m-1];

% Transmitter
for i = 1:1:nBlock

% Modulation

iMod = randsrc(1,nDSC,alphaMqam) + 1i*randsrc(1,nDSC,alphaMqam);

% Assigning modulated symbols to subcarriers from [-26 to -1, +1 to +26]

Xf = [zeros(1) iMod(:,1:nDSC/2) zeros(1,11) iMod(:,((nDSC/2)+1):nDSC) ] ;
Xfnew = [zeros(1) zeros(1,5) iMod(:,1:nDSC/2) iMod(:,((nDSC/2)+1):nDSC) zeros(1,6)] ;
Xf_temp = [Xf fliplr(Xf)];
Xfnew_temp = [Xfnew fliplr(Xfnew)];
title(‘Original Input Signal Type 1 – Frequency Domain’);
title(‘Original Input Signal Type 2 – Frequency Domain’);

% Converting Input Signal In Time Domain
% Taking IFFT, the term (nFFT/sqrt(nDSC)) is for normalizing the power of transmit symbol to 1

xt = ifft(Xf_temp,nFFT);
xtnew = ifft(Xfnew_temp,nFFT);
title(‘Original Input Signal Type 1 – Time Domain’);
title(‘Original Input Signal Type 2 – Time Domain’);

% Proakis filter
h = [0.407 0.815 0.407]; %Time Domain Coefficients Of Proakis FIlter
yt = conv(xt,h);
ytnew = conv(xtnew,h);
% figure(3);
% subplot(2,1,1);
% plot(0:65,abs(yt));
% subplot(2,1,2);
% plot(0:65,abs(ytnew));
Yf = fft(yt,64);
Yfnew = (fft(ytnew,64));
title(‘Proakis B Filter Output – Signal Type 1′);
title(‘Proakis B Filter Output – Signal Type 2′);

% % New Filter
% H1 = [(0.206 + 0.19i) (-0.281 -0.203i) (-0.1191 +0.36798i) (0.37 +0.0751i) (0.2895 +0.1981i) (-0.06665 - 0.30909i) (0.1796 - 0.049i) (0.04479 + 0.09596i) ];
% H = resample(H1,8,1);
% Yf_new = Xf.*H;
% Yfnew_new = Xfnew.*H;
% figure(4);
% subplot(2,1,1);
% stem(n*Fs/64,abs(Yf_new));
% title(‘New Filter – Signal Type 1′);
% subplot(2,1,2);
% stem(n*Fs/64,abs(Yfnew_new));
% title(‘New Filter – Signal Type 2′);
% Filter 1 – Lowpass

Fpass = 2500; % Passband Frequency
Fstop = 3000; % Stopband Frequency
Apass = 1; % Passband Ripple (dB)
Astop = 60; % Stopband Attenuation (dB)
Fs_fil = 20000; % Sampling Frequency
h = fdesign.lowpass(‘fp,fst,ap,ast’, Fpass, Fstop, Apass, Astop, Fs_fil);
Hd = design(h, ‘ifir’);

Yf_new = filter(Hd,xt);
Yfnew_new = filter(Hd,xtnew);
title(‘Filter 1 – Lowpass – Signal Type 1′);
title(‘Filter 1 – Lowpass – Signal Type 2′);
% % k = 1/2;
% % a = 4;
% % f = -.16:1/100:.15;
% % Hftemp = k*exp(a*abs(f));
% % Hff = [ones(1,16) Hftemp(:,1:32) ones(1,16)];
% % n = -32:1:31;
% % figure();
% % plot(n,Hff);
% % Yff = Xf .* Hff;
% % Yffnew = Xfnew .* Hff;
% % figure();
% % subplot(2,1,1);
% % stem(-32:1:31,abs(Yff));
% % subplot(2,1,2);
% % stem(-32:1:31,abs(Yffnew));
% % % d = fdesign.highpass(‘N,Fc’,10,9600,48000);
% % % designmethods(d);
% % % Hd = design(d);
% % % % fvtool(Hd);
% % % ytHdnew = filter(Hd,xt);
% % % YfHdnew = fftshift(fft(ytHdnew));
% % % figure();
% % % stem(-32:1:31,abs(YfHdnew));
% %
% % %
% % % % Appending cylic prefix
% % % xt = [xt(:,[49:64]) xt];
% % %
% % % % Concatenating multiple symbols to form a long vector
% % % xt = reshape(xt.’,1,nOFDMsym*80);
% %
% % % Gaussian noise of unit variance, 0 mean
% % % nt = 1/sqrt(2)*[randn(1,nOFDMsym*80) + j*randn(1,nOFDMsym*80)];
% %
% % % Adding noise, the term sqrt(80/64) is to account for the wasted energy due to cyclic prefix
% % % yt = sqrt(80/64)*xt + 10^(-EsN0dB_eff(ii)/20)*nt;
% %
% % % Receiver
% % % yt = reshape(yt.’,80,nOFDMsym).’; % formatting the received vector into symbols
% % % yt = yt(:,[17:80]); % removing cyclic prefix
% %
% % % converting to frequency domain
% % % yF = (sqrt(nDSC)/nFFT)*fftshift(fft(yt.’)).’;
% % % yMod = sqrt(64/80)*yF(:,[6+[1:nConstperOFDMsym/2] 7+[nConstperOFDMsym/2+1:nConstperOFDMsym] ]);
nSym = nSym-52;
% % iMod = randsrc(1,nSym,alphaMqam) + 1i*randsrc(1,nSym,alphaMqam);
% % Xf = [zeros(1,6) zeros(1,floor(nDSC/2-nSym/2)) iMod(:,1:ceil(nSym/2)) zeros(1,1) iMod((ceil(nSym/2)+1):nSym) zeros(1,ceil(nDSC/2-nSym/2)) zeros(1,5)] ;
% % figure();
% % stem(-32:1:31,Xf);


ROSU May 10, 2014 at 12:12 am

hi Rohit,

Do you have codes for MIMO-OFDM with Rayleigh channel. I need ML equalization for MIMO-OFDM systems. Krishna has explained ML equalization for MIMO-OFDM systems. But I couldn’t make it for MIMO-OFDM systems. Can you help. Please,Its urgent


preeti January 25, 2015 at 11:47 pm

my project is MIMO OFDM with semi blind equalization technique. I have worked on MIMO OFDM till now but the code is neither working nor giving ay warning and error. can you please send the he code. my email d is sondhipreeti13@gmail.com


jyothi July 21, 2013 at 3:31 pm

plzzzzzzzzzzzzzz help me in finding alamouti matlab code for 2×1,2×2 and 2×3


Krishna Sankar July 22, 2013 at 3:52 am

@jyothi: please checkout http://www.dsplog.com/tag/alamouti/


Kevin June 29, 2013 at 5:23 pm

Hi –

Nice site. Very useful. Can I ask what blogging software you’re using? Is it a wordpress theme?


Krishna Sankar June 30, 2013 at 6:24 am

@Kevin: Thanks. Yes, wordpress.


ravi teja April 30, 2013 at 2:53 am

I subscribed but unable to download the e-book.can u give the instructions


Krishna Sankar April 30, 2013 at 6:19 am

@ravi teja: emailed


Manoj March 7, 2013 at 11:07 am

i need matlab code for BFSK in rayleigh channel


Krishna Sankar March 10, 2013 at 12:54 am

@Manoj: The post at http://www.dsplog.com/2007/08/30/bit-error-rate-for-frequency-shift-keying-with-coherent-demodulation/
describes fsk in awgn case. Should be straightforward to extend to rayleigh channel cases.


Manoj March 7, 2013 at 11:02 am

i need matlab code to calculate bit error rate for BFSK in rayleigh channel


Krishna Sankar March 13, 2013 at 6:26 am

@Manoj: Please check out the following post for FSK in AWGN.
Hopefully easy to adapt to rayleigh channel case


Harsha January 23, 2013 at 11:25 pm

Could you mail me the instructions to download the e-book. I have subscribed but am unable to download it. Thanks


Krishna Sankar January 24, 2013 at 5:18 am

@Harsha: emailed the instructions


Nirupa January 22, 2013 at 7:48 pm

hi all
I need matlab code for siso channel capacity
Capacity of siso channel(bps/Hz) vs. Average snr(dB)


Krishna Sankar January 23, 2013 at 5:33 am
venkata sravani December 17, 2012 at 1:10 am

thank you for your explanation about CIC


mrKim November 13, 2012 at 8:19 am

Help me


vsang November 12, 2012 at 10:07 pm

Sr , I’m need base code for SPACE DIVISION MULTIPLE ACCESS-SDMA. Can you give that code or any document relate .thanks


Krishna Sankar November 18, 2012 at 7:09 am

@vsang: For topics on multiple transmit and receive antenna scenarios, please refer http://www.dsplog.com/category/mimo/


shona October 2, 2012 at 8:56 pm

hello sir….
i need your help regarding my project…
i need a matlab code for video transmision as soon as possible…
thnxzzz in advance…..


Krishna Sankar October 5, 2012 at 5:04 am

@shona: Are you modeling the physical layer or some higher layers like MAC too.


Manit August 6, 2012 at 6:15 pm

Hi Krishna,

I would like to say thanks first of all as you are helping us and I fully appreciate your work.
Now I am doing project on ::4×4 MIMO simulation
This is the detail::::
Multiple input multiple output (MIMO) is very promising for future high data rate mobile communications. In LTE, 4×4 MIMO (four antennas in the transmitter and four antennas in the receiver) have been adopted. In this project, the student is required to implement 4×4 MIMO encoding and decoding by using the specifications in LTE. Simulink is a suggested tool.

Can you please help me for code (In simulink) and also any books which I can refer????


Krishna Sankar August 9, 2012 at 5:59 am

@Manit: For some unit level simulation with 2×2 MIMO case, please refer to the posts in


Manit August 19, 2012 at 4:15 am

Thnks for your reply. But could please tell me regarding encoding and decoding in simulink.

Thank you


Krishna Sankar August 29, 2012 at 5:36 am

@Manit: I have not tried Simulink.


norseen noree July 27, 2012 at 4:32 pm

Hello sir,


Krishna Sankar August 1, 2012 at 6:16 am

@norseen: Please check
16QAM Bit Error Rate (BER) with Gray mapping


Aisha June 4, 2012 at 7:14 pm

I hope you reply me as soon as possible


basha Dirbush May 10, 2012 at 6:14 pm

could you please send me a matlab code for mimo capacity vs SNR for unknown channel


Krishna Sankar May 15, 2012 at 5:57 am
ofir michael April 17, 2012 at 4:00 pm

K=SQRT(1/(2/3M-1)) is a mistake.

it needs to be: K=SQRT(1/(2/3*(M-1)))


sailaja March 27, 2012 at 7:50 pm

sir……..i am doing prjct on ofdm.. plz give me a matlab code for papr of 16qam…….


Krishna Sankar March 29, 2012 at 5:30 am

@sailaja: I have not discussed PAPR for 16QAM explicitly, but the post http://www.dsplog.com/tag/papr/ might be of help


akis March 26, 2012 at 12:38 pm

hi do you have any matlab code that calculates the outage probability for two way relay channel for two,three, four time slot schemes?


Krishna Sankar March 30, 2012 at 6:22 am

@akis: sorry, no


mrKim November 13, 2012 at 8:25 am

Dear Akis

Do you have any matlab code about calculates the outage probability for two way relay , BER , power for Multihop ….? Please share me. Thank you
my email: nguyenkimhieuha@gmail.com

Thank you


mrKim November 13, 2012 at 8:40 am

Dear Akis
I am also worikng on multi-hop relay network. I am new in this area and need some help from you. if you can give meur email address please. my email nguyenkimhieuha@gmail.com

i’ll wait for ur reply,plz contzct me on my email.


imen March 13, 2012 at 10:47 pm

hi sir
please help me to find code for simulation of power line communication plc with OFDM modulation
please please


Krishna Sankar March 21, 2012 at 5:10 am

@imen: Sorry, I have not studied power line communication


Rabi March 5, 2012 at 4:43 pm

Any codes in Spatial multiplexing? or MIMO in LTE??


Krishna Sankar March 12, 2012 at 4:58 am

@Rabi: Please take a look at http://www.dsplog.com/tag/mimo


vijay February 27, 2012 at 1:36 pm

hi ,
can u give me the matlab code for pc-cfr technique in ofdm


Krishna Sankar March 5, 2012 at 5:42 am

@vijay: what is pc-cfr?


vanita February 27, 2012 at 1:34 pm

hi sir,
i qm working on pc-cfr technique, can you assist me with the relevent matlab code


Krishna Sankar March 5, 2012 at 5:42 am

@vanita: what is pc-cfr?


ammar February 5, 2012 at 1:38 pm

thank you Krishna for your above reply,

first of all ,, i am a master student ,, and my search ” enhancement study of CDMA celluar system by introducing OFDM technology”

so i am trying to do CDMA system then i add OFDM part to the code

and i did the most work of what i said above,

but i have some question

i change the rayleigh channel that i used by this :


which is familiar with the channel that you are use in your programs.

my questions is :

1) how much the bitrate that your are sent? and how can i insert the
effect of bitrate with this channel to my program?

2) generally , the effect of bitrate can only add on channel part of the matlab code?

3) for OFDM-CDMA system the equlizer that i used namly ”least square” which is simply divide in frequency domain the received signal by FFT(channal impulse response) , and the place of this divide after the FFT part of receiver, but in CDMA reeceiver >> where will be put?
when i put it in the begging of receiver (of course i take FFT for the received signal and for channel impulse response then divided the received signal by channel frequency response in frequency domain) then i take IFFT for the resualt to back to time domain and complete my despreading and demapping.
the probem is : i got a very good resualt .. almost the effect of channel are completly removed ….. i got BER = 1e-5 at -5 dB…… ?

finally thank you for this very helpfull site ,, thank you for your replies


Krishna Sankar February 10, 2012 at 5:49 am

@ammar: My replies:
1. Bit rate is a notional concept in Matlab. If the samples are spaced T s seconds apart, then sampling rate is 1/T Hz…
2. Did not understand the question
3. How does the OFDM-CDMA transmit chain look like?


varma February 28, 2012 at 9:59 pm

can u please explain me about bit error probability code of 8 PAM and 16PAM?


Krishna Sankar March 5, 2012 at 5:28 am

@varma: I have discussed 4-PAM in the past.
Hope that helps?


ammar January 26, 2012 at 7:13 pm

Hello. Thanks for your posts

i just want to ask you if you deal with matlab function named”rayleighchan”?

its great

but i have some question on it


Krishna Sankar January 29, 2012 at 5:51 am

@ammar: Sorry, i do not ‘deal’ with rayleighchan


Gayathri January 6, 2012 at 11:49 am

hello sir ,
pls help me with me , with a code for MIMO with MMSE equaliser in QAM-16 modulation technique


Krishna Sankar January 7, 2012 at 6:14 am

@Gayathri: Sorry, I do not have the exact matlab code handy. But I can point you to
a) MIMO with MMSE equalizer – BPSK 2×2 in Rayleigh channel

b) 16QAM in AWGN over OFDM

Hope both helps to get you what you need.


Ari Endang Jayati January 2, 2012 at 9:39 am

Hello. Thanks for your posts.
I have a question.

When I simulated 2by2 MIMO system, the 4PAM-ZF system has same SER of 4PAM-MMSE system.
(Rayleigh ch./AWGN noise/BER vs SNR
But, there is a little difference
So, I am very confusing.

Please answer my question


Krishna Sankar January 3, 2012 at 4:37 am

@Ari: When you try to reduce the modulation from 4PAM to 2PAM (BPSK), are you seeing differences in the MMSE behaviour vs ZF behaviour. Further, in AWGN the difference might not be present, as there is no interference terms.
Do reply back with your findings.


jinumadhavan November 22, 2011 at 2:04 pm

Nice Article,i Appriciate u=r Knowledge


shu May 17, 2011 at 11:39 pm

hi krishna sir

I saw ur example of ber -bpsk-rayleigh channel but i need the the qpsk for the rician channel I dont know coding sir so please help me sir give some hints where to change thats enough for me sir .please sir


Krishna Sankar May 23, 2011 at 2:46 am

@shu: My replies:
1/ For QPSK, send data on I channel as well as Q channel
2/ I have not discussed Rician channel model


Usman April 20, 2011 at 12:33 pm

plz send me the book…


Krishna Sankar May 24, 2011 at 5:39 am

@usman: Have you subscribed to email newsletter from dsplog.com.
If not, please click here to subscribe.

Once you have subscribed, you should have received a confirmation email. Please reply to that
email and you will receive email instructions on how to download the eBook.


Willie February 11, 2011 at 11:15 pm

How do I get access to the download site for the e-book?


Krishna Sankar May 26, 2011 at 6:00 am

@Willie: Emailed you the download instructions


avdhut August 26, 2010 at 9:07 pm

will u plz giv me code for gmsk….



Krishna Sankar September 1, 2010 at 7:03 am
AHMED October 23, 2010 at 6:33 am

How can i cacluate the SNR between two nodes A and B if they used BPSK


Krishna Sankar November 18, 2010 at 5:23 am

@Ahmed: Sorry, the question is not clear


gul March 29, 2010 at 10:54 am

hello krishna,

i m making code for PTS scheme for PAPR reduction. i m facing some problems in that……
1. how to implement oversampling in ofdm?
2. how do we calculate CCDF for PAPR calculation?

thanx in advance.


Krishna Sankar March 30, 2010 at 4:19 am

@gul: My replies
1/ For oversampling by a factor of 2 insert 1 zero inbetween samples; for oversampling by factor of 3 insert 2 zeros inbetween samples; and so on. Note: Oversampling need to be followed by filtering
2/ Take the histogram of the time domain samples to find the PDF. Use cumsum to find the CDF. Then 1- CDF gives CCDF. In the post on PAPR in OFDM, I have plotted the CDF of the time domain waveform http://www.dsplog.com/2008/02/24/peak-to-average-power-ratio-for-ofdm/


ben April 13, 2010 at 8:22 pm


I have a question about plotting BER vs SNR in MIMO systems. Lets say i have a 2×2 MIMO system, and i perform an SVD on the channel, so i can encode and decode the signal with V and U, respectively, such that i am left with 2 uncoupled SISO channels. now each channel has its own singular value, and let us assume for now that the noise power is the same in both channels. So we have SNR1 in the first channel, and SNR2 in the second channel, and they are different.
Q1: How would you define the SNR of this system? is it the average SNR of both channels?

Now we now that according to the Water Filling algorithm, we can transmit more power (and thus, more bits) in channels with higher SNR. so if come to conclusion that the first channel can carry QPSK, and the second channel can only carry BPSK, i have different contelations in both channels… So the SNR which were calculated earlier for each channel, should now be modified in order to reflect the number of bits which are transmitted via those channels, by: SNR_bit=SNR_sym/k, where k=log_2(M).

Q2: How should plot 1 graph which describes the BER vs. SNR_bit of this system? Should i calculate SNR_bit for each SISO channel, and BER for each SISO channels separately, and the average the results?



Krishna Sankar April 14, 2010 at 4:56 am

@ben: My replies
1.a) As I recall, when we are multiplying by V, we are not introducing any gain in the transmitter. In that case, signal power at the transmitter remains the same irrespective of multiplication by V. Agree?
Having said that reporting SNR information from both the streams and average SNR is useful. I believe most MIMO test instruments report both
1.b) The signal to noise ratio is independent of the constellation used. If you want to compare using Eb/N0, then yes, need to factor in the constellation
2) Hmm…. you can defined Es/N0 = ratio of total power at tx / total noise power at rx. Then depending on the number of bits which are pumpre through, Es/N0_dB = Eb/N0_dB + 10*log10(number of bits per symbol across all tx chains)

Agree? Your thoughts please.


uma March 16, 2010 at 10:37 pm

hello sir..
how to downsample received UWB signal ???kindly help us with matlab code sir


Krishna Sankar March 28, 2010 at 2:28 pm

@Uma: Sorry, I have not tried modeling UWB signals


venkat March 13, 2010 at 5:51 pm

Hello Krishna,
I have referred your example on first order PLL for constant phase tracking.It was very useful.
But in the example a complex carrier is being used at the transmitter and receiver.Practically , when I use a cosine carrier at Tx. and cosine,sine carriers at Rx.(as in costas loop) , can the same loop filter be used ?
I have tried to simulate the above situation in the following script but was unable to estimate the phase. Please help me……….


clear all;
close all;

[b,a] = butter(1,0.0156,’low’); % low pass filter to remove
nterm_i = 0; % double frequency component
dterm_i = 0;
nterm_q = 0;
dterm_q = 0;

n_sym = 10; % number of symbols
fs = 12.8e6;
t = 0:1/fs:100e-6 – 1/fs;
fc = fs/8; % carrier freuency
theta = 70*pi/180; % phase offset
r = 0.1e6; % symbol rate
oversamp = fs/r;
sym = randint(n_sym,1)*2-1;
in = 0;
for ind=1:1:n_sym
tmp(1:oversamp) = sym(ind);
in = [in tmp];
tx = in(2:end);
tx_carrier = cos(2*pi*fc*t + theta);

tx_out = tx.*tx_carrier;

% first order pll
alpha = 0.05;
phiHat = 0;

for ii = 1:1:length(t)

% Remove carrier
rx_i(ii) = tx_out(ii)*cos(2*pi*fc*t(ii) + phiHat);
rx_q(ii) = tx_out(ii)*sin(2*pi*fc*t(ii) + phiHat);

% low-pass IIR filter for I-channel
iir_in_i(ii) = rx_i(ii);
iir_out_i(ii) = b(1)*iir_in_i(ii)+ nterm_i + dterm_i;
nterm_i = b(2)*iir_in_i(ii);
dterm_i = a(2)*iir_out_i(ii);

% low-pass IIR filter for Q-channel
iir_in_q(ii) = rx_q(ii);
iir_out_q(ii) = b(1)*iir_in_q(ii)+ nterm_q + dterm_q;
nterm_q = b(2)*iir_in_q(ii);
dterm_q = a(2)*iir_out_q(ii);

% demodulating circuit
xHat = 2*(iir_out_i(ii)>0) -1 ; % symbol estimate
phiHatT =angle(conj(xHat)*rx_i(ii)); % phase error estimate angle(iir_out_i(ii) + i*iir_out_q(ii));%

% accumulation
phiHat = alpha*phiHatT + phiHat; % phase accumulator output
% dumping variables for plot
phiHatDump(ii) = phiHat;



Krishna Sankar March 28, 2010 at 3:42 pm

@venkat: Does the transmitted symbol has phase information?


taona March 3, 2010 at 1:09 pm

Help hw do i generate E/No curve for ASK modulation


Krishna Sankar March 30, 2010 at 4:35 am

@taona: I have discussed symbol error rate for 4-PAM case http://www.dsplog.com/2007/10/07/symbol-error-rate-for-pam/
Hope that serves as a good reference


Karthick February 25, 2010 at 4:36 pm

I need to compute 24 point dft using 8 point dft chips……. pls help!!!!!!


Krishna Sankar March 31, 2010 at 5:06 am

@Karthick: Did you try looking into the FFT equations?


Krishna Sankar March 31, 2010 at 5:09 am

@Karthick: Have you tried looking into the FFT equations?


deepak February 24, 2010 at 9:36 pm

hi krishna
i m new to matlab and i need to know tht ur code for ml equalisation uses viterbi algo aur something else,please tell i m not able to figure it out.



Krishna Sankar March 31, 2010 at 5:11 am

@deepak: which is the code which you are referring to?


manisha February 22, 2010 at 7:54 pm

i wan to know how can we find papr for 7 caiiers
suppose by block coding code is 1100110 then how to find papr


Krishna Sankar March 31, 2010 at 5:29 am

@manisha: Please look at the post http://www.dsplog.com/2008/02/24/peak-to-average-power-ratio-for-ofdm/. The article discuss the N carrier case, which you can adapt to 7 carrier case.


shah February 14, 2010 at 8:01 am

im new in matlab.
Hello Krishna, thanks for ur nice work on OFDM.
i want to design an OFDM simulator using matlab GUI so that we can easily to find out the BER vs SNR when i change any parameter on the modulation..
can u give me some idea which part i need to change mybe on the sampling freq or mybe on the no of sample..
and lastly from ur code which part i must to do so…please teach me…-shah-


Krishna Sankar April 4, 2010 at 3:58 am

@shah: Well, the concept of sampling is notional in Matlab


Ahmed February 12, 2010 at 7:05 pm

If the channel became Nakagami-m in OFDM system, how change the value of ht in program simulation of BER of multipath OFDM in Relaigh fading channel
Thank you


Krishna Sankar April 4, 2010 at 4:00 am

@Ahmed: Sorry, I have not tried to model Nakagami systems


surjeet January 31, 2010 at 10:49 pm

hw i will generate multipath channel coefficient in ofdma


Krishna Sankar April 4, 2010 at 4:35 am
kishore January 25, 2010 at 9:11 pm

hi krishna!
I need matlab code to obtain BER vs SNR curve for binary on-off keying modulation.
also, i need code for SER vs SNR curve for 3ASK modulation.


ZhangRui January 22, 2010 at 8:22 am

Can you demodulate the co-channel AIS signals(GMSK signals) and does there exists any methods to separete the co-channel AIS signals(GMSK signals) ?thanks very much


gul January 12, 2010 at 1:55 pm

i subscribed dsplog but i didn’t get BER e-book. i received the mail to download the book but its not working. Kindly send me.


Krishna Sankar January 25, 2010 at 5:19 am

@gul: I re-checked the download link, its working. I mailed the same to you again.


gul January 25, 2010 at 4:31 pm

thank you for the same.
i m doing a project on OFDM. i want to implement wavelet transform in place of FFT.can u suggest am i on right track or not?
is it little possible to do this.


Umashankar Dewangan January 4, 2010 at 9:56 pm

Hello sir,
i subscribed dsplog but i didn’t get ber e-book. i got mail to download book but its not working. its giving corrupted pdf. Kindly send me.


Krishna Sankar January 25, 2010 at 5:18 am

@Umashankar: I mailed you the download instructions. please check.


gurinder February 27, 2010 at 11:31 am

plz sir help me in providing matlab code for interleaver using rs using qam or any other modulation scheme in awgn . its urgent. plz help
thanks in advance


Krishna Sankar March 30, 2010 at 5:18 am

@gurinder: Sorry, I have not made any posts involving interleaver


rezgui January 2, 2010 at 10:09 pm

thanks a lot for the demonstration


gul December 31, 2009 at 2:28 pm

why u r not using the builtin functions for modulation,demodulation etc.


gul December 23, 2009 at 9:23 am

is there any book for digital communication and wireless/mobile communication using MATLAB?


gul December 22, 2009 at 4:46 pm

thank you for sharing such information.

i m doing a project on OFDM.can u please help me for the use of wavelet transform in OFDM.


Krishna Sankar December 23, 2009 at 5:54 am

@gul: Sorry, am not familiar with wavelet transform in OFDM


manisha February 22, 2010 at 7:52 pm

can u pls mail me matlab program for papr calculation
i hav prefferd iee paper of jones and wiliksons paper


Krishna Sankar March 31, 2010 at 5:30 am

@manisha: You can refer articles on PAPR at http://www.dsplog.com/tag/papr


rama krishna December 14, 2009 at 11:35 am

iam dioing simulation to find ber of bpsk modualtion for pass band case in awgn channel. i am using a carrier with some perticular frequency.


Krishna Sankar December 22, 2009 at 5:40 am

@rama: Please ask queries. I will try to answer to the best of my knowledge.


thilini December 10, 2009 at 6:49 pm

Plz it is urgent I need it today


SREENU November 18, 2009 at 11:05 am

please give me the suggestion to calculate throughput in WLAN OFDM systems


Krishna Sankar December 6, 2009 at 3:50 pm

@SREENU: I would recommend you to go over the paper
Throughput and Delay Limits of IEEE 802.11, Yang Xiao, Jon Rosdahl, IEEE COMMUNICATIONS LETTERS, VOL. 6, NO. 8, AUGUST 2002
Its available online and you should be able to find it by quick googling. Good luck.


manisha February 22, 2010 at 7:39 pm

sir i am able to do matlab program for papr calcaulation for 7 carriers


Krishna Sankar March 31, 2010 at 5:30 am

@manisha: Thats nice


SREENU November 18, 2010 at 10:11 am

thank you sir


Fritzou October 31, 2009 at 10:39 pm

sorry about the incomplete comment !!
I meant that the variance will be changed or not if I didn’t use a complex part ?


Selvi Rajan October 13, 2009 at 12:32 pm

Sir, while converting data into OFDM signal , it is observed that Subcarrier index is used. Inthis for standndard 802.11a , 64 subcarriers are used ,of which 52 is for data. The subcarrier index used is -26 to +26 . I want to know Why it is used so? Why 0 is not included in this.


Krishna Sankar October 15, 2009 at 5:25 am

@Selvi Rajan: Answer for one of the queries in http://www.dsplog.com/2009/10/07/quiz-ieee-80211a-specifications/ address this.
DC is not used because, there can be DC in the system due to RF impairments. Hence will corrupt the information send on DC subcarrier. The edge subcarriers are not used to allow the spectrum to roll-off.


vanitha August 31, 2009 at 12:42 pm

my question is how to demodulate the SSB-SCsignals.


sam July 30, 2009 at 2:30 pm

i need simulink’s (matlab) block for accunting BPSK BER


Krishna Sankar July 31, 2009 at 4:53 am

@sam: Sorry, I do not have Simulink.


gizaw June 4, 2014 at 1:09 am

hi krish, would u give me the following matlab codes? 2-psk 4-psk 8-psk 16-psk


Leave a Comment