(8 votes, average: 4.00 out of 5)

# Derivation of BPSK BER in Rayleigh channel

by on January 22, 2009

This is a guest post by Jose Antonio Urigüen who is an Electrical and Electronic Engineer currently studying an MSc in Communications and Signal Processing at Imperial College in London. This guest post has been created due to his own curiosity when reviewing some concepts of BER for BPSK in Rayleigh channnel published in the dsplog.com

From the post on BER for BPSK in Rayleigh channnel, it was shown that, in the presence of channel $h$, the effective bit energy to noise ratio is $\frac{|h|^2E_b}{N_0}$.

The bit error probability for a given value of $h$is,

$P_{b|h}=\frac{1}{2}erfc\left({\sqrt{\frac{|h|^2E_b}{N_0}}}\right)=\frac{1}{2}erfc\left(\sqrt{\gamma}\right)$, where

$\gamma = \frac{|h|^2E_b}{N_0}$ .

The resulting BER in a communications sytem in the presence of a channel $h$, for any random values of $|h|^2$, must be calculated evaluating the conditional probability density function $P_{b|h}$ over the probability density function of $\gamma$.

$P_{b}=\int_0^\infty\frac{1}{2}erfc\left(\sqrt{\gamma}\right)p\left(\gamma\right)d\gamma$ where,

the probability density function of $\gamma$ is

$p\left(\gamma\right) = \frac{1}{\bar{\gamma}}e^{\frac{-\gamma}{\bar{\gamma}}},\ \gamma \ge 0$ and $\bar{\gamma} = \frac{E_b}{N_0}$.

First, we are going to derive the result for the definite integral using a different notation, and then we will apply the result to the concrete expression obtained for the BER.

Using the definitions for the ‘erfc’ and ‘erf’ functions, we can directly compute the first derivative:

$erfc(x) = \frac{2}{\sqrt{\pi}}\int_x^{\infty}e^{-t^2}dt$

$erf(x) = \frac{2}{\sqrt{\pi}}\int_0^{x}e^{-t^2}dt$

$\frac{d}{dx}erf(x) = -\frac{2}{\sqrt{\pi}}e^{-x^2}$

And also the definite integral, simply calculating it by parts:

$\begin{eqnarray}\int erfc(x) dx & = & x erfc(x) + \int x \frac{2}{\sqrt{\pi}}e^{-x^2}dx \\
& = & x erfc(x) -\frac{1}{\sqrt{\pi}}e^{-x^2}\end{eqnarray}$

In the following steps we will use the next also straightforward results:

$\frac{d}{dx} erfc (\sqrt{x}) = -\frac{1}{\sqrt{\pi}}e^{-x}x^{-1/2}$

$\frac{d}{dx} erf (\sqrt{x}) = \frac{1}{\sqrt{\pi}}e^{-x}x^{-1/2}$

In total, we want to derive the following integral, which can be solved by parts:
$\int erfc(\sqrt{x})e^{-\frac{x}{a}}dx = -a erfc({\sqrt{x}})e^{-\frac{x}{a}} - \int (-a)e^{-\frac{x}{a}} (-)\frac{1}{\sqrt{\pi}}e^{-x}x^{-\frac{1}{2}}dx$

Lets find the last term applying the previous result for the ‘erf’ function, and doing a change of variable:

$\begin{eqnarray}\int e^{-\frac{x}{a}}e^{-x}x^{-\frac{1}{2}}dx & = & \int e ^{-x\left(\frac{a+1}{a}\right)}x^{-\frac{1}{2}}dx\\ & = & \int e^{-u} \left(\frac{a}{a+1}\right)^{-\frac{1}{2}}u^{-\frac{1}{2}}\left(\frac{a}{a+1}\right)du\\ & = & \left(\frac{a}{a+1}\right)^{\frac{1}{2}} \int e^{-u}u^{-\frac{1}{2}}du\\ & = & \sqrt{\pi}\sqrt{\frac{a}{a+1}} erf(\sqrt{u})\\&=&\sqrt{\pi}\sqrt{\frac{a}{a+1}} erf\left(\sqrt{\frac{a+1}{a}}\sqrt{x}\right)\end{eqnarray}$.

