(34 votes, average: 4.50 out of 5)

# BER for BPSK in Rayleigh channel

by on August 10, 2008

Long back in time we discussed the BER (bit error rate) for BPSK modulation in a simple AWGN channel (time stamps states August 2007). Almost an year back! It high time we discuss the BER for BPSK in a Rayleigh multipath channel.

In a brief discussion on Rayleigh channel, wherein we stated that a circularly symmetric complex Gaussian random variable is of the form,

$h = h_{re} + jh_{im}$,

where real and imaginary parts are zero mean independent and identically distributed (iid) Gaussian random variables with mean 0 and variance $\sigma^2$.

The magnitude $|h|$ which has a probability density,

$p(h) = \frac{h}{\sigma^2}e^{\frac{-h^2}{2 \sigma^2}},\ \ \ z\ge 0$

is called a Rayleigh random variable. This model, called Rayleigh fading channel model, is reasonable for an environment where there are large number of reflectors.

## System model

$y=hx+n$, where
$y$is the received symbol,
$h$is complex scaling factor corresponding to Rayleigh multipath channel
$x$ is the transmitted symbol (taking values +1′s and -1′s) and
$n$ is the Additive White Gaussian Noise (AWGN)

Assumptions

1. The channel is flat fading – In simple terms, it means that the multipath channel has only one tap. So, the convolution operation reduces to a simple multiplication. For a more rigorous discussion on flat fading and frequency selective fading, may I urge you to review Chapter 15.3 Signal Time-Spreading from [DIGITAL COMMUNICATIONS: SKLAR]

2. The channel is randomly varying in time – meaning each transmitted symbol gets multiplied by a randomly varying complex number $h$. Since $h$is modeling a Rayleigh channel, the real and imaginary parts are Gaussian distributed having mean 0 and variance 1/2.

3. The noise$n$ has the Gaussian probability density function with

$p(n) = \frac{1}{\sqrt{2\pi\sigma^2}}e^{\frac{-(n-\mu)^2}{2\sigma^2}$ with $\mu=0$ and $\sigma^2 = \frac{N_0}{2}$.

4. The channel $h$is known at the receiver. Equalization is performed at the receiver by dividing the received symbol $y$by the apriori known $h$ i.e.

$\hat{y} = \frac{y}{h} = \frac{hx+n}{h} = x+\tilde{n}$

where
$\tilde{n} = \frac{n}{h}$is the additive noise scaled by the channel coefficient.

## Bit Error Rate

The equations listed below refers Chapter 14.3 in [DIGITAL COMMUNICATION: PROAKIS]

If you recall, in the post on BER computation in AWGN, the probability of error for transmission of either +1 or -1 is computed by integrating the tail of the Gaussian probability density function for a given value of bit energy to noise ratio $\frac{E_b}{N_0}$. The bit error rate is,

$P_b=\frac{1}{2}erfc\left({\sqrt{\frac{E_b}{N_0}}}\right)$.

However in the presence of channel $h$, the effective bit energy to noise ratio is $\frac{|h|^2E_b}{N_0}$. So 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}$.

To find the error probability over all random values of $|h|^2$, one must evaluate the conditional probability density function $P_{b|h}$ over the probability density function of $\gamma$.

Probability density function of $\gamma$

From our discussion on chi-square random variable, we know that if $|h|$is a Rayleigh distributed random variable, then $|h|^2$ is chi-square distributed with two degrees of freedom. since $|h|^2$ is chi square distributed, $\gamma$ is also chi square distributed. The probability density function of $\gamma$is,

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

Error probability

So the error probability is,

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

Somehow, this equation reduces to

$\Large P_{b}=\frac{1}{2}\left(1-\sqrt{\frac{(E_b/N_0)}{(E_b/N_0) +1}}\right)$.

Note:

1. I have not yet figured out the math to reduce the above integral to the answer. If some one knows, kindly drop in a comment.
2. Another way for finding the bit error rate might be to find the pdf of $\tilde{n}$. However, I do not know how to find pdf following the division of two random variables.

## Simulation Model

It will be useful to provide a simple Matlab/Octave example simulating a BPSK transmission and reception in Rayleigh channel. The script performs the following

(a) Generate random binary sequence of +1′s and -1′s.

(b) Multiply the symbols with the channel and then add white Gaussian noise.

(c) At the receiver, equalize (divide) the received symbols with the known channel

(d) Perform hard decision decoding and count the bit errors

(e) Repeat for multiple values of $\frac{E_b}{N_0}$ and plot the simulation and theoretical results.

Figure: BER plot of BPSK in Rayleigh fading channel

When compared to the AWGN case, around 25dB degradation due to the multipath channel (at the $10^{-4}$point). This is both good and bad: bad because we need to spend so much energy to get a reliable wireless link up (in this era of global warming), and good because we signal processing engineers are trying to figure out ways for improving the performance.

## Reference

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.

Miller January 6, 2017 at 9:02 pm

Hi Krishna Sankar,
My name is Miller. Recently, I am simulating the same task as you.
I have already read your notes and some comments and understood your Matlab code, but I don’t know why the MATLAB code is written ？ I don’t know the code depends on which theories.
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white gaussian noise, 0dB variance
h = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % Rayleigh channel
% Channel and noise Noise addition
y = h.*s + 10^(-Eb_N0_dB(ii)/20)*n;
% receiver – hard decision decoding
ipHat = real(yHat)>0;

My questions are:
1.why both of n and h are multiplied by 1/sqrt(2)? where is the 1/sqrt(2) form?
2.10^(-Eb_N0_dB(ii)/20) means sqrt(N0/2),which is represent average voltage amplitude?
3.Why should we add complex ” noise ” OR complex ” h ” ? as finally we are not utilizing imaginary part of complex signal at all when we are detecting signals?
Only use real part is right?
These problems are bothering me for a long time.
Could you explain it to me ?
Thank you very much!

Fati December 30, 2016 at 3:17 am

Hi Mr Sankar
I have a question about BER calculation. In my simulation, the input bit sequence(b1) has the length (L1). b1 is modulated to make the transmitting signal(s1).The length of transmitted signal is increased to L2 by convolving it with the channel impulse response. So for comparing the demodulated received signal (b2) with the input signal(to calculate BER), b1 and b2 must have the same length. I cut the samples are at the end of the sequence but it does not work.
I am looking forward to hearing from you.
Yours Sincerely,
Fati

Bai March 9, 2013 at 7:06 pm

Hi, why is the rayleigh channel same as the noise channel? i thought the rayleigh channel should be simulated using the rayleigh random variable posted in the other article ?

Krishna Sankar March 13, 2013 at 5:43 am

@Bai: Rayleigh channel is formed using complex gaussian random variable.
http://www.dsplog.com/2008/07/14/rayleigh-multipath-channel/

hilman February 19, 2013 at 8:12 pm

Hi Krishna,
You can find the proof of bit error rate formula in David Tse’s book problem 3.1

http://snag.gy/2yRO0.jpg

Krishna Sankar February 21, 2013 at 6:15 am

@hmilan: thanks

xiaofei October 17, 2012 at 12:31 pm

relay network with feedback delay over rayleigh fading channel

Fan Ding October 11, 2012 at 7:01 am

Hi,Khishma
you said the PDF of r was :p(r) = 1/(Eb/No)*exp(-r/(Eb/No)) ,
should it be :p(r) = 1/(r’)*exp(-r/r’) ?
where , r’ = E(h^2)*Eb/No ;
.

.

Krishna Sankar October 17, 2012 at 6:15 am

@Fan: When trying to look back at the derivation of the BER @
http://www.dsplog.com/2009/01/22/derivation-ber-rayleigh-channel/
could see the following comment – “The resulting BER in a communications system in the presence of a channel h, for any random values of |h|^2, must be calculated evaluating the conditional probability density function Pb|hover the probability density function of gamma.”

Am unable to full recall the details, will ponder on this a bit, and update.

Abhijith October 18, 2012 at 2:39 pm

Hi Krishna,
I derived PDF of SNR in Rayleigh fading channel.
How can I share here? It is set of mathematics and if I paste it is not appearing neat.
I wish to present equations as you presented in your write up.
It is just 8 lines of equations.
Please give hints to write equations as you have written.
Thank you.

Krishna Sankar October 19, 2012 at 5:34 am

@Abhijith: You can mail me the pdf/doc and I can share it.
OR upload to an online site like dropbox and paste the public url

Fan Ding October 11, 2012 at 6:27 am

Your posts help me a lot,thks.
And I saw that someone had asked you some questions in Chinese.
I am curious that you could read in Chinese.Is that really ? haha

Krishna Sankar October 15, 2012 at 6:25 am

@Fan: I know as much Chinese as I know Spanish Xie xie

payel saha September 21, 2012 at 9:34 pm

krishna plz give the code for ber of bpsk over rician channel

Krishna Sankar September 22, 2012 at 6:07 am

@payel saha: I have not tried modeling rician channel

Skm September 16, 2012 at 11:12 am

Hi sir,
have recently gone through the matlab code for ” BER computation of BPSK in Rayleigh fading channel”. There, after equalization , we perform hard decision decoding by
% receiver – hard decision decoding
ipHat = real(yHat)>0;
which effectively converts all incoming complex signals into 1 having real part greater than zero. That means at this stage we are not utilizing the imaginary part.
So my question is, why should we add complex ” noise ” OR complex ” h ” ? as finally we are not utilizing imaginary part of complex signal atall ?

Krishna Sankar September 18, 2012 at 5:40 am

@Skm: In the BPSK case, as you rightly said we are not using the information on the imaginary dimension and that component is ignored. I added the imaginary part in the simulations to keep it as a general case.

Charly Tchouadou-Ndalleu January 21, 2013 at 4:17 am

n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white gaussian noise, 0dB variance
h = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % Rayleigh channel
y = h.*Signal + 10.^(-SNR_db(i)/20)*n;

hello Sir! what does those above equations mean? i will very happy if you could explain them as i am to write a code which calculate the BER of OFDM using BPSK.

Thanks

Krishna Sankar January 23, 2013 at 5:27 am

@Charly Tchouadou-Ndalleu: randn generates zero mean unity variance Gaussian distributed random variables. To add on the real and imaginary dimensions, we use two instances of randn and scale by 1/sqrt(2) to keep the variance at unity. The term n is an additive noise (modeling the thermal noise) and h is a multiplicative noise (modeling the phase and amplitude changes introduced by channel)

Abhijith August 6, 2012 at 7:20 pm

@Krishna: Thank you very much for your informative articles.
I have few questions slightly related to this article. I need your opinion on how you would have approached this scenario. This scenario is hypothetical.
Specification:
Assume I have to design a communication system for a specific area and specific purpose. My customer specified me minimum BER (QoS) and transmit power. I have liberty to choose rest (for eg: delay, modulation, complexity).

Approach:
Now I have to choose modulation technique, error correction algorithm. This depends on, what channel and bandwidth is.
As it is specific place, I don’t know how channel looks like . I would have approached this way,
Step 1: Measure and model channel:
Assume I am able to measure channel. Find PDF of the channel somehow.
Using this PDF, I can find outage probability or Bit error rate.

Step 2: To meet this BER, choose modulation technique and error correction algorithm.

Step3: Decide how much Sync you need, based on Channel.

Step 4: Start design and test back.

My question is Q1: How to measure real time channel if I don’t have built communication system?
Q2. Is my approach is right?
Q3. If I am right, have I overlooked something.

Thank you very much.
I am waiting for your inputs.
With regards,
Abhijith Gopalakrishna.

Krishna Sankar August 9, 2012 at 6:12 am

@Abhijith:
Nice approach. One would also need to look at the range requirement of the communication link. To start off, assuming a free-space path loss model, transmit power and receiver noise bandwidth one can get a good estimate for the range.
Now depending on whether the system is going to be indoor or outdoor, the free-space path loss model needs to be tweaked. Doing a channel measurement in the target deployment environment is definitely a good idea, however it may be expensive and time consuming. Alternately, one can look at typical channel models available in the literature and pick one which can closely match your desired use case. Hope this helps.

DHARMESH July 24, 2012 at 9:34 am

hello krishna,
I want to design a transceiver for wireless sensor networks for the application of home automation or for the indoor environment. So, I want to know about the energy efficient modulation schemes which is suitable for my appliction and what are the characteristics i have to consider for choosing these modulation schmes, so under these conditions which schemes is more suitable for my application..

Krishna Sankar July 26, 2012 at 5:03 am

@DHARMESH: The key aspects to look out are – data rate requirement and the range (since it is indoor, am assuming that it is of the order of 50meters). Typically, simpler the modulation scheme (i.e BPSK ish), the RF and associated circuits can be cheaper and power efficient.

The Zigbee standard seems to enable a cheap and power efficient transceivers
http://en.wikipedia.org/wiki/ZigBee

Rupom July 3, 2012 at 11:04 pm

Krishna Sankar July 5, 2012 at 5:09 am

@Rupom: what is gamma-gamma channel – any pointers?

Aiyu May 22, 2012 at 10:14 am

Hi Krishna, thanks for the blog and the MATLAB demo..
I have some questions about the commands

1. This line below, h is normalized by sqrt(2) to make the average power gain=1, am I right?
h = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % Rayleigh channel

2. In the line below Why is the SNR divided by 20, not 10?
y = h.*qamSig + 10^(-Eb_N0_dB(ii)/20)*n;

