Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: BER for BPSK
Date: Wed, 13 Jan 2010 21:17:25 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 62
Message-ID: <hild95$g3a$1@fred.mathworks.com>
References: <hikkr8$cra$1@fred.mathworks.com> <hiknu3$39j$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1263417445 16490 172.30.248.38 (13 Jan 2010 21:17:25 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 13 Jan 2010 21:17:25 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2168282
Xref: news.mathworks.com comp.soft-sys.matlab:598641

"Ethem Sozer" <esozer@mathworks.com> wrote in message <hiknu3$39j$1@fred.mathworks.com>...
> Hi Saed,
> 
> You are on the right track: the problem is phase recovery.  You need to 
> correct the phase for the PSK demodulator to recover the received bits.
> 
> The Rayleigh channel object of the Communications Toolbox provides the 
> "PathGains" property where you can see the channel gain used to generate the 
> received signal.  You can access this value using the syntax: 
> chan.PathGains, and use it to correct the fading effect of the channel.  By 
> default, this property only shows the last channel gain used.  To store 
> channel gain values for the whole frame, you need to set the StorePathGains 
> to 1 as follows:
> 
> chan.StorePathGains = 1;
> 
> Note that this will work for only flat fading channels.  If you have 
> selective fading, then you will need an equalizer.
> 
> By the way, to see the full effect of the fading, you need to put the 
> channel filter inside the for loop.
> 
> Good luck,
> Ethem
> 
> "Saed Dawoud" <saed.dawoud@yahoo.com> wrote in message 
> news:hikkr8$cra$1@fred.mathworks.com...
> > Hello,
> >
> > I am trying to simulate the Bit Error Rate (BER) for Binary Phase Shift 
> > Keying (BPSK) over Rayleigh fading channel, and I come up with the 
> > following code, which is a slightly modefied version of the one in MATLAB 
> > Communication Toolbox for DPSK:
> >
> > M=2;
> > chan=rayleighchan(1/10000,100);
> > tx=randint(50000,1,M);
> > txSig=pskmod(tx,M);
> > y=filter(chan,txSig);
> >
> > SNR=0:2:20;
> > for n=1:length(SNR)
> >    rxSig=awgn(y,SNR(n));
> >    rx=pskdemod(rxSig,M);
> >    [nErrors,BER(n)]=biterr(tx,rx);
> > end
> >
> > BERtheory = berfading(SNR,'psk',M,1);
> > semilogy(SNR,BER,'k-*',SNR,BERtheory,'r');
> >
> > As you noted, something is wrong in this code, since the empirical result 
> > is far away from the theoritical one, where it is expected for both to be 
> > almost the same. This situation is not arised in the case of DPSK, so, I 
> > think the reason is the phase recovery, but I don't know how to solve this 
> > problem. Can anyone help me?
> >
> > Thanks in advance 
> 

Thank you for replying, but I still don't know how to use these properties in the code, can you show me this, please?

Thanks in advance