Finally, we conclude the expected result:
$\begin{eqnarray}\int erfc (\sqrt{x}) e^{-\frac{x}{a}}dx & = &-a erfc(\sqrt{x})e^{-\frac{x}{a}}-\frac{a}{\sqrt{\pi}}\sqrt{\pi}\sqrt{\frac{a}{a+1}}erf\left(\sqrt{\frac{a+1}{a}}\sqrt{x}\right)\\ & = & -a erfc(\sqrt{x})e^{-\frac{x}{a}}-{a}\sqrt{\frac{a}{a+1}}erf\left(\sqrt{\frac{a+1}{a}}\sqrt{x}\right) \end{eqnarray}$

With the above demonstration, we can easily derive the BER for a Rayleigh channel using BPSK modulation:

$\begin{eqnarray}P_{b} & = & \frac{1}{2\bar{\gamma}}\int_0^{\infty} erfc (\sqrt{\gamma}) e^{-\frac{\gamma}{\bar{\gamma}}}d\gamma \\ & = & \frac{1}{2\bar{\gamma}}\left[\bar{\gamma}erfc(\sqrt{\gamma})e^{-\frac{\gamma}{\bar{\gamma}}} + \bar{\gamma}\sqrt{\frac{\bar{\gamma}}{\bar{\gamma}+1}}erf\left(\sqrt{\frac{\bar{\gamma}}{\bar{\gamma}+1}}\sqrt{{\gamma}}\right) \right]_\infty^0\\ & = & \frac{1}{2} \lef(1-\sqrt{\frac{\bar{\gamma}}{\bar{\gamma}+1}}\right)\\ & = & \frac{1}{2} \lef(1-\sqrt{\frac{(E_b/N_0)}{(E_b/N_0)+1}}\right)\end{eqnarray}$.

This forms the proof for BER for BPSK modulation in Rayleigh channel.

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.

{ 49 comments… read them below or add one }

Shawn September 20, 2011 at 6:34 pm

Great work. Thank you very much.

moonriver August 25, 2010 at 8:21 pm

Hi sir… i am doing ofdm for my thesis. I want to ask if BER for flat fading Rayleigh channel is similar to Rayleigh flat fading with OFDM…?

Thank you

Krishna Sankar September 1, 2010 at 7:05 am

@moonriver: In the simulation on OFDM with Rayleigh channel http://www.dsplog.com/2008/08/26/ofdm-rayleigh-channel-ber-bpsk/, even though the channel is multi tap (and frequency selective), thanks to OFDM, each subcarrier experience flat fading

krishna June 11, 2010 at 6:28 pm

hi sir,

iam trying to do ber for bpsk with differential stbc using matlab.

can you help me with this.

Krishna Sankar June 21, 2010 at 5:59 am

@krishna: Sorry, I have not discussed differential STBC in any posts till date.

SHAKSHI April 1, 2010 at 1:02 pm

I HAVE TRIED FOR MIMO ESTIMATION AS WELL AS OFDM BUT WEN BOTH WOULD BE TRIED AT THE SAME TIME I HAVE TO INVOLVE THE STBC I AM NOT CLER WITH THAT

THANKS

SHAKSHI February 25, 2010 at 9:33 am

Respected sir,

I am working on channel estimation for mimo-ofdm system using pilot method

I have worked on ofdm system as well as mimo

but i am having problem with pilot method involving both

can u plz give me guidance

Krishna Sankar March 31, 2010 at 5:08 am

@SHAKSHI: What is the problem which you are facing?

SHAKSHI April 1, 2010 at 1:04 pm

I HAVE TRIED FOR THE PILOT CHANNEL OFDM SYSTEM & MIMO BUT WEN BOTH USED AT THE SAME TIME STBC SHOULD BE INVOLVED & I AM HAVING PROB WITH IT

THANKS

Krishna Sankar April 4, 2010 at 3:28 am

@SHAKSHI: Well, ok. But, what is the problem and how did you solve it?