3. what about the case of M-QAM? Let’s say it’s then Es_No_dB instead of Eb_N0_dB, do I need to change anything else for y in the equation above???

thank you

Krishna Sankar June 11, 2012 at 5:33 am

@Aiyu: replies
1. yes
2. the scaling is done on a voltage signal. hence using 1/20
3. Es/N0 should be straight forward. For Eb/N0 you might need to scale by M.
Es/N0 = k*Eb/N0, where k= log2(M)

filip March 29, 2012 at 7:04 pm

Hey!

Based on what can you assume that channel is known in the receiver? When does the rx obtain this information? I mean channel changes a lot in a very short period, so when is the CSI supposed to be obtained?
What I noticed is that the curve obtained here matches the one obtained by the command berfading, so my q is basically about justifying how and why Rx knows CSI.

Thanks

Krishna Sankar March 30, 2012 at 5:38 am

@filip: In most cases, there will be training sequence in the transmission which will help the receiver estimate the channel. This will be a noisy estimate of the channel (which results in a performance loss), but useful nevertheless…

sayyed armaghan March 10, 2012 at 5:43 pm

hello
thank u alot for your notes it was really usefull for me!
I am student of ms in system communications engineering would you mind introducing me some fresh, exciting and excellent topic in wireless communication (esp mimo and stc) for my ceminar?
thank u again and excuse me for my bad english

Krishna Sankar March 12, 2012 at 4:43 am

@sayyed: Please have a look at http://www.complextoreal.com/tutorial.htm
Very nice list of tutorials

pavan March 10, 2012 at 2:08 pm

hai,
can you please provide me a source for understanding jakes model…

Krishna Sankar March 12, 2012 at 4:43 am

@pavan: will add to the TO-DO list

Ritesh March 2, 2012 at 6:46 pm

Hi Krishna
DO you know the codes for the plot of BER for a BPSK modulation in a RICIAN channel? Plz reply asap

thanks

Krishna Sankar March 5, 2012 at 5:37 am

@Ritesh: Have not tried to simulate Rician channel

Pranjal Gogoi February 3, 2012 at 8:36 pm

Mr. Sankar probably you will be the right person to solve a problem i have encountered in my MTech. project. Let us consider a Rayleigh frequency selective fading channel,while using BPSK. Now at the receiver i want to put a digital phase lock loop.
In this case how i will calculalte the BER performance. Will the DPLL degrade or enhance the perfomance of the BER

Krishna Sankar February 6, 2012 at 5:11 am

@Pranjal: Why do you want the DPLL in place? Am sure it’s not because of the channel, rather it might be necessitated by any phase errors.

ammar January 23, 2012 at 6:50 pm

Hi Krishna
you are a very helpful man .. i just want to ask you if you deal with matlab function that creat rayleigh channel >> name (rayleighchan)

its a good function .. and have a many optional parameter

thank you >> i will check your blog daily

Krishna Sankar January 26, 2012 at 6:19 am

@ammar: Thanks. I do not have the function rayleighchan() handy

Nam Nguyen January 5, 2012 at 6:55 am

Hello Mr. Krishna,

Why the theory and the simulation of Rayleigh channel in “ber-bpsk-rayleigh” is same but in ” ber-16qam-rayleigh” is so different?

Krishna Sankar January 6, 2012 at 6:12 am

@Nam: Well, the 16QAM is more error prone when compared to BPSK.

Colin O'Flynn December 14, 2011 at 5:16 am

Perhaps you found this out a while back, as this is an older post, but a description of the evaluation of that integral is found in section 5.1 (pg 99-101) of the book “Digital Communication Over Fading Channels” by Marvin Simon.

Krishna Sankar January 4, 2012 at 5:47 am

@Colin: Thanks. Yes, indeed found the derivation.
I do not have the book handy, but will try to get it

seshu May 18, 2011 at 3:50 pm

Hi sir ,
I saw ur Ber_bpsk_reyleigh program i gone through that link but dont know how to send the data in the qpsk can u please help me and tell some hints about the rician channel.please sir

Krishna Sankar May 23, 2011 at 2:39 am

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

shu May 18, 2011 at 12:14 am

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 .

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

Hasan Thiabat December 2, 2010 at 3:32 pm

thank you Mr krishna

nico October 28, 2010 at 1:05 pm

Hello Mr. Krishna,

I’m trying to simulate frequency non-selective rayleigh fading channel like you did, but including the path loss (PL in dB) between two nodes.
So instead of having complex number h (channel) with the real and imaginary parts are Gaussian distributed random variable having mean 0 and variance 1/2,
the variance became

var = 1/(2*10^(PL/20))

Is this correct? Thank you.

Krishna Sankar November 19, 2010 at 5:53 am

@nico: The variance should use factor of 1/10. var = 1/(2*10^(PL/10)). Agree?

Hassan Moradi August 2, 2010 at 11:57 am

in the expression for y, I think you should use y=|h|x+n instead of using y=hx+n. Right?

Krishna Sankar August 3, 2010 at 6:02 am

@Hassan Moradi: No. The channel can distort the phase and amplitude of the transmit signal

Tom June 14, 2010 at 7:23 am

what is meant by a power limited in communication system.

Krishna Sankar June 21, 2010 at 5:52 am

@Tom: A system where we cannot transmit very high power (due to battery/size limitations etc)

Tuyen Tran June 12, 2010 at 6:52 pm

I simulate 16QAM modulation (no coding) over Rayleigh channel, I want to change profile of channel, so I write:
chan = stdchan(1/Rb,150,’cost207RAx4′);
chan.PathDelays = [0, 0.2*1e-6, 0.4*1e-6, 0.5*1e-6];
chan.AvgPathGaindB = [0, -2, -10, -16];
chan.NormalizePathGains = 1;
chan.ResetBeforeFiltering = 0;
I need your help, could you show me I am wrong or right?

Krishna Sankar June 14, 2010 at 6:10 am

@Tuyen Tran: I do not have matlab, hence unable to comment on the stdchan() function. But in general, your code seems to be correct. Make sure that you convolve your time domain samples with the channel taps.

Tuyen Tran June 19, 2010 at 6:40 pm

Rebecca April 13, 2010 at 6:00 pm

Hi Krishna,

Do u have any topic related to BER for BPSK in Rician channel? I’d like to know how to write (matlab code) for Rician… Tks.

Krishna Sankar April 14, 2010 at 4:41 am

@Rebecca: Sorry, I have not discussed Rician channel

dolly April 13, 2010 at 2:53 pm

hii sir
how to get rayleigh channel using BPSK modulation & adding AWGN noise by usingg taps.actually what is tap? &
why it should be used in rayleigh channel?

Krishna Sankar April 14, 2010 at 4:40 am

@dolly: A signal transmitted over air can reach the receiver through different paths. The gain and phase information corresponding to each path is notionally stored as tap. In this post, I have assumed a single tap Rayleigh channel

I have discussed briefly on
a) Rayleigh channel @ http://www.dsplog.com/2008/07/14/rayleigh-multipath-channel/
b) 3 Tap fixed ISI channel with ZF equalization http://www.dsplog.com/2009/11/29/ber-bpsk-isi-channel-zero-forcing-equalization/

bijoy babu March 14, 2010 at 5:54 am

hey i just had a look on the matlab code that you posted..
% Transmitter
ip = rand(1,N)>0.5; % generating 0,1 with equal probability
s = 2*ip-1; % BPSK modulation 0 -> -1; 1 -> 0
correct me if i am wrong..cos i am new to matlab and to this topic i have very less knowledge..
i checked the output for n=10
ip =1 0 0 1 0 1 1 1 0 0

s =1 -1 -1 1 -1 1 1 1 -1 -1
cheers bijoy

Krishna Sankar March 28, 2010 at 3:40 pm

@bijoy babu: Yes

FERNANDO March 9, 2010 at 10:58 pm

Hi friend, please, I do not understand why the BER of BPSK in Rayleigh channel is equal to the BPSK OFDM in Rayleigh channel. Thank you very much.

Krishna Sankar March 29, 2010 at 6:48 am

@FERNANDO: In this simulation model, even though we have a 10-tap multipath channel, as the channel duration is less than the cyclic prefix (of 16 samples), we do not have inter symbol interference. Each subcarrier experiences flat fading as in the BER of BPSK in Rayleigh channel case. Hence the BER is identical.

Saurabh February 28, 2010 at 3:42 am

hi,

I have similar kind of project to do but in my project prof is asking to plot BER of BPSK i.e. BER vs γ. Does it look different from when we plot it against Eb/No?

Krishna Sankar March 30, 2010 at 4:57 am

@Saurabh: What is y?

kadir February 18, 2010 at 3:54 pm

Can you distinguish clearly correlated and uncorrelated Raykeigh Channel and how are they formed from awgn? How to implement BER simulation for correlated and uncorrelated Rayleigh Channel?

Krishna Sankar March 31, 2010 at 5:40 am

@kadir: AWGN is an additive noise whereas as the channel is a multiplicative noise. For uncorrelated channel, the channel varies for each symbol. For correlated channel, the channel varies slowly across symbols

samalqudah February 14, 2010 at 10:34 pm

hello mr. krishna,
i would ask you a question regarding the rayleigh channel. how can i generate Rayleigh channel impulse response as ready numbers to be used in a program without using the rand()+j*randn() commands. in other words, i don’t want to have a loop or large number of symbols to get the plot of the prob. of error. I want to have a table of values for channel impulse response to be used for simulating a MIMO system. some papers do list down in a table the channel as complex values between each transmit and receive antenna to get a MIMO channel matrix, how did they get such values? this is exactly my question

Sanket February 9, 2010 at 8:53 pm

Hi Krishna,
I have a little query..In your MATLAB program of calculating BER for BPSK in raleigh fading Channel,while calculating you have used

yhat=y./h;

Is it OK to divide y by h as above, as it may lead to severe noise amplification as h is a random variable and may take any value?

Thanks.

Krishna Sankar April 4, 2010 at 4:09 am

@Sanket: You are right, it can indeed result in noise amplification…

sinto February 4, 2010 at 8:11 pm

Hi Sir,,
in book Fundamental of Wireless Communication (by Tse and Viswanath)
h = sqrt(K/(K+1))*line_of_sight_signal + sqrt(1/(K+1))*reflected_and_scattered_signal

K = K-factor
From the above equation, i have modified your code (rayleigh channel) in order to simulate ricean channel.

% generating 0,1 with equal probability
ip = rand(1,N)>0.5;

% BPSK modulation 0 -> -1; 1 -> 0
s = 2*ip-1;

% Rician channel
h = 1/sqrt(2)*(sqrt(K/(K+1))*s + sqrt(1/(K+1))*(randn(1,N) + j*randn(1,N)))

is this code correct?
thanks

Krishna Sankar April 4, 2010 at 4:21 am

@sinto: Well, from a quick look it does not seem to be right.

samta January 19, 2010 at 5:18 pm

hi kishna..
I am working in turbo decoding.my recieved signal is effected by AWGN noise and reyleigh fading. which is in thae same formate which u have taken like hS+W.
My problem is that i want the exact expession of probability of error for QPSK.
Whatever u have derieved is for BPSK case.Can u derive it or please give me some hint.
Anyways as u asked the full mathematical concept of ur expression of BER for BPSK,u can go through my thesis supervisors book,named by DIGITAL COMMUNICATION AND SIGNAL PROCESSING BY K.VASUDEVAN.
hope this will help u and waiting for ur responce.

zaffar January 16, 2010 at 6:31 pm

Hi Krishna,
I hope you are doing well. I am simulating 16 QAM in a Rayleigh channel and am trying to compute the SER(& BER). I need to verify my results using the theoretical formula. Can you kindly tell me the formula of SER for 16 QAM in Rayleigh channel?
I shall be grateful
Zaffar

samalqudah January 11, 2010 at 6:10 pm

hello mr. krishna,
i would ask you a question regarding the rayleigh channel. how can i generate Rayleigh channel impulse response as ready numbers to be used in a program without using the rand()+j*randn() commands. in other words, i don’t want to have a loop or large number of symbols to get the plot of the prob. of error. I want to have a table of values for channel impulse response to be used for simulating a MIMO system. some papers do list down in a table the channel as complex values between each transmit and receive antenna to get a MIMO channel matrix, how did they get such values? this is exactly my question.

mat_ad December 29, 2009 at 1:16 am

Hi
How r u ? hope fine. I m very satisfy to this site, because it is very helpful to me to make my project. if u have QPSK matlab code for BER in Rayleigh channel, pls send me.
thanks.

prabag December 7, 2009 at 11:52 am

Hi
I would like to know that how IFFT makes signls to be orthogonally modulated in OFDM..also when we give 1s and 0s as input to IFFT block the o/p is complex value…and some of them are very close to zero..for eg for 1 it is 0.012+j0.032…suppose if this is transmitted thro’ severely faded channel still there is a possibility that these signal might get into deep fade..so at the receiver there might be a problem in decoding the data as detector would decide upon the quantized value…

Krishna Sankar December 8, 2009 at 5:27 am

@prabag: When we are doing IFFT, we are loading information on subcarriers exp(jwt), exp(j2wt) and so on… you may find a detailed discussion at http://www.dsplog.com/2008/02/03/understanding-an-ofdm-transmission/