SHITAL BHATT February 18, 2010 at 3:52 pm

RESPECTED SIR,
I M WORKING ON PILOT BASED CHANNEL ESTIMATION FOR MIMO SYSTEM
IN IT I HV TO COMPARE ML & MMSE

Krishna Sankar March 31, 2010 at 5:40 am

@SHITAL BHATT: What is the issue which you are facing?

samta January 20, 2010 at 9:34 pm

hi..
please tell me what if i need expression of probability of error(BER) for QPSK,in presence of rayleigh fading(you have done for BPSK).

Mohammed January 12, 2010 at 12:01 am

Hi all
could you please help me to get the simulation code for the BER in rayleigh channel with BPSK …thank you very much indeed
Regards

student December 1, 2009 at 10:09 pm

Hello

I am working on a paper in which i am trying to plot ber for bpsk using rayleigh channel. but, the thing is, i need to use estimated SNR including the pilot symbols and noise samples as parameters. I tried with the corresponding SNR estimate equations in the paper, but, i am experiencing constant BER.
I have followed the same steps posted by you in “BER for BPSK in Rayleigh channel” to produce the rayleigh output and later used estimated SNR to calculate BER, so that i can vary pilot symbols(N) and Noise samples(L). But, i am stuck. can you please refer my paper and guide me, whether i am in right way..??
http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=01437347&tag=1

Krishna Sankar December 7, 2009 at 5:04 am

@student: Sorry, due to time constraints I wont be able to help with the coding part. Good luck.

mahesh gupta November 15, 2009 at 9:02 pm

my topic is walsh coded time domain mimo channel estimation.i face difficulty in programing of multipath rayleigh fading channel.in this their are 2 transmitter and 2 receiver and 6 path rayleigh fading channel.so in the paper delay and gain for 6 path is given for transmitter 1 to receiver 1 ,transmitter 2 to receiver 1 ,transmitter 1 to receiver 2 ,transmitter 2 to receiver 2.i can not do the program for this.and also i can not understand where to put the walsh code.if possible then please give me program for mimo ofdm channel estimation.the name of reference paper is ‘walsh coded training signal aided time domain channel estimation for mimo ofdm systems.

Krishna Sankar December 6, 2009 at 3:26 pm

@mahesh gupta: Well, there are multiple aspects to the problem which you are stating. Let me try to break this down for you
(if you have not done that already):
a) Try to get the simulation up for a one transmit one receive ofdm system in a rayleigh fading channel. Hopefully the post on http://www.dsplog.com/2008/08/26/ofdm-rayleigh-channel-ber-bpsk/ might be of help
b) Try to get a 2 transmit 2 receive mimo channel simulation up and running. Hope this post might be of help
http://www.dsplog.com/2008/10/24/mimo-zero-forcing/
c) Try to combine (a) and (b) i.e. perform 2 x 2 MIMO link with OFDM
d) In (c), the channel is assumed to be known. Apply your proposed Walsh coding to estimate the channel sequence.

Good luck.

sara October 6, 2009 at 11:21 pm

you can help me in simulation for calculate BER in selective frequency fading channel in OFDM

Krishna Sankar October 8, 2009 at 5:35 am

@sara: In OFDM, though the channel is frequency selective, channel as seen by each subcarrier is flat. Hence the expression for flat fading holds good. Please refer to the post http://www.dsplog.com/2008/08/26/ofdm-rayleigh-channel-ber-bpsk/

Ahsan August 31, 2009 at 12:39 pm

i have learned alot from your SNIPPETS you leave here and there..

kindly write one for the explanation of this CIR as well, and if possible, the translation of these parameters into dBs or something
bestest regards

Ahsan August 31, 2009 at 12:37 pm

Thanx, i got what you said
just one thing, how do you define the CIR parameters defined
like i know its freq response is a deep null…
but what does it imply in terms of the number of multipaths? and does it take into consideration, the rms delay as well?
i know how the filter command works, just want to know whats the relevance of the values and the number of values in CIR

Krishna Sankar September 7, 2009 at 5:25 am

@Ahsan: More the number of multipaths in time domain (i.e higher rms delay spread), higher is the chance that a subcarrier in frequency domain has a deep null.
You can find a good discussion on delay spread here @
http://www.wirelesscommunication.nl/reference/chaptr03/ind_chan/rds_est.htm

Ahsan August 21, 2009 at 4:47 am

im stuck with frequency selective fading aspect of my project
today i went to see my supervisor
to show her the codes i had and the results(which are a bit off target in terms of Eb/No)
supervisor gave me hell
asking me why i had not implemented frequency selective fading
now she wants me to do this
IMPLEMENT A CHANNEL THAT EXHIBITS FREQUENCY SELECTIVE FADING!!!

now consider the code below!

% ——————————————————————- %
% Parameters Declaration %
% ——————————————————————- %
% Initialize the parameters
FrameNum = input(‘number of frames transmitted is(default=5000) =’);
end
FrameSize = input(‘size of each frame is(default=256) =’);
if isempty(FrameSize)
FrameSize = 256;
end
Chan =input(‘channel IR is(default=[0.227 0.46 0.688 0.46 0.227]) =’);
if isempty(Chan)
Chan = [0.227 0.46 0.688 0.46 0.227]; !!!!!!!!!!!!!!===============
end
CPLen = FrameSize/8;
% ——————————————————————- %
% Generate Transmit Signal & BPSK Modulation %
% ——————————————————————- %
% generate the random binary stream for transmitting
% modulate ,generate the BPSK symbols
Table=[-1 1];
% After the step upon,Table = [-1.0000-0.0000i 1.000]
BitsTrans = Table(BitsTranstmp+1);
% ——————————————————————- %
% Add CP %
% ——————————————————————- %
% the function RESHAPE is to rearrange the BitsTrans to add cp for con-
% venience
% the matrix below is as the same function of add cp to each frame one
% by one
% ——————————————————————- %
% Go Through The Channel %
% ——————————————————————- %
RecChantmp = filter(Chan,1,AddCP); !!!!!!!!!!!!!!!!!!!!!!!!!!!!!====================

notice the two lines with the marks of exclamation followed by ========= sign
first one
there is some declaration of CIR parameters which are applied to our bits to be sent in the second HILIGHTED command
now
what exactly is the function of doing this??
and how this affects our data??

now the task she has given me is…
implement freuency selective fading…
i have no idea of how to achieve that…

at present, just help me with the frequency selective part!
howto implement a channel that exhibits frequency fading……..
HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP!!!!!!!!!!!!!!????????????

Krishna Sankar August 22, 2009 at 5:35 am

@Ahsan: Though I do not understand your code completely, some suggestions will be
a/ Oversample your transmit signal (i.e insert zeros between your samples) and then pass it through a filter which does not cause inter symbol interference. Make your AddCP variable a single row vector.
The post on http://www.dsplog.com/2008/04/14/transmit-pulse-shape-nyquist-sinc-rectangular/
b/ The filter() command looks correct. The frequency selective fading channel can indeed be modeled as a filter.

yazeed Kh August 15, 2009 at 10:21 pm

Hi;
what about DPSK instead of BPSK, and how i can generate DPSK sequence?
tahnk u

Krishna Sankar August 18, 2009 at 3:45 am

@yazeed: Hopefully, the post on Coherent Demodulation of differential BPSK should be of help to you
http://www.dsplog.com/2007/09/30/coherent-demodulation-of-dbpsk/

farrakh August 11, 2009 at 6:32 pm

thnx krishna for emil me the ebook.
do u have BER equations of different modulations in other wireless channels(rayleigh,nakagami) plz send me if u have. and plz tell me if u have any type of simulations in nakagami_m channel.

thkx

Krishna Sankar August 12, 2009 at 4:17 pm

@farrakh: I have mailed you the instructions to obtained the e-Book.
Sorry, I have not posted on Nakagami channel.

leth July 20, 2009 at 11:11 am