At the receiver, we are not going to look at the time domain samples and attempt demodulation. We take the fft and look at the fft output prior to attempting demodulation
http://www.dsplog.com/2008/08/26/ofdm-rayleigh-channel-ber-bpsk/

student December 1, 2009 at 10:08 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.

aissou December 1, 2009 at 4:22 pm

wy you used teh signe negatif – in( -Eb_N0_dB(ii)/20), and d’ont Eb_N0_dB(ii)/20
thanks

aissou December 1, 2009 at 4:22 pm

wy you used teh signe negatif – in( -Eb_N0_dB(ii)/20), and d’ont Eb_N0_dB(ii)/20
thanks

Krishna Sankar December 7, 2009 at 4:59 am

@aissou: The negative sign came as I am scaling the noise voltage. I am keeping the signal swing the same and reducing the swing of noise voltage to simulate various Eb/N0 values.

Obinna O November 30, 2009 at 7:05 pm

Krishna Pillai,

Hellos sir,

I am told to assume Rayleigh fading channel with BPSK modulation. Using MATLAB
plot bit error probability (BEP) under coherent and non-coherent detection
when receiver is equipped with three antennas to exploit diversity.
Your figures will include plots from simulation. Use average SNR (complex)
from -5 to 20 dB.

Obinna O November 26, 2009 at 1:34 am

Krishna Pillai,

Hello Sir, I was asked to assume Rayleigh fading channel with BPSK modulation. Using MAT-LAB plot bit error probability (BEP) under coherent and non-coherent de-tection. Your ¯gures should include plots from both analysis and simulation.Use average SNR (complex) from -5 to 20 dB.

I am having difficulty writing the code for non coherent, I have been able to write the code for coherent detection.

Krishna Sankar December 7, 2009 at 4:39 am

@Obinna O: Hope you have finished the project by now.

usha November 20, 2009 at 5:48 am

Hello sir,
The posts here are very useful. great job.
Presently,I am working on a IEEE paper “On the Impact of SNR Estimation Error on Adaptive Modulation” . Here is th link
http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=01437347
But, I got stuck with the silmulation of the imperfect SNR Estimation.
I need to plot the fig.1 i.e; Estimated SNR vs pdf basing on the theoritical equations stated under imperfect SNR Estimation. can u please help me with the simulation ??

Thank You.

Krishna Sankar December 6, 2009 at 4:19 pm

@usha: Sorry, due to time constraints, may I decline to help with the simulation. Good luck.

student November 19, 2009 at 1:24 am

hi
i was trying to simulate BER for BPSK using Rayleigh fading channel.
But the difference is, I need to follow the steps,
1. Generate BPSK-modulated random data for the desired signal and
interfering users.
2. Generate the independent complexed Gaussian random vectors and multiply them with the corresponding covariance matrix represented by J0(x) (i.e., Jo(2*pi*d) where d is the ratio of the spacing between the two adjacent antennas to the wavelength) to get the correlated Rayleigh fading channel.
3. Generate complexed AWGN
4. Make hard-decision on the desired signal to get the BER.

And the algorithm you have followed says:
Simulation Model
(a) Generate random binary sequence of +1’s and -1’s.
(b) Multiply the symbols with the channel and then add white Gaussian noise.
(c) At the receiver, equalize (divide) the received symbols with the known channel
(d) Perform hard decision decoding and count the bit errors
(e) Repeat for multiple values of and plot the simulation and theoretical results.

My question is,
in the 2nd step, i am multipying the symbols with covariance matrix to obtain Rayleigh fading channel, and then in step 3, i am generating AWGN.
whereas, you are multiplying the symbols with the channel and then adding AWGN to it.

Do both the simulations yield similar results?
Can you please make me understand the difference.

Krishna Sankar December 6, 2009 at 4:15 pm

@Student: In my simulation model, the channel is independent flat fading Rayleigh channel which is applied to a single users transmission and then we add awgn to it.

For your case, its bit more complex. We need to have
a) Generate output of channel for desired user by using flat fading independent Rayleigh channel
b) Generate output of channel for undesired user by using correlated flat fading Rayeligh channel

So, your results will be poorer due to the additional interference from the undesired user.

Good luck.

bopuhafs November 12, 2009 at 9:06 pm

10^(-Eb_N0_dB(ii)/20) ; pourquoi utiliser le moin ‘-’

Krishna Sankar December 3, 2009 at 5:19 am

@bopuhafs: To make the noise power to be lower than the signal power

Miller January 6, 2017 at 8:50 pm

Hi Krishna Sankar,
My name is Miller. Recently, I am simulating the same task as you.
I have already read your notes and some comments and understood your Matlab code, but I don’t know why the MATLAB code is written ？ I don’t know the code depends on which theories.
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white gaussian noise, 0dB variance
h = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % Rayleigh channel
% Channel and noise Noise addition
y = h.*s + 10^(-Eb_N0_dB(ii)/20)*n;
% receiver – hard decision decoding
ipHat = real(yHat)>0;

My questions are:
1.why both of n and h are multiplied by 1/sqrt(2)? where is the 1/sqrt(2) form?
2.10^(-Eb_N0_dB(ii)/20) means sqrt(N0/2),which is represent average voltage amplitude?
3.Why should we add complex ” noise ” OR complex ” h ” ? as finally we are not utilizing imaginary part of complex signal at all when we are detecting signals?
Only use real part is right?
These problems are bothering me for a long time.
Could you explain it to me ?
Thank you very much!

Puripong November 8, 2009 at 8:53 am

Hi Krishna Sankar

My name is Puripong, I’ a student from Thailand.
I’m looking for the introduction to simulate BER performance in Rayleigh fading channel and this is a very nice post {BER for BPSK in Rayleigh channel}.

I found 25dB degradation when compared to BPSK-AWGN
Thank you very much.

I have some question about h,
Why does the real and imaginary parts must have variance equal to 1/2 ?
Could you give me an explaination or some reference textbooks for this question ?

Sara November 3, 2009 at 7:38 pm

Hi Krishna
I have a problem in my m.file.I produce a symbol strean by x=randint(N,1,M) where M is the order of modulation, the fading channel by H=sqrt(0.5)*(randn(N,1)+j*randn(N,1)).In this state the channel is changing every one bit(if M=2), is this true?I think it is not possible in real systems.What should i do if I want to keep the channel fixed in every coherence time of channel?How can i write the m-file of this issue?
thank u.
Sara

Krishna Sankar November 8, 2009 at 8:45 am

@Sara: Well, the most simplest way would be to keep the same channel for a group of symbols, then use an independent realization for the next group of symbols. If we want t make the channel evolve over time, then it becomes slightly more sophisticated…. I have not yet discussed that.

Sara November 3, 2009 at 7:24 pm

Hi Krishna
I have a problem in my m.file that i sent to your email.I want you to help me about this problem. thank you.

Krishna Sankar November 8, 2009 at 8:41 am

@Sara: I will take a look. Sorry for the delay.

amit October 28, 2009 at 9:21 am

i m very satisfy to this site, bcause it is very hepful to me to make mmy project. if u have qpsk matlab code for BER then plz send me .

Krishna Sankar November 8, 2009 at 7:39 am
Kirankumar Palthi October 21, 2009 at 4:21 pm

HI Krishna,
I sent you an email regarding my project.

mak_m September 28, 2009 at 3:16 am

i doo agree with ur comment
however i dint get my answer yet
can u plz tell me the code for channel model for bpsk
tht is frequency selective channel (u have done it with flat faing) ? with the help of this i can compare the ber of bpsk with rayleigh as compared to ber of bpsk rayleigh ofdm .so i can show how effectiev ofdm is in frequency slective channel.
can i use the same 10tap model used in ur code for bpskofdm in the case of bpsk only..
or i shuld use some other code..?
plz help me
thanks

Krishna Sankar October 1, 2009 at 5:21 am

@mak_m:
1/ Yes, with OFDM, the 10 tap channel is in effect gives same performance as flat fading channel
2/ You can use 10 tap channel with BPSK modulation. However, you need to do pulse shaping etc at the transmitter.

mak_m September 17, 2009 at 9:21 pm

thanks , hi krishna can u plz tel me…i m really confused .can u plz tell me ray leigh channel used in BER for BPSK(single tap) is different from ber for bpsk ofdm(10tap)… but their graphs are same… they both are f lat fadding?right
but if the ber of bpsk is same as ber of bpsk in ofdm in , then y did we use ofdm ..can u plz tell me which channel model shuld i use so i can show the performance improvement due to ofdm which i cant see in both of ur programs…
tel me which channel model shuld i use in case of bpsk without ofdm…ie to degrade the ber of ur simulation..

Krishna Sankar September 18, 2009 at 5:58 am

@mak_m:
1/ Thanks to OFDM, even though we have a 10-tap frequency selective channel, each subcarrier experienced a flat fading channel. Hence the performance of flat fading BPSK is comparable to OFDM performance.
2/ If we do not use OFDM, the performance for BPSK in a 10 tap channel will be much poorer due to inter symbol interference.
Hope this helps.

mak_m September 9, 2009 at 3:18 pm

can u plz tel me how did u drive the formula…for ber of bpsk in rayleigh channel…can i get further explanation
can u plz telme the source of it
gud work keep it up

Krishna Sankar September 10, 2009 at 6:56 pm
M_abs September 7, 2009 at 6:53 pm

Dear Krishna Sankar,
your posts helps me a lot. I want to how can i find the BER equation for 16-QAM and QPSK over the RAYLEIGH channel ? please help me….

Krishna Sankar September 9, 2009 at 5:51 am

@M_abs: You may modify the modulated variable s to correspond to QPSK/16QAM respectively. Make sure that you have the corresponding demodulators too. You may refer to
http://www.dsplog.com/2007/11/06/symbol-error-rate-for-4-qam/
http://www.dsplog.com/2007/12/09/symbol-error-rate-for-16-qam/
http://www.dsplog.com/2008/06/05/16qam-bit-error-gray-mapping/

vikas September 3, 2009 at 6:31 am

hi…
I have a doubt….within coherence time channel coffecients are constant…
if I am correct than why we are multiplying each data bit by rayleigh variable…..??
h = 1/sqrt(2)*[randn(nTx,N) + j*randn(nTx,N)]; % Rayleigh channel
sr = (1/sqrt(nTx))*kron(ones(nTx,1),s);
% Channel and noise Noise addition
hEff = h.*exp(-j*angle(h));
y1 = sum(h.*sr,1) + 10^(-Eb_N0_dB(ii)/20)*n;

Krishna Sankar September 8, 2009 at 5:44 am

@vikas: My replies:
1/ “within coherence time channel coffecients are constant…” [krishna] yes, channel coefficients are almost the same
2/ “why we are multiplying each data bit by rayleigh variable…..??” [krishna] rayleigh variable corresponds to channel coefficients. these coefficients remain the same for the coherence time duration

lumingui August 11, 2009 at 12:05 pm

ok. What you said is one of solution for it. After I read sklar’s book again for fading, I know the anwser , thanks!

lumingui August 10, 2009 at 10:46 am

Hi Krishna,
“When compared to the AWGN case, around 25dB degradation due to the multipath channel (at the point). This is both good and bad: bad because we need to spend so much energy to get a reliable wireless link up (in this era of global warming), and good because we signal processing engineers are trying to figure out ways for improving the performance.”
1. I think ” because we signal processing engineers are trying to figure out ways for improving the performance” can be undestandbe that if channel estimation is perfect, we can try to combat effect of rayleigh channel and get Ber vs EbN0 much closer to that of AWGN.
2. in your code for “BER for BPSK modulation in a Rayleigh fading channel” , there is only one rayleigh path, so the channel is flat.
% Channel and noise Noise addition
y = h.*s + 10^(-Eb_N0_dB(ii)/20)*n;
% equalization
yHat = y./h;
you try to simulate as having a perfect channel estimation and then equalizes it. But the performance is still too far away from that of AWGN. What is the better channel estimation and equalization method for it to get close to performance in AWGN?

Krishna Sankar August 11, 2009 at 4:55 am

@lumingui: You are right in saying that, in this current simulations where we know the ‘perfect channel’ and equalization, we are having optimal performance. However, think about the case where we have
http://www.dsplog.com/2008/09/28/maximal-ratio-combining/
Maximal Ratio Combining and bring down the BER by quite a bit. And theoretically, if we have infinite receive antennas, I think we reach close to AWGN performance
(b) Multiple transmit antennas with Beamforming
http://www.dsplog.com/2009/04/13/transmit-beamforming/
(c) Multiple transmit antennas with Space Time Block Coding (STBC)
http://www.dsplog.com/2008/10/16/alamouti-stbc/

Hemanth July 29, 2009 at 5:14 pm

Hi Krishna,

When you derived an expression for the average probability of symbol error in a rayleigh channel, you obtained a linear relationship(approximation for higher Eb/N0′s) between the logBER and the average Eb/N0(as you have shown in the plots). This derivation gives the average BER for a rayleigh channel with no mention of an EQ anywhere in the derivation. But when you simulate, you are getting the theoretical result of a linear dependence after having used an EQ. Not using an EQ would give very poor BER since the phase of the received points is now uniformly distributed and when you use a BPSK, you would have a only a 50% chance that the transmitted point would be received correctly. So although i understand the importance of using an EQ, what i dont follow is the gap between the theoretical derivation for average BER with no mention of the effects of an EQ, and the simulation which uses it. Please tell me what you think about what im saying. Thanks.