i do this paper
“An Adaptive Modulation Scheme for Simultaneous
Voice and Data Transmission over Fading Channels
Mohamed-Slim Alouini, Member, IEEE, Xiaoyi Tang, and Andrea J. Goldsmith, Member, IEEE”

i make for example figure 10, i need how to make figure 10 in simulation(monte carlo) ?

regards

leth July 20, 2009 at 11:05 am

thanks for replay, can you tell me as steps how to do that

Krishna Sankar July 20, 2009 at 7:22 pm

@leth: I have not tried modeling adaptation myself. Hence I am unable to provide you with precise steps. Good luck in your investigations.

leth July 18, 2009 at 10:05 am

can you tell me how to make adaptive modulation ?

regards

Krishna Sankar July 19, 2009 at 8:58 am

@leth: I do not have a code combining BPSK/QPSK/QAM etc to do adaptive modulation. However, you may find individual posts describing these modulation schemes @ http://www.dsplog.com/2008/10/01/download-free-e-book/
As you said, one way to make an adaptive modulation scheme is to define a BER threshold (lets say 10^04) to switch from one modulation scheme to another.

MsBee June 12, 2009 at 4:46 am

Can you help me out with the similar expression for the ber over a rician channel?
Also the expresssion for the ber for rayleigh channel those it still hold for both bpsk and qpsk modulation over this channel?
Thanks.

Krishna Sankar June 20, 2009 at 8:40 am

@MsBee: My replies:
1/ Sorry, I have not tried modeling Rician channel.
2/ BER vs EB/N0 should be same for both QPSK and BPSK

shomapto April 25, 2009 at 11:11 am

i need matlab code for an ofdm system using rayleigh fading channel

Krishna Sankar April 30, 2009 at 5:14 am
nirmaladevi rangisetty July 11, 2009 at 2:13 am

iam need of what is the use of non gaussian noise in channels

Krishna Sankar July 15, 2009 at 5:07 am

@nirmaladevi : You may want to check out http://en.wikipedia.org/wiki/Electronic_noise

oyou April 21, 2009 at 3:58 pm

Hi sir,

thanks a lot!

i’m try to realize the method mentioned in Cui’s paper in “Energy-Efficiency of MIMO and Cooperative MIMO Techniques in Sensor Networks”.
In this paper, Cui writes “we find the required average Eb by evaluating average Pb over 10000 randomly generated channel samples according to (6)(just like the 1st equation in your article) at each transmission distance and then invertion to obtain the average Eb that yields the desired average Pb”.
I can’t understand how i can get average Eb from average Pb and how i can get Pb without knowing average Eb…(*_*!) using matlab…

Krishna Sankar April 30, 2009 at 4:55 am

@oyou: Well, given that you know the value of channel gain h, transmission power Eb, and noise power N0, we can compute the resultant Eb/N0 for each channel realization. If we average over all channel realizations, we get the average BER.
Agree?

oyou May 9, 2009 at 8:57 am

I agree what you said. But what i want to ask is: given average BER, N0 in flat Rayleigh-fading channel, how can i calculate average Eb?

Krishna Sankar May 12, 2009 at 5:27 am

@oyou: Given that average BER = function of average Eb/N0, maybe we can back-calculate?

wil March 21, 2009 at 2:21 pm

thanks i need it too,..

debabandana February 6, 2009 at 9:21 am

hello sir
sir my work is in antenna-diversity(MIMO).i have to find SNR~Pe of different diversity scheme(sc,mrc,egc).using bpsk modulation i have to proceed.but i am unable to do that.

Krishna Sankar February 10, 2009 at 7:50 pm

@debabandana: You may refer to my posts on
(a). Selection combining
(b). Equal Gain Combining
http://www.dsplog.com/2008/09/19/equal-gain-combining/
(c). Maximal Ratio combining
http://www.dsplog.com/2008/09/28/maximal-ratio-combining/

Hope this helps.

lia January 22, 2009 at 6:53 pm

thanks a lot!!
this is a great help!
i’ve been trying to work this out ever since the post on BER for Rayleigh – till the point of give up!
love all dsplog.com publish!