Krishna Sankar July 30, 2009 at 5:39 am

@Hemanth: You are not correct when you mentioned that the theoretical derivation of BER in Rayleigh channel did not include the effect of equalizer. Recall that, we started of the derivation by assuming that the instantaneous SNR is |h|^2Eb/N0. Its onlu after equalization the instantaneous SNR is |h|^2Eb/N0.
Note: y = hx + n
After equalization, xhat = y/h = (h*/|h^2|)y = h*(hx+n)/(|h|^2) = (|h|^2x + n)/(|h|^2)
Do you agree?

Hemanth July 31, 2009 at 10:39 am

Hi Krishna,

I agree with your explanation for where the EQ comes in. I was looking at it in a different way which lead to my confusion. It stems from the fact that the instantaneous SNR is (|h|^2)Eb/No, even when the EQ is not used(dont agree with you on this point )
Since y=hx+n,
Received signal power = E[(hx)(hx)^h](^h is hermittian),
= E((hx)(x^hh^h)],
=h(Px)(h^h)
=Px(|h|^2)
Noise power remains the same as before.
So, you can see that the signal energy is scaled by a factor of |h|^2, because of which the received SNR is going to be (|h|^2)Eb/No. So whether or not you use this kind of an EQ(ZFE), your SNR remains the same.
I think where we have used the EQ implicitly, is when we say the average BER is obtained by taking an expectation over the ‘old’ expression for a BPSK ber, i.e. 0.5*erfc(sqrt(gamma))(the instantaneous ber in this case). This has been derived assuming noise adds only along a single direction, while the effect of a random channel(with uniform phase distribution) would be to throw the constellation point anywhere in the signal space. So if you say the instantaneous BER is 0.5*erfc(sqrt(gamma)), then the channel model is x+n’ or utmost kx+n’ where k is real and n’ is Gaussian and using a zfe restores our situation to this model. Tell me if this sounds right to you. Thanks.

Krishna Sankar August 5, 2009 at 5:45 am

“It stems from the fact that the instantaneous SNR is (|h|^2)Eb/No, even when the EQ is not used”
[krishna] We can have different types of receivers. The most simplest type wont even consider that there was a channel and just do hard decision decoding on the received symbols. We might loose around 50% of the symbols, but still thats one type of receiver.
Another receiver type, which does division by the channel h, results in instantaneous SNR of (|h|^2)Eb/No.
So your statement that the instantaneous SNR is independent of equalizaton is not correct.

“This has been derived assuming noise adds only along a single direction”
[krishna] Its a kinda loose sentence, which I am finding difficult to comprehend. But, yes the noise is additive and not multiplicative. Note that additive noise can result in the transmitted signal to be anywhere in the signal space.

joel July 2, 2009 at 8:56 pm

Dear Krishna,
I have a question related to Rayleigh Multipath Channel. Lets assume that there is no white noise caused by the channel. Additionaly the transmitted signal will be up-mixed and then down-mixed, exactly as you described in the IQ-Imbalance article, but without the phase imbalance. So the structure looks like this :

Guard Insertion -> Up-Convertion -> Multipath Channel -> Down-Convertion -> Guard Removal -> Equalizer

The problem is that the received signal is disturbed. Since we have no AWGN, the signal is ideally equalized, right ? So, what can be resposible for the signal distortion , down-converter ? How could I repair the signal then ? Can you see any problems with the transmission/reception path I described ?

Regards
Joel

Krishna Sankar July 6, 2009 at 5:24 pm

@joel: The multipath channel causes a phase and amplitude distortion to the channel. That has to be removed (aka equalization) prior to demodulation. I do no see issues with the chain which you have described.

joel July 8, 2009 at 1:47 am

The thing is, that the equalizer removes the multipath distortion by dividing the output by the channel impule response. Since there is no noise, the qualization is ideal , i.e. Y = X*H/H = X. I actually suspected that the down-convertion introduces additional phase rotation which spoils the equalization. I hoped that you negate or confirm my assumptions.

Regards

Krishna Sankar July 15, 2009 at 4:47 am

@joel: What you said is probable. How are you estimating the channel. If you are estimating the channel by defining a known sequence (in frequency domain) at the transmitter, makes it pass through the model which you have described above, then estimate the channel @ the receiver, then the estimated channel will include the effects of multipath + phase rotations which may have occurred.

hugh June 24, 2009 at 4:35 pm

Hi Krishna,
I used your script for BER with FSK modulation in AWGN channel and modified to get BER with FSK modulation in Rayleigh channel. But there is some problem inside, i dont know that, following code which I changed is
% Matlab Script for computing the BER for Binary FSK modulation in a Rayleigh fading channel
clear
N = 10^5 % number of bits or symbols
T = 10; % symbol duration
t = [0:1/T:0.99]; % sampling instants
tR = kron(ones(1,N),t); % repeating the sampling instants
Eb_N0_dB = [0:11]; % multiple Eb/N0 values
for ii = 1:length(Eb_N0_dB)
% generating the bits
ip = rand(1,N)>0.5; % generating 0,1 with equal probability
freqM = ip+1; % converting the bits into frequency, bit0 -> frequency of 1, bit1 -> frequency of 2
freqR = kron(freqM,ones(1,T)); % repeating
x = (sqrt(2)/sqrt(T))*cos(2*pi*freqR.*tR); %generating the FSK modulated signal
% noise
n = 1/sqrt(2)*[randn(1,N*T) + j*randn(1,N*T)]; % white gaussian noise, 0dB variance
h = 1/sqrt(2)*[randn(1,N*T) + j*randn(1,N*T)]; % Rayleigh channel
y = h.*x + 10^(-Eb_N0_dB(ii)/20)*n; % additive white gaussian noise
equalization
yHat = y./h;
op1 = conv(yHat, sqrt(2/T)*cos(2*pi*1*t)); % correlating with frequency 1
op2 = conv(yHat, sqrt(2/T)*cos(2*pi*2*t)); % correlating with frequency 2
% demodulation
ipHat = [real(op1(T+1:T:end)) < real(op2(T+1:T:end))]; %
nErr(ii) = size(find([ip - ipHat]),2); % counting the number of errors
end
simBer = nErr/N;
theoryBerAWGN = 0.5*erfc(sqrt(10.^(Eb_N0_dB/10))); % theoretical ber
EbN0Lin = 10.^(Eb_N0_dB/10);
theoryBer = 0.5.*(1-sqrt(EbN0Lin./(EbN0Lin+2))); %theoretical BER
% plot
close all
figure
semilogy(Eb_N0_dB,theoryBerAWGN,'r-','LineWidth',2);
hold on
semilogy(Eb_N0_dB,theoryBer,'b-');
hold on
semilogy(Eb_N0_dB,simBer,'mx-');
axis([0 11 10^-4 0.5])
grid on
legend('theory:AWGN','theory:fsk-coh', 'sim:fsk-coh');
xlabel('Eb/No, dB')
ylabel('Bit Error Rate')
title('Bit error probability curve')
But why the theory and simulation curves are separated each other, they should cling tightly. Can you do me a favour to check and find a problem to get them closely?
Thanks,

bluray June 18, 2009 at 5:27 am

In the simulation model above, every fading coefficient is uncorrelated and affects only 1 bit. So, is it consider as uncorrelated fast fading? What are some of the ways to estimate the channel since we need it for equalization?

Krishna Sankar June 21, 2009 at 12:41 pm

@bluray: Yes, this is uncorrelated fast fading
Typically, there will be a preamble sequence which is known by both transmitter and receiver, using which receiver can form an estimate of the channel.

Ideal May 26, 2009 at 10:20 pm

Dear Krishna,

can you tell me how to plot the power angular profile for an incoming signal.

Krishna Sankar May 31, 2009 at 8:30 pm

@Ideal: Sorry, am not familiar with modeling angular profile.

fof May 19, 2009 at 12:32 am

hi……i saw youe code for alamouti STBC…..it’s a great one…..but i need a simpler one eventhough it’s too long…
i don’t know how to use functions equivelent to those you used with your code…. i need a very simple code using very simole function…..
so can anyone help me please??

Krishna Sankar May 20, 2009 at 5:45 am

@fof: Good luck.

nikitha May 23, 2009 at 9:56 am

hi krishna. First i would like to thankyou for answering the questions of all the people like me..
I have written a code for modelling OFDM using BPSK where the channel taps are given by h1=1 h2=0.5 h3=0.3 and i have used awgn channel. I am unable to figure out the mistake i have done in the code.Can u please help me??here is the code
nsubc=4;
nsym=1;
N=nsubc*nsym;
SNR=4;
a=sign(rand(1,N)-0.5);
a_vec=reshape(a,nsubc,nsym)
a_fft=sqrt(nsubc)*ifft(a_vec);
h=[1 0.5 0.3];
hnorm=h./norm(h);
chanipac=[a_fft(nsubc-1,:); a_fft(nsubc,:); a_fft];
for j=1:nsym
p=chanipac(:,j);
chanresp(:,j)=conv(p’,hnorm);
end;
n=1/sqrt(2)*(randn(nsubc+4,nsym)+i*randn(nsubc+4,nsym));
y=chanresp+10^(-SNR/20)*n;
for i=1:nsubc
cprem(i,:)=y(i+2,:);
end;
hfreq=fft(h,nsubc);
hfreqinv=1./hfreq;
hdiag=diag(hfreqinv);
o_fft=(1/sqrt(nsubc))*fft(cprem);
fde=hdiag*o_fft;
o=fde>0;
op_vect=2*o-1;
op=reshape(op_vect,1,N);
ber=size(find(a-op),2)
berrat=ber/N

Krishna Sankar May 31, 2009 at 8:08 pm

@nikitha: I did not probe deeply. However, from a quick look it seems that there are issues in subcarrier assignment. You may refer to the post on BER for BPSK in OFDM with Rayleigh channel @
http://www.dsplog.com/2008/08/26/ofdm-rayleigh-channel-ber-bpsk/
Hope this helps.

wafaa May 5, 2009 at 1:59 pm

hi all,
i’m modeling a SUI channel,i’ve already found a model that gives a matrix of the channel coefficients, but i don’t know how to add the channel effect to my OFDM modulated signal

thanks for anyone gives me a hand…

Krishna Sankar May 12, 2009 at 5:05 am

@wafaa: You can just convolve the ofdm time domain signal with the channel taps. Agree? You may use the code in the post
http://www.dsplog.com/2008/08/26/ofdm-rayleigh-channel-ber-bpsk/ for reference.

Ahmed April 18, 2009 at 4:33 pm

Thank you Krishna for all your efforts. The information you have posted about matched filter are very intersting for me

hayle April 8, 2009 at 8:35 am

hello sir
if we were to extende ofdm to ofdma how do i divide the sub carriers to say two users
thanks

Krishna Sankar April 11, 2009 at 6:58 am

@hayle: Simplistically, I can think of two approaches
- interleaved : where all even subcarriers are assigned to one user and odd subcarriers to another user
- block : where -ve subcarriers are asisgned to one user and +ve subcarriers to another user.

And between these two approaches, there can be lots of permutations possible.

S. Alam April 6, 2009 at 3:03 am

Hello Sir,
I am working on multi-relay cooperative communication system. I consider two hop communication and rayleigh fading channel with decode and forward relaying. Could you please send me the matlab program to determine the end-to-end (i.e., from source to relay and from relay to destination)outage probability under different relay selection strategy where all the relay nodes are distributed according to homogeneous Poisson point process in a circle of infinity radius.

Krishna Sankar April 11, 2009 at 6:16 am

@Alam: Sorry, I have not worked on co-operative communications.

Assad Abbasi May 22, 2009 at 4:50 pm

Dear S,Alam,

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 is assad.abbasi@yahoo.com.

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

thanks

mrKim November 13, 2012 at 8:42 am

Dear S.Alam
Did you find material for this problem ?

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.

mohammed April 5, 2009 at 2:14 pm

your simulation on the top was for BPSK in multipath and has 35dB at 10-4 which is the same value also for OFDM for multipath.if we were to say OFDM is better we expect to get a value less than this

thanks

Krishna Sankar April 11, 2009 at 6:13 am

@mohammed: As I said in my previous comment – in both the cases the signal experiences flat fading. Hence the BER performance is comparable.

mohammed April 5, 2009 at 2:09 pm

thanks kirshina
modifying BPSK do you mean using channels other than flat fadding for bpsk (give me an example)and OFDM i think is assumed flat fading .
thanks once againe

Krishna Sankar April 11, 2009 at 6:12 am

@mohammed : Yes, channels other than flat fading for BPSK.

mohammed April 2, 2009 at 9:01 pm

hi kirshina
for both bpsk and ofdm using bpsk on multipath your BER curve is alomst the same,and ofdm is said to superior in multipath can you explaine this to me
thanks

Krishna Sankar April 4, 2009 at 4:53 pm

@mohammed: The BPSK simulation was using flat fading channel and the OFDM simulations, thanks to cylcic prefix is also having a flat fading channel. Hence both the simulations are having identical performance.

However, if you modified the BPSK simulation to have a multipath channel, the performance will be much poorer than with OFDM.

R.Ramya March 27, 2009 at 10:53 pm

i got the answer: for which i have posted previously:
% For Slow Fading, Channel coefficients are the same over block transmission;
h_10 = sqrt(1 / 2) * abs(randn + j * randn) * ones(1, N);
h_20 = sqrt(1 / 2) * abs(randn + j * randn) * ones(1, N);

% For Fast Fading, Channel coefficients changes from one symbol to the other
h_10 = sqrt(1 / 2) * abs(randn(1, N) + j * randn(1, N));
h_20 = sqrt(1 / 2) * abs(randn(1, N) + j * randn(1, N));

But my question is:

As we all know small scale fading (based on Doppler spread) is divided in to

for fast fading, there is high doppler spread , channel variations are ofcourse faster than signal variations, coherance time symbol period , channel variations are slower than signal variations

How can one write code for simulating doppler spread ????

Can U help me by giving hint..

Krishna Sankar April 4, 2009 at 8:32 am

@R.Ramya: I have not tried simulating doppler, hence unable to help. Sorry.

R.Ramya March 27, 2009 at 10:08 pm

Hi,
I want to change it from slow fading to a fast fading.

% For Slow Fading, Channel coefficients are the same over block transmission;
h_10 = sqrt(1 / 2) * abs(randn + j * randn) * ones(1, N);
h_20 = sqrt(1 / 2) * abs(randn + j * randn) * ones(1, N);

what should i do for fast fading?
(For Fast Fading, Channel coefficients changes from one symbol to the other )

Ahmed March 25, 2009 at 1:45 pm

Greetings Krishna. Thank you for all these efforts. I want to ask you if there is a matlab code about using matched filter as an optimum binary detection. How can this simulated?Also equivalently the correlator reciever. How can I simulate the integrator?
Thank you very much.
Ahmed

Krishna Sankar April 4, 2009 at 7:41 am

@Ahmed: Thanks.
In most of the simulation models, I have assumed flat fading channels and did not use filtering. However, there are two post on transmit pulse shaping filters:
http://www.dsplog.com/2008/04/14/transmit-pulse-shape-nyquist-sinc-rectangular/
http://www.dsplog.com/2008/04/22/raised-cosine-filter-for-transmit-pulse-shaping/
You may modify one of these to adapt to BER computation using matched filtering at receiver. You may simulate the integrator as a convolution function.

% example matlab code snippet to show matched filtering with a rectangular tx pulse shaping filter
clear all
N = 7
am = 2*(rand(1,N)>0.5)-1 + j*(2*(rand(1,N)>0.5)-1); % generating random binary sequence
fs = 10; % sampling frequency in Hz
% recatangular filter
gt1 = ones(1,fs);
amUpSampled = [am;zeros(fs-1,length(am))];
amU = amUpSampled(:).’;
rt = conv(amU,gt1);

% matched filter
yt = conv(rt,gt1/10);
% extracting the samples
at = yt(10:10:end-10)
err = at-am

Hope this helps.

rim March 23, 2009 at 10:01 pm

hello every body,
I am doing search on multiuser detection and I need some help to simulate CDMA system over multipath rayleigh fading channel,

Krishna Sankar March 25, 2009 at 5:47 am

@rim: We have not yet written posts on CDMA systems. However, the multiuser detection problem can in general be viewed as a MIMO V-BLAST transmission scenario, where each spatial dimension acts as interferers for the other dimensions. Some equalization structures for a 2×2 MIMO with V-Blast are discussed in
http://www.dsplog.com/tag/mimo

Hope this helps.

Martin March 19, 2009 at 12:09 pm

hi all

i have 3 for-loops here

for kk=users
for ii=Eb_N0_dB

nErr(jj,ii) = size(find([ip- ipHat]),2);

end
end
end

figure
semilogy(Eb_N0_dB,simBer(1,: ,’mo-’,'LineWidth’,2);
……..code……..

y-axis is bit_error, x-axis is dB
if i want to show what the error rate for each useris. What should i put in
nErr(??,??)????

Krishna Sankar March 21, 2009 at 3:51 pm

@Martin: Maybe you should make a three dimensional matrix.
nErr(kk,jj,ii) = size(find([ip- ipHat]),2);
Both Matlab and Octave supports multi dimensional matrices.

pradip panchal March 18, 2009 at 10:53 pm

Hello sir,

Sir, I am Student of Research area, working on MIMO Adaptive equalizer, How to start in this area?

pls, help me if you have any matlab based simulation plz, send me guidelines.

thanks

Krishna Sankar March 21, 2009 at 3:49 pm

@pradip: Sorry, I have not tried simulatiing MIMO with adaptive equalizers. Were you looking for a channel tracking scheme?

wap March 11, 2009 at 2:43 pm

hi krishna we meet again ……..
I have problems,can you help me,…
1.what impact BPSK in high frequency?
2.in this script program have one error, I confused.can you fix the error?
this the program

% BER_sic=sim_sic_fn(SNR_dB, P, Nb, code_matrix, chan_type)
% return bit error rate of the sic receiver in AWGN or rayleigh fading
%
% PARAMETER:
% SNR_dB=signal-ti-nopise ratio in dB
% P=power control vector, P(i)=transmitted power of i-th user
% Nb=number of transmitted bit
% code_matrix=matrix of the spreading code used
% chan_type=channel type(1=AWGN, 2=rayleigh fading channel)
%
% output:
% BER_sic=bit error of the sic receiver
%
function BER_sic=sim_sic_fn(SNR_dB, P, Nb, code_matrix, chan_type)

BER_sic=zeros(size(SNR_dB));
K=length(P); %number of user

G(:,1)=code_matrix(33,:)’;
G(:,2:K)=code_matrix(1:K-1,:)’;

%generate the crosscorrelation matrix R
R=G’*G;

for p=1:length(SNR_dB),

SNR=10^(SNR_dB(p)/10);
SNRchip=SNR/N;

disp(‘processing..’)
error_count=0;

%loop for Nb symbol bits
for n=1:Nb,

%generate a bernoulli symbol, i.e. b=1 or 0
b=input_symbols(K,1);

if chan_type==1
A=sqrt(P’);
elseif chan_type==2
A=rayleigh(1,K).*sqrt(P’);
else
disp(‘invalid channel type’);
dbquit;
end

%transmitted sinal
X=G*(A.*b);

%generate the observed data
r=awgn_chan(x,SNRchip);

%assume that the codes are known and that they are
%perfectly synchronized
%matched filter output
y=G’*r;

%short users according tho their received powers
[y_sorted,sort_order]=sort(y.^2);
user_index=find(sort_order==1);
y_sorted=y(sort_order);
A_sorted=A(sort_order);
R_sorted=R(sort_order,sort_order);

%detect users successively
b_hat=zeros(K,1);
b_hat(K)=sign(y_sorted(K));

for u=K-1:-1:1,
b_hat(u)=sign(y_sorted(u)-sum(A_sorted(u+1:K).*R_sorted(u+1:K,u).*b_hat(u+1:K)));
end
b_hat(1)=sign(y_sorted(1)-interference_estimate(1));

%if detected symbol is incerrect, increment the error_count
%if b_hat(user_index)~=b(1)
error_count=error_count+1;
end

end

%carculating Bit Error rate i.e. the percentage of erroneous
%symbol estimates
BER_sic(p)=error_count/Nb;
end

thank before….

Krishna Sankar March 21, 2009 at 7:07 am

@wap: My replies:
1. Hmm… I dont think there is impact. By high frequency, were you refering to carrier frequency.
2. Sorry, in general. I refuse to debug the code. If you have explicit q’s I can try to answer them.

Hope this helps.

w@p March 25, 2009 at 5:57 pm

how in the code_matrix so that the program is replaced with the gold code? gold code so that this function can be called by sic…..

thanks…

Krishna Sankar April 4, 2009 at 7:46 am

@ w@p: Sorry, am not familiar with the code which you provided. Thanks.

Martin March 3, 2009 at 11:38 am

Hi~
Who can tell me how to establish
communicate with basestation 1*m error rate, it means 1 transmitter and m receivers
it is randomly pick one user

Krishna Sankar March 5, 2009 at 5:18 am

@Martin: You question is vague. Please state your requirement in bit more details to enable a reader to help.

Martin March 10, 2009 at 9:06 am

i need to produce a program like this requirement

we have m receivers and n users
randonly pick one user and communicate with Basestation
we need to cal.the 1*m error rate
1 mean 1 transmitter, m is receivers
and then run it 10^6 times, find out the error rate

also in this simulation, we need to use MRC
it is a cellular system only.

Please, i have not enough time to produce

Martin March 12, 2009 at 10:49 am

i try to produce it
am i right??

—————————–% Script for computing the BER for BPSK modulation in a

clear
N = 10^6 % number of bits or symbols

% Transmitter
ip = rand(1,N)>0.5; % generating 0,1 with equal probability
s = 2*ip-1; % BPSK modulation 0 -> -1; 1 -> 0

nRx = [1 2];

Eb_N0_dB = [-3:35]; % multiple Eb/N0 values, ratio of transmission power per bit to noise density

x1 = rand;
x2 = rand;
y1 = rand;
y2 = rand;

for jj = 1:length(nRx)

for ii = 1:length(Eb_N0_dB)

n = 1/sqrt(2)*[randn(nRx(jj),N) + j*randn(nRx(jj),N)]; % white gaussian noise, 0dB variance
h = 1/sqrt(2)*[randn(nRx(jj),N) + j*randn(nRx(jj),N)]; % Rayleigh channel

% Channel and noise Noise addition

d = sqrt((x1-x2).^2 + (y1-y2).^2);
sD = kron(ones(nRx(jj),1),s);
y = d^-2*h.*sD + 10^(-Eb_N0_dB(ii)/20)*n;

% equalization maximal ratio combining
yHat = sum(conj(h).*y,1)./sum(h.*conj(h),1);

% receiver – hard decision decoding
ipHat = real(yHat)>0;

% counting the errors
nErr(jj,ii) = size(find([ip- ipHat]),2);

end

end

simBer = nErr/N; % simulated ber
EbN0Lin = 10.^(Eb_N0_dB/10);
theoryBer_nRx1 = 0.5.*(1-1*(1+1./EbN0Lin).^(-0.5));
p = 1/2 – 1/2*(1+1./EbN0Lin).^(-1/2);
theoryBer_nRx2 = p.^2.*(1+2*(1-p));

% plot
close all
figure
semilogy(Eb_N0_dB,theoryBer_nRx1,’bp-’,'LineWidth’,2);
hold on
semilogy(Eb_N0_dB,simBer(1,:),’mo-’,'LineWidth’,2);
semilogy(Eb_N0_dB,theoryBer_nRx2,’rd-’,'LineWidth’,2);
semilogy(Eb_N0_dB,simBer(2,:),’ks-’,'LineWidth’,2);
axis([0 35 10^-5 0.5])
grid on
legend(‘nRx=1 (theory)’, ‘nRx=1 (sim)’, ‘nRx=2 (theory)’, ‘nRx=2 (sim)’);
xlabel(‘Eb/No, dB’);
ylabel(‘Bit Error Rate’);
title(‘BER for BPSK modulation with Maximal Ratio Combining in Rayleigh channel’);

—————————–

Krishna Sankar March 21, 2009 at 7:12 am

@Martin: Sorry, due to time constraints, its increasingly hard for me to debug the code. Good luck in your algorithm explorations.

Krishna Sankar March 21, 2009 at 7:00 am

@Martin: Sorry, I am not familiar with the system model which you proposing.

Martin March 2, 2009 at 8:47 am

Hi~
Who can tell me how to establish
communicate with basestation 1*m error rate, m is receiver
it is randomly pick one user

Krishna Sankar March 5, 2009 at 4:56 am

@Martin: You question is vague. Typically, one would want to have the error rate as low as possible.

Kenny March 1, 2009 at 12:13 pm

Do you still need the solution to simplify the Pb in Rayleigh Fading? I have the answer.

Krishna Sankar March 5, 2009 at 4:27 am

@Kenny: Thanks. However, Mr. Jose Antonio Urigüen kindly shared his findings. The URL:
http://www.dsplog.com/2009/01/22/derivation-ber-rayleigh-channel/

VINCENT February 25, 2009 at 9:19 pm

My program is fixed and reference to your program,I am trying to set a topology of M nodes which is 250,and then randomly pick 2 nodes and repeat 1000 times for each time,pick two nodes as tramitter and receiver and tranmsitt N=10^6 bits to the channel between them and calculate error performance.The error performance of the whole network is calculated and sum up all the d gives the total transmission power.
Now I would like to assume each node has a total pt= 100 so that for each pick up,each node used some of its energy to transmit and then therefore each node is different with the saved energy.i want to calculate the number of nodes that give zero in pt so that to plot a graph how many nodes alive against the time.my program is below: thank for you help

% Script for computing the BER for BPSK modulation in a Rayleigh fading channel

clear

N = 10^6 % number of bits or symbols

% Transmitter
ip = rand(1,N)>0.5; % generating 0,1 with equal probability
s = 2*ip-1; % BPSK modulation 0 -> -1; 1 -> 0

Eb_N0_dB = [-3:96]; % multiple Eb/N0 values

%Generate M nodes
M=250;
x1 = rand(1,M);
x2 = rand(1,M);
y1 = rand(1,M);
y2 = rand(1,M);
% initalize the total power
totalpwr = 0;

for ii = 1:length(Eb_N0_dB)
% Channel and noise Noise addition
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white gaussian noise, 0dB variance
h = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % Rayleigh channel

% randomly pick two nodes and calculate the distance between them
i = randint(1,1,[1,100]);
u = randint(1,1,[1,100]);
d = sqrt((x1(i)-x2(u)).^2 + (y1(i)-y2(u)).^2);
d

totalpwr = totalpwr+d^4;
y = d.^-2.*h.*d.^2.*s + 10^(-Eb_N0_dB(ii)/20)*n;
% equalization
yHat = y./h;

% receiver – hard decision decoding
ipHat = real(yHat)>0;

% counting the errors
nErr(ii,1) = size(find([ip- ipHat]),2);
end

% error performance of the whole network
whole_error = sum(nErr)/N;
whole_error
totalpwr
simBer = nErr/N; % simulated ber
theoryBerAWGN = 0.5*erfc(sqrt(10.^(Eb_N0_dB/10))); % theoretical ber
EbN0Lin = 10.^(Eb_N0_dB/10);
theoryBer = 0.5.*(1-sqrt(EbN0Lin./(EbN0Lin+1)));

% plot
close all
figure
semilogy(Eb_N0_dB,theoryBer,’bp-’,'LineWidth’,2);
hold on
semilogy(Eb_N0_dB,simBer,’mx-’,'LineWidth’,2);
axis([-3 96 10^-5 0.5])
grid on
legend(‘Rayleigh-Theory’, ‘Rayleigh-Simulation’);
xlabel(‘Eb/No, dB’);
ylabel(‘Bit Error Rate’);
title(‘BER for BPSK modulation in Rayleigh channel’);

VINCENT February 27, 2009 at 10:15 pm

Hi Kirshna ;
could you give me some hints on how to solve the problem or give guideance on how to solve,thank you very much.your help is much considerable as i really frustrated about this question for long

Krishna Sankar February 28, 2009 at 7:57 am

@Vincent: Sorry, I am not familiar with the scenario which you are proposing (and hence unable to help).

VINCENT February 28, 2009 at 10:05 am

Krishna,

Krishna Sankar March 1, 2009 at 6:58 am

@vincent; I just realized a typo in my message. I wanted to say – I was not familiar with the scenario which you presented (and hence unable to help).

Filbert February 24, 2009 at 8:27 am

Khrisna,
Thank you for your explanation. But i think we should consider the Doppler shift in Rayleigh channel. What do you think? Thank you

Krishna Sankar February 26, 2009 at 5:59 am

@Filbert: I have not tried modeling Doppler. Let me try to do some reading and get back to you.

Street hawk August 27, 2009 at 7:04 pm

The fading considered in your program is Flat and Slow rayleigh fading where there is no doppler spread i.e. max doppler shift (fm=v/lamda) is zero. Am I right?

Krishna Sankar September 7, 2009 at 5:14 am

@Street hawk: Its flat fading, no doppler spread. However, the channel varies randomly from each symbol. So its fast fading.

giro82 December 21, 2009 at 4:10 am

I think that if channel is changing every symbol it is mean that it is slow fading (To>Ts, where To- channel coherence time; Ts -symbol duration). Fast fading is when channel is changing several times during symbol (To<Ts).

Filbert February 23, 2009 at 9:50 am

Khrisna,
Thank you for your response. There is a problem about your Matlab’s script i do not understand. For Rayleigh channel you write:

h = 1/sqrt(2)*[randn(1,N)+j*randn(1,N)]

I notice that the formula for h and n (AWGN) is the same. Why?

I think you just generate random complex number for Rayleigh channel. Is it suppose to have its own model, not just random complex number? Thank you

Krishna Sankar February 24, 2009 at 5:34 am

@Filbert: Well, the Rayleigh channel can be modeled as independent Gaussian random variables on the real and imaginary compnents. The factor 1/sqrt(2) to normalize the power of h to unity. You may look @
http://www.dsplog.com/2008/07/14/rayleigh-multipath-channel/
for bit more details.

Further, note that h is multiplied on the transmit signal, whereas n is added to the transmit signal. So the effects of h and n are different.

Hope this helps

Jamil November 6, 2010 at 12:19 am

Hi Krishna..

Good day. You told that sqrt(1/2) is used to make the variance unity. However, in Matlab. by default, when you use ‘randn’, it creates gaussian random variables with zero mean and variance 1. So does it really necessary to multiply with sqrt(1/2)?

-Jamil

Krishna Sankar November 14, 2010 at 10:37 am

@Jamil: Recall, we create two random variables, one for real and another one for imaginary. So to make the variance of the total variance to unity, the factor of 1/sqrt(2) is used.

Filbert February 22, 2009 at 1:45 pm

Hi Krishna,
How are you? I hope you are fine. I tried to simulate BER for OFDM transmission via Rayleigh channel. I wonder if in OFDM receiver i need equalization? I did not use equalization and i got poor BER. Thank you

Krishna Sankar February 22, 2009 at 2:31 pm

@Filbert: Yes, we need equalization. Without equalization, the random gain and phase error introduced by the channel results in high BER.

ranjay February 19, 2009 at 2:32 pm

hi…….can u plz tell me how can i find the ber of a qpsk in rayleigh fading channel.

Krishna Sankar February 21, 2009 at 7:37 am

@ranjay: Did you want to try modify the Matlab code for BPSK and extend to QPSK case.

Arvind February 16, 2009 at 10:06 am

Hi Krishna,

How do you consider the effect of interference in this simulation ?. Suppose the interference is another BPSK modulated signal. Can you replace SNR with SINR to compute BER ?.

Arvind

Krishna Sankar February 21, 2009 at 7:08 am

@Arvind: Yes, the signal can be corrupted by another BPSK modulated signal. However, I would think that the BER performance will be poorer in that case.

vasundhara January 29, 2009 at 10:50 pm

IEEE TRANSACTIONS ON COMMUNICATIONS, VOL. 56, NO. 2, FEBRUARY 2008 213
RAKE Reception with Finger Reassignment
Seyeong Choi, Member, IEEE, Mohamed-Slim Alouini, Senior Member, IEEE,
Khalid A. Qaraqe, Senior Member, IEEE, and Hong-Chuan Yang, Senior Member, IEEE
Abstract—We propose and analyze in this paper a new finger
assignment technique that is applicable for RAKE receivers when
they operate in the soft handover (SHO) region. This scheme
employs a new version of generalized selection combining (GSC).
More specifically, in the SHO region, the receiver uses by default
only the strongest paths from the serving base station (BS)
and only when the combined signal-to-noise ratio (SNR) falls
below a certain pre-determined threshold, the receiver uses more
resolvable paths from the target BS to improve the performance.
Hence, relying on some recent results on order statistics we
attack the statistics of two correlated GSC stages and provide
the approximate but accurate closed-form expressions for the
statistics of the output SNR. By investigating the tradeoff among
the error performance, the path estimation load, and the SHO
overhead, we show through numerical examples that the new
scheme offers commensurate performance in comparison with
more complicated GSC-based diversity systems while requiring
Index Terms—Fading channels, diversity techniques, RAKE
receiver, generalized selection combining (GSC), performance
analysis.

Leona January 25, 2012 at 6:23 pm

Hi I am looking for generalized selection combining for QPSK (or for anything else). Any help please where can I find it?

Krishna Sankar January 26, 2012 at 6:27 am

@Leona: You can look at the post on Selection Diversity for BPSK case

Abrar January 22, 2009 at 10:45 am

Hi Kirshna Thanks for ur reply.
Please see this code , I am confused how i added the two version of signal received from two Taps with one sample delay.Initially I have done IFFT of the signal with Four subcarriers.Please guide me.
x=transdata1;
taps=2;
p1=1;
p2=0.8;
gain1=sqrt(p1/2)*[randn(1,length(x)) + j*randn(1,length(x))];
gain2=sqrt(p2/2)*[randn(1,length(x)) + j*randn(1,length(x))];
channel_ifft=ifft([gain1,gain2],length(x));
n=1:length(x);
delay1=1;
for n=delay1+1:length(x) % Delay of one sample in second tap
x1(n)=x(n-delay1);
end
transdata=channel_ifft.*(x+x1); % confusing here

noise = 1/sqrt(2)*[randn(1,length(x)) + j*randn(1,length(x))]; % Noise
snr = [0:10]; % multiple Eb/N0 values
ps=mean(abs(x).^2); % Power of the transmitted signal
for i = 1:length(snr)
y = transdata + (sqrt(3*ps)*10^(-snr(i)/20))*noise; %Addition of Noise

recdata=y;
rx0=recdata.*(1./(channel_ifft)); %Equilizatiom

Take care.

Fang January 16, 2009 at 8:50 am

Hi!

For those who are looking for a more accurate model of the fading coefficients can read the paper by Christos Komninakis and download the program he wrote at:

http://www.ee.ucla.edu/~chkomn/RayleighFiles/files.html

It’s very accurate for fast fading channels!

Krishna Sankar January 17, 2009 at 8:53 am

dean January 11, 2009 at 8:36 am

please help me to solve the following writing the matlab code about RCPC code family with memory M = 4 and puncturing period P = 8
and choose overall code rate R = 1/4 with source block size K = 128 bits.

it is very urgent for me. if u could do it for me i would be very thankful to you.

thanks
dean

Krishna Sankar January 13, 2009 at 5:45 am

@dean: Am sorry, I typically help people in their simulation model development rather than code myself. You may look at the post on convolutional coding, Viterbi decoding and hopefully modify them to suit your requirements.
Good luck.

Abrar January 11, 2009 at 7:48 am

Hi Kirshna
i have three taps and showing below the channel description.
I produced the delay of one and two samples in 2nd and third taps.
can u guide me how I equlize the channel now.
x=transdata1;
taps=3;
p1=1;
p2=0.8;
p3=0.5;
gain1=sqrt(p1/2)*[randn(1,length(x)) + j*randn(1,length(x))];
gain2=sqrt(p2/2)*[randn(1,length(x)) + j*randn(1,length(x))];
gain3=sqrt(p3/2)*[randn(1,length(x)) + j*randn(1,length(x))];

n=1:length(x);
delay1=1;
delay2=2;
for n=delay1+1:length(x)
x1(n)=x(n-delay1);
end
for n=delay2+1:length(x)
x2(n)=x(n-delay2);
end
transdata=gain1.*x+gain2.*x1+gain2.*x2;

noise = 1/sqrt(2)*[randn(1,length(x)) + j*randn(1,length(x))]; % Noise
snr = [0:10]; % multiple Eb/N0 values
ps=mean(abs(x).^2); % Power of the transmitted signal
for i = 1:length(snr)
y = transdata + (sqrt(3*ps)*10^(-snr(i)/20))*noise; %

Thanks.

Krishna Sankar January 13, 2009 at 5:52 am

@mabrarbari: If I may, I find the code snippet which you have provided bit confusing. Some questions:
1. Why is each path gain1, gain2, gain3 having length of the input vector. I would have thought that each path is a single element.
2. Instead of using the for loop’s you could have used a convolutional operator.

In the code snippet, your channel is not a flat fading channel. Need to formulate the multipath channel as matrix and solve the equation.

Abrar January 13, 2009 at 11:03 am

Thanks Kirshna;
Yes I have created frequency selective fadded channel in which there is a one sample delay in taps.if i made power of tap 2 and 3 zero it becomes flat fadding and zeroforcing equlizer can be used. but if these two taps are used then how i equilize the channel.
1- Can I go for normalize the channel.
2- can u give me any othe alternate to represent frequency selective channel.
Take care.

Krishna Sankar January 16, 2009 at 6:18 am

@Abrar: May I try to provide you a simple Matlab code snippet for equalization in the case of a 3 tap channel.

clear all;close all
x = 2*(rand(1,7)>0.5)-1 % input sequence
h = [ 1 2 3]; % channel
op1 = conv(x,h); % output of channel

hM = toeplitz([h(1) zeros(1,length(x)-1) ], [h zeros(1,length(x)-1) ]); % writing the channel using toeplitz matrix
op2 = x*hM ; % finding the output using the matrix multiplication way
op1 – op2; % verifying that both the outputs are the same. This confirms that toeplitz way of representing h is correct.

xHat = op2*pinv(hM) % dividing received symbol with pseudo inverse of the channel to perform equalization

The code performs the simple zero forcing equalization. To represent mathematically, the convolution operation is represented as product a vector and a matrix. At the receiver, we divide by the matrix to get the equalized channel estimate. This is described in detail in Chapter 3.4.3 of Digital Communications: Fundamentals and Applications by Bernard Sklar

Hope this helps.

shoumi January 8, 2009 at 3:24 pm

Dear sir

At first i want to give you thank for this interesting blog…..i go through ur posts of matlab code these are really helpfull for me. As i am a new user of matlab i faced some problem during coding. i will be very grate full to you if u help me to coding this using matlab:

Calculate path loss between 3 wireless node.By considering the following parameters: BPSk modulation, AWGN channel, transmitter power 15 dB, frequency 2.4 Ghz, patloss exponent 3, refercence distance 1 km. Assume that one node A is transmitting and 2nd node B is receiving signal,as the 3rd node C is located near to the node B it also recieve some signal . i have to calculate the recieved signal to noise ratio at node B and C.
It would be nice if u help me by giving some code or any suggestion. I can not understand how to start ……Please reply me…..i am waiting for your reply……

with regards
shoumi….

Krishna Sankar January 10, 2009 at 9:24 am

@Shoumi:
From your problem statement, it seems like you are looking for finding the path loss from between A to B and A to C.
Given that you know the transmit power, path loss exponent, and the distance, it should be reasonably easy to find the received signal power. Once the received power is known, based on the noise floor of each receiver (ideally depending on noise bandwidth), SNR can be computed.
http://en.wikipedia.org/wiki/Log-distance_path_loss_model

Hope this helps.

shoumi January 15, 2009 at 2:47 pm

Thank u for ur reply. Yes i calculate the received power for each node. Now for calculating the SNR for each receiving node ..i have to know the noise at each each receiver. Please inform me what do you mean by noise floor…is it AWGN noise???..
Awgn noise is a complex value..and the recived signal is in dBm unit. for calculating the SNR these unit must be same…how can i conver the awgn noise into dBm..Please help me regarding this….

Krishna Sankar January 16, 2009 at 6:24 am

@shoumi: Yes, the noise is complex. But the noise power can be represented in dBm. For example, assume the receiver bandwidth is 20MHz. The noise floor in dBm = -174+10*log10(20e6) = -101dBm.
You may find bit more details on the equation @ http://en.wikipedia.org/wiki/Thermal_noise

Hope this helps.

Abrar January 6, 2009 at 8:37 am

Hi
Kirshna
I am away some time from country , now come back and start working.
As u made equilization by just dividing the received signal through channel, any other way to equilizing.
if channel become zero then wht happen if we used equlization by dividing.
I have defined the channel as

x=transdata1;
taps=3;
p1=1;
p2=0;
p3=0;
gain1=sqrt(p1/2)*[randn(1,length(x)) + j*randn(1,length(x))];
gain2=sqrt(p2/2)*[randn(1,length(x)) + j*randn(1,length(x))];
gain3=sqrt(p3/2)*[randn(1,length(x)) + j*randn(1,length(x))];

n=1:length(x);
delay1=1;
delay2=2;
for n=delay1+1:length(x)
x1(n)=x(n-delay1);
end
for n=delay2+1:length(x)
x2(n)=x(n-delay2);
end
transdata=gain1.*x+gain2.*x1+gain2.*x2;

noise = 1/sqrt(2)*[randn(1,length(x)) + j*randn(1,length(x))]; % Noise
snr = [0:10]; % multiple Eb/N0 values
ps=mean(abs(x).^2); % Power of the transmitted signal
for i = 1:length(snr)
y = transdata + (sqrt(3*ps)*10^(-snr(i)/20))*noise; %
At receiver how I equlize it.

Krishna Sankar January 10, 2009 at 9:06 am

@Abrar: If the channel becomes close to zero, equalization by dividing by the channel results in noise amplification.

R.Ramya December 28, 2008 at 10:15 pm

Sir,
Thank you for giving me the hint.
As you said, 2.TO NORMALIZE THE RECEIVED POWER,

% Calculation of normalization factor to
%make the average power of output signal to 1
norm_fact = sqrt(sum(tap_weights_ln.^2));

1.TO NORMALIZE EACH TAP WEIGHT:
I divided taps_weights by sqrt(length(tap_Weight_ln)).

tapWtdB = [ -5 -10 -15 -20 -25];
tap_weights_ln = 10.^(tapWtdB/20);
taps=1/sqrt(2)*(randn(10^4,length(tapWtdB)) + j*randn(10^4,length(tapWtdB)));
taps_weights = taps.*repmat(tap_weights_ln, 10^4,1);
norm_each_tap_weight=taps_weights/sqrt(length(tap_weights_ln));
norm_fact = sqrt(sum(tap_weights_ln.^2));
taps_norm = 1/norm_fact*norm_each_tap_weight;
z=mean(abs(taps_norm ).^2);
est_tap_weight_db=10*log10(z)
total_path_gain_of_channel=sum(mean(abs(taps_norm).^2,1))
o/p:
est_tap_weight_db = -8.6703 -13.5813 -18.6063 -23.6805 -28.6429
total_path_gain_of_channel = 0.1991

Here, the total path gain of the channel is not close to one.(very less comparatively)
(but the estimated tap weight is close to the original tapweight(dB) ,ofcourse,
its value is less because of normalisation)
since,total path gain of the channel is not close to 1.
Is it acceptable one Sir?

R.Ramya December 20, 2008 at 3:51 pm

Thank you for your response sir.

In the last post You wrote:
Matlab/octave code snippet to illustrate:
tapWtdB = -15
h = 10^(tapWtdB/20)*1/sqrt(2)*[randn(1,10^4) + j*randn(1,10^4)];
estTapWt = 10*log10(h*h’/length(h))

estTapWt is obtained very close to -15dB.

I think length(h) in estTapWt is Normalisation factor.

In case of Multiple taps

tapWtdB = [0 -20 -21];
tapWtdB_linear=10.^(tapWtdB/20);
h = 1/sqrt(2)*[randn(10^4,length(tapWtdB)) + j*randn(10^4,length(tapWtdB))];
taps_weights = h.*repmat(tapWtdB_linear, 10^4,1);
z=mean(abs(taps_weights/sum(tapWtdB_linear)).^2);estTapWt=10*log10(z);estTapWt

estTapWt =

-1.5181 -21.4893 -22.5174

PowerdB level is someWhat close to the original tapWtdB. This happens becuase of the Normalisation (1/sqrt(2)) in h line in tha Matlab code.

But, if the tapWtdb is [-15 -20 -21];

tapWtdB = [-15 -20 -21];
tapWtdB_linear=10.^(tapWtdB/20);
h = 1/sqrt(2)*[randn(10^4,length(tapWtdB)) + j*randn(10^4,length(tapWtdB))];
taps_weights = h.*repmat(tapWtdB_linear, 10^4,1);
z=mean(abs(taps_weights/sum(tapWtdB_linear)).^2);estTapWt=10*log10(z);estTapWt

estTapWt =

-6.3169 -11.3482 -12.2874

Here the difference between the consecutive taps power level (db) is satisfied. estTapWt value is not closer to original original value.

My question is
Whether the first tap necessarily be 0dB or someother dB value.If we can have some other value of power dB for the first tap then Can U please correct the Matlab code inorder to get original tapWtdB.

Krishna Sankar December 25, 2008 at 7:23 am

@Ramya: In the case of multiple taps, there are two aspects:
1. Firstly, one would want to normalize each tap such that the relative power is as per the tap weight. This can be accomplished by scaling each tap as in the example which I have shown earlier.
2. Secondly, to normalize the received power, one may want to make the average power from many such channel realizations to unity.
Hope this helps.

R.Ramya December 18, 2008 at 11:10 pm

Sir,
I understood & got the answer for the last two questions Which i have posted previously.

question :2
After modelling has absolute value of complex gaussian R.Vs, from the Power delay profile,
we have the Tap weights in dB. Since the variance of rayleigh R.V. h is 1.
Tap_weight_db here in our case is = 0 dB.
In linear scale its value is 1.
Tap_weight = h*(10^(Tap_weight_db)/10 )=h*1=h
As per theory,the received signal r is written as

r=(Tap_weight * s) + n;

question 3:
whether the tap (in flat fading)will occur at 0 microseconds 0r 0 ns i.e., without delay.or shall the tap occur after some particular delay?

The tap doesn’t actually occur at 0 microseconds.
These delays are relative to the delay of the tap to which demodulator synchronizes.

But my first question was
In BER_simulation_BPSK_Rayleigh_channel Matlab Code:

given two lines seems to be same
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)];% WGN,0dB variance
h= 1/sqrt(2)*[randn(1,N) + j*randn(1,N)];% Rayleigh channel

From theory, h=sqrt(X^2+Y^2)=abs(X+jY);
Why ‘abs’ have not been included ?

R.Ramya December 18, 2008 at 7:23 am

Sir,
I saw your Matlab code for BER_simulation_BPSK_Rayleigh_channel.

As Rayleigh channel is modelled as |h|
|h|=1/sqrt(2).sqrt(X^2+Y^2)=1/sqrt(2).abs(X+jY)
if X & Y are two gaussian R.Vs with zero mean and Variance of 1/2 each.
In the Matlab code,
% white gaussian noise, 0dB variance
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)];
% Rayleigh channel
h= 1/sqrt(2)*[randn(1,N) + j*randn(1,N)];

My question are:
1.Both the above lines are same ( even though complex guassian R.V.s were used)

Whether the line given below is correct.
Rayleigh R.V. h=1/sqrt(2).*abs([randn(1,N) + j*randn(1,N)]);

if it is not correct kindly explain me, why ‘abs’ should be used?

2.After modelling h, from the Power delay profile,
we get the Tap weights in dB .(In our case as theory suggest, since flat fading has been used no. of taps will be only one)
Shall we convert tap weights in dB to linear scale and multiply with h and txmitted signal s (since inourcase only one tap is being considered for flat fading, convolution becomes multiplication) and add gaussian noise(which is implemented by mutiplying with Guassian Noise with linear scale Eb_No)

3. For flat fading, since the no. of taps is one. my question is whether that particular will occur at 0 microseconds 0r 0 ns i.e., without delay.or shall that tap can occur after some particular delay.
Am i correct in this regard.

sorry for troubling U sir, as i am struggling to get hold of things right.This is my first sincere effort in learning digital comm conceps clearly.

Krishna Sankar December 19, 2008 at 6:32 am

@Ramya:
1. With the Rayleigh channel, it is assumed that the phase distortion caused by the channel can be uniformly distributed between 0 to 2pi. Hence we model it as independent complex Gaussian random variable for real and imaginary component
Please look at http://www.dsplog.com/2008/07/14/rayleigh-multipath-channel/ for bit more details.

2. I agree that since we are assuming flat fading, the power delay profile has only one tap. We should scale the variance of channel h in accordance with the gain of the power power delay profile. Note that you should use 10^(-tapWeightdB/20) and not 10^(-tapWeightdB/10) . A quick Matlab/octave code snippet to illustrate:
tapWtdB = -15
h = 10^(tapWtdB/20)*1/sqrt(2)*[randn(1,10^4) + j*randn(1,10^4)];
estTapWt = 10*log10(h*h’/length(h))
3. Typically there will be small delay. However, typical receivers will be having a packet detection circuit which can estimate the start of the symbol. Hence for modeling purpose we can assume that there is zero delay.

Alex December 17, 2008 at 8:14 pm

hi there,
First, thanks for sharing the understanding of this subject. Regarding the missing part, one can find it on Page 823 in the book, CDMA System Engineering Handbook.
It is all about some mathematic manipulations, while the Q(.) function is used to replace the erfc function in the expression.

Krishna Sankar December 18, 2008 at 6:15 am

@Alex: Thanks. Let me try to get my hands on the book.

Krishna Sankar November 22, 2008 at 7:40 am

@Shefo666: I think the ZF equalizer is optimal in SISO systems.

With a simple Matlab/Octave script may I try to show that ZF and MMSE equalizer gives the same BER. Infact, am not sure whether we can call it as ZF/MMSE equalization – as there is no interference terms.

% Matlab/Octave code snippet for comparing zero forcing and MMSE equalization for SISI
clear
N = 10^4 % number of bits or symbols
ip = rand(1,N)>0.5; % generating 0,1 with equal probability
s = 2*ip-1; % BPSK modulation 0 -> -1;
Eb_N0_dB = 3;
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white gaussian noise, 0dB variance
h = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % Rayleigh channel
% Channel and noise Noise addition
y = h.*s + 10^(-Eb_N0_dB/20)*n;

% equalization
yHat_zf = y./h; % zf equalization
yHat_mmse = 1./(h.*conj(h)+ 10^(-Eb_N0_dB/10)).*conj(h).*y; % mmse equalization

% receiver – hard decision decoding
ipHat_zf = real(yHat_zf)>0;
ipHat_mmse = real(yHat_mmse)>0;

% counting the errors
nErr_zf = size(find([ip- ipHat_zf]),2)
nErr_mmse = size(find([ip- ipHat_mmse]),2)

Can see that nErr_zf and nErr_mmse is the same. Hope this helps.

WirelessNewbie September 3, 2009 at 3:43 pm

Hi Krishna

(Introduction to Space Time Communications)
Which gives a comparison of ZF, MMSE,etc for SISO
It shows MMSE is better than ZF for SISO.

Regards

WirelessNewbie September 3, 2009 at 3:44 pm

Page 141

Krishna Sankar September 9, 2009 at 5:32 am

@WirelessNewbie: Sorry, the page 141 is not available from the link you provided. Let me try to get the book from the library, and I will respond.
One query: Is the claim that “ZF is better than MMSE for SISO” for a flat fading channel?

Shefo666 November 21, 2008 at 5:18 am

Dear Krishna Pillai,

Thanks for the very interesting blog ..
I am wondering whether it makes any sense to apply MMSE and ML equalization on SISO communication systems in order to get over the ZF equalization major problem of noise enhancement (when channel is in deep fade).
In such a case, how is the theoretical BER performance of BPSK (for instance) over flat rayleigh (given by proakis, Digital communications) affected ? can u reccommend any papers that calculate the theoretical BER performance of ML and MMSE equalization over flat fading .. Most papers i got assume ZF equalization when it comes to SISO systems !

Krishna Sankar November 15, 2008 at 8:27 am

@Tahmid: Moving the simulation to 4-QAM should be reasonably simple. First thing is that we will be sending information on both real and imgainary arms. Correspondingly, use the information from both real and imaginary arms while demodulating.

You can use the Matlab model provided here
http://www.dsplog.com/2007/11/06/symbol-error-rate-for-4-qam/
as reference.

Hope this helps.

Krishna Sankar November 15, 2008 at 8:17 am

Krishna Sankar November 15, 2008 at 8:01 am

@Abrar: Thanks for the comment. Sorry for the delayed response. I was travelling.

Typically for channel estimation, we send a known sequence (called preamble). Using the knowledge of the known sequence and what we received, we can estimate the channel.

For eg, in a multi-carrier OFDM system, the system model can be written as
Y = HX + N where
Y – is the received symbol on subcarrier k
H – is the channel on subcarrier k
X – is the transmitted symbol on subcarrier k
N – is the noise on subcarrier k

Since X is known, the estimate of H is,
H^ = Y/X

Does this help?

Tahmid November 14, 2008 at 1:30 pm

Hi Krishna,

I am trying to follow this tutorial and extend it further to simulations for 4-QAM over Rayleigh fading channels. Could you please tell me how the code to apply the fading channel would change from the BPSK case. thanks

Muhammad November 14, 2008 at 12:45 am

I was in need to compute the Bit error rate of BPSK and QPSK in AWGN and Rayleigh fading channel.

After finding this document, i was very happy as it improve my knowledge and releive my burden.

Thanks for all

Abrar November 10, 2008 at 3:42 am

Hi Kirshna
thanks for ur reply and sorry for the t I am saying thanks very late bec i am busy in my exam.Hoping U r fine, may GOD bless u. I am doing Postgraduate diploma in Massey University New Zealand.
I am doing simulation on MC-CDMA. So I need ur help in modeling frequency selective channel. if u have any code about frequency selective chanel estimation, it will helpful for me. I am try to do so I will send u code if I have have succeded to some extent.
abrar

Krishna Sankar November 7, 2008 at 6:43 am

@Sky: 1/sqrt(2) is for normalizing the channel gain to unity. I think it is required, as the derivations are for unity channel gain.

Sky Stradlin November 6, 2008 at 7:32 pm

Hi,
Could you please explain on how you get
h = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; for Rayleigh?

Coz I think, it should be just randn(1,N) + j*randn(1,N)

Thanks

Krishna Sankar November 5, 2008 at 5:34 am

@Leon: Thanks. The derivation has been pending for a while from my side. Let me try to go over it by over the week.

Leon Craven November 3, 2008 at 12:08 pm

Hi Krishna,

Jussi Poikonen is correct, you can determine the double integral in this fashion to obtain the desired result.

Krishna Sankar October 29, 2008 at 9:55 am

@davis: Sorry for the delayed response, I was down with viral fever.
I had written a post on BFSK some time in the past.
URI: http://www.dsplog.com/2007/08/30/bit-error-rate-for-frequency-shift-keying-with-coherent-demodulation/

The post describes BFSK in AWGN case. You can convolve the transmit signal x with the impulse response of the channel (lets say h) before adding the noise n.

Krishna Sankar October 29, 2008 at 9:51 am

@Abrar: Sorry for the delayed response, I got bogged down by viral fever.
Yes, this is a simple form equalization, which basically tries to make the effective channel as impulse. Since this a simple one tap channel, the equalization becomes just a division. This can be classified as a simple zero-forcing linear equalization. You can read more about equalization in Chapter 8 of
Digital Communication: Third Edition, by John R. Barry, Edward A. Lee, David G. Messerschmitt.
Hope this helps.

davis October 27, 2008 at 2:34 am

Hello Kirshna
I doing project on bfsk with rayleigh multipath chanel
i wish to ask you if I use not an envelop but modulated fsk
0->cos(f1*t) and 1->cos(f2*t)
how can I simulate rayleigh multipath chanel for bfsk in this case?
thank you
Davis

Abrar October 25, 2008 at 8:36 am

Hi Kirshna:
hoping u r fine.
I just want to ask about equlization which u have done here just by dividing by channel. is it another method of equlization.
can u give some explation about equlization or refer some material about it, bec, I want to understand it.
Tahnks and take care.
abrar

Sairam October 20, 2008 at 10:32 pm

yES SIR
IT IS USED IN OPTICAL COMMUNICATIONS.

Krishna Sankar October 19, 2008 at 6:42 pm

@Sairam: Ok, thanks. Are there some practical systems taking advantage of non-orthogonality to improve spectral efficiency. Can you please point me to the same.

Sairam October 18, 2008 at 3:27 pm

it can be obtained if the orthogonal condition is not satisfied. But the derivations become more complicated. the advantage is that it provide high spectral efficiency. ok sir thank u for ur fast response

Krishna Sankar October 17, 2008 at 10:16 pm

@sairam: By non-coherent, hope you meant a scheme like DBPSK. Correct? I have not tried to discuss the deivation for BER with non-coherent modulation in any blog post yet. Something for me to look at.

Can you give an example for non-orthogonal modulation?

Sairam October 16, 2008 at 10:05 pm

Sir
How to derive the probability error of Non-coherent Non-Orhogonal modulation. TRhanking you sir!!

Krishna Sankar October 16, 2008 at 9:26 pm

@Jussi Poikonen: Thanks for the guidance. Let me try to go over the steps per your suggestion.

Jussi Poikonen October 15, 2008 at 12:42 am

You will find that the missing steps in the derivation above can be completed by writing open the final (double) integral, and changing the order of integration. That is, integrate first with respect to gamma from 0 to x^2 (where x is the argument of the complementary error function), and then with respect to x from 0 to infinity. The integration problem is finally reduced to single integrals from 0 to infinity over zero-mean Gaussian distributions.

Krishna Sankar October 7, 2008 at 5:01 am

@Varun: Probability of error in Rayleigh fading channel.

Krishna Sankar October 7, 2008 at 5:01 am

@nano686: This post does the simulation with a Rayleigh channel. Further, there are quite a few posts on Rayleigh channel
URI: http://www.dsplog.com/tag/rayleigh/
Hope this helps.

nano686 October 6, 2008 at 8:16 pm

Hi,
I don’t know simulate Rayleigh channel by Matlab. Can you help me?
Thanks and Regards.

V Varun October 4, 2008 at 12:05 pm

@ Pillai

Which equation ? Is it the probability of error in a Rayleigh fading channel or the probability of error in a AWGN channel ? Let me know so that i can come up with a solution if i know

Krishna Sankar October 4, 2008 at 10:14 am

@Varun: Yes, here the random variable is instantaneous SNR. Btw, do you know how to complete the proof? I have not figured that out. Kindly let me know, if you can prove the equation.
Thanks.

V Varun October 3, 2008 at 8:45 am

@Krishna Pillai

Thanks a lot for giving me a reply. So this is similar to finding the mean of a random variable right !!! Here the random variable is instantaneous SNR right !!! Comment on this statement Sir !!!

Krishna Sankar October 2, 2008 at 8:14 pm

@Varun: Because of Rayleigh fading, the instantaneous SNR for a particular channel realization is |h|^2*Eb/N0. So, to find the average bit error rate, we need to average over all channel realization. Hence we average over the conditional error probability. Does that help?

V Varun October 2, 2008 at 4:15 pm

Hi,

In order to find probability of error in a rayleigh fading channel we will average the conditional probability of error of the particular modulation scheme in AWGN channel over the rayleigh probability density function. Why we do this ? Please give explanation.

Thanks and Regards,
V Varun.

khurshid September 8, 2008 at 6:58 pm

thanks krishna
actually i have to show the performance comparison of different strategies of cooperative communication…..
different combining techniques at receiver may also be considered but not compulsory…..

it is quit similar to relaying…..

i have sent some matlab codes on krishna at dsplog com
it shows some error which i fail to removed.

Krishna Sankar September 8, 2008 at 9:47 am

@khurshid: Sorry, I can help with your coding but not do coding for you.
As a first step, you may try to create a packet error rate simulation environment with the above mentioned parameters. Are you using OFDM?

khurshid September 7, 2008 at 12:09 am

hello!
Assume BPSK modulation with equal user transmit
powers. The channels between users (interuser) and to the
base station (uplink) are mutually independent with flat,
Rayleigh fading that remains constant over each source block
(quasi-static fading). Each receiver has perfect CSI and employs coherent detection, and we quantify the quality of each channel by its average received SNR. We use the RCPC code family with memory M = 4 and puncturing period P = 8
and choose overall code rate R = 1/4 with source block size K = 128 bits.

if more detail is needed please inform me…
it is very urgent for me. if u could do it for me i would be very thankful to you.

thanks
khurshid

lealemta August 21, 2008 at 1:36 pm

Thank you! Kirishna, hope fully ur script is very very help full for my work but still i have doubt on how to write a matlab script to simulate a frequency selective fading channel.
for example a channel of 120 Hz Doppler frequency.

leslie April 24, 2010 at 7:45 pm

You may use the BEM channel model for it.It is great to simulate the Jake’s channel model.

Krishna Sankar April 27, 2010 at 5:19 am

@Ok, thanks

Humayun March 10, 2012 at 6:00 pm

What is BEM channel ?

Krishna Sankar March 12, 2012 at 4:42 am

@Humayun: I have not tried to simulate BEM channel model

Krishna Sankar August 21, 2008 at 1:18 pm

@Lealem: Yes, the above simulation is for a flat Rayleigh fading channel.

In the OFDM case, though the total channel is a frequency selective channel, the channel experienced by the individual subcarriers will still be flat fading channel. Am expecting that a rayleigh channel having a duration less than the cyclic prefix, the expected BER performance in OFDM will be the same as the results obtained in the above plot. I will run simulations to check and confirm.

JERRY April 7, 2009 at 5:35 pm

Krishna Sankar April 11, 2009 at 6:38 am

@JERRY: You may refer to the post on Derivation of BER for BPSK in Rayleigh channel for the proof.
http://www.dsplog.com/2009/01/22/derivation-ber-rayleigh-channel/

Further, this is discussed in Chapter 11.3 of Digital Communications by Barry, Lee, Meesserschmit.

balaji May 27, 2009 at 7:09 pm

Hi mate… i went through your code and it was great. Im just learning about mimo equalization and all. Will you be able to help me generate a code for 2×2 MIMO equalised using svd?please mail me if you can.
cheers.

Krishna Sankar May 31, 2009 at 8:34 pm

@balaji: I have written some posts on MIMO. You may look up them @ http://www.dsplog.com/tag/mimo
In those posts, you may use the MIMO with Zero Forcing Equalizer as the most simplest example. When you said, equalizing MIMO by SVD, did you mean pre-compensing the transmitted matrix by V matrix such that the channel experienced by the MIMO channel is diagonal?

[U S V] = svd(H)

leslie April 25, 2010 at 8:05 am

It’s useful~~Thank you!

ALI July 25, 2010 at 11:54 pm

hi,
i need few matlab codes oF MIMO AND SISO SYSTEMS ON AWGN FADING CHANNEL AND RICIAN FADING CHANNEL.

MANY THANKS

Krishna Sankar July 26, 2010 at 6:47 am

@Ali: You may refer posts @ http://www.dsplog.com/tag/mimo
These are flat faiding Rayleigh channel

Ali July 26, 2010 at 3:32 pm

Hi Krishna ,
can i have a similar information about rician and awgn, as i have already gone through the link which you have posted me unfortunately i couldn’t find what exactly i am looking for .

Thanks

Krishna Sankar July 27, 2010 at 7:09 am

@Ali: The BER for BPSK in AWGN can be found @
http://www.dsplog.com/2007/08/05/bit-error-probability-for-bpsk-modulation/
Sorry, I have not written anything on Rician channel as on today.

Krishna Sankar July 27, 2010 at 7:09 am

@Ali: The BER for BPSK in AWGN can be found @
http://www.dsplog.com/2007/08/05/bit-error-probability-for-bpsk-modulation/
Sorry, I have not written anything on Rician channel as on today

Lealem Tamirat August 19, 2008 at 6:11 pm

I have seen the simulation code which u used to simulate a Rayleigh fading channel. But i would like u to ask a hit how to simulate a frequency selective Rayleigh fading channel for OFDM application. I think the above simulation out put is a flat Rayleigh fading.
Thank you!!!

Researcher Publication Opportunity August 21, 2011 at 1:01 pm

One who is interested in including his/her name in 3 research conferences in international IEEE conference should reply on email address me_researcher@yahoo.com. Both papers are related to mobile communication. Total of 3 authors list will be included in each Paper. 2 author names have already been included. Interested candidates who want to include his/her name at 3rd position will be required to pay for the registration fee.
Matlab Code as well as the full paper will be sent to the individual after acceptance of paper from the conference.
Fee submission will be through Freelancer and elance. Candidate name will be included in Paper after milestone payment is released by him/her. Milestone payment is one which is in the custody of broker (Freelancer or Elance authority) and not in the custody of either party. After the paper is accepted and the client is conformed about the acheivement, only then he will be allowed to pay. Time is short so the policy of 1st come 1st serve will be entertained.

Krishna Sankar December 23, 2009 at 5:46 am

@giro82: In this simulation, the channel changes every symbol

FERNANDO March 12, 2010 at 4:54 pm

Khishma, please, BER BPSK OFDM in raileigh channel should be better than BER OFDM in Rayleigh channel? Explain? Please. Thank you very much.

FERNANDO March 12, 2010 at 6:35 pm

Khishma, please, BER BPSK OFDM in raileigh channel should be better than BER BPSK in Rayleigh channel? Explain? Please. Thank you very much.