+ Post New Thread

Results 1 to 5 of 5

- 8th November 2007, 16:19 #1

- Join Date
- Sep 2007
- Posts
- 12
- Helped
- 0 / 0
- Points
- 1,010
- Level
- 7

## bpsk ber

Dear all,

I need help regarding my simulation as I am using jakes model to generate the fading coefficients. However, my result doesn't match with the one given by forumer here, who uses randn/sqrt(2) to generate the real and imaginary component of the fading process. My codes are as follows;

% Simulation of BPSK over a flat Rayleigh fading channel

function rayleigh

clear

N=1000000;

snr=0:2:24;

for m=1:size(snr,2)

efade = 0; % error counter for fading AWGN channel

egaus = 0; % error counter for AWGN channel

No = 10^(-snr(m)/10); % PSD of AWGN with signal energy normalise to 1, ie E=1

sigma = sqrt(No/2); % Standard deviation

for n=1:N

tx_signal = (-1)^round(rand); % to either get a +1 or -1 signal

% channel model

x=fading(sigma);

y=fading(sigma);

p=x+y*j; % fading power of real and imaginary component

a=abs(p); % fading amplitude

rfade = a * tx_signal + sigma*randn; % faded signal + AWGN

rgauss = tx_signal + sigma*randn; % unfaded signal + AWGN

% received signal

if (rfade>0)

estimate_fade = +1;

else

estimate_fade = -1;

end

if (rgauss>0)

estimate_gauss = +1;

else

estimate_gauss = -1;

end

% checking for error

if (estimate_fade ~= tx_signal)

efade = efade + 1;

end

if (estimate_gauss ~= tx_signal)

egaus = egaus + 1;

end

end

% calculating error probability

pe(m)=efade/N; % BER flat Rayleigh fading

peg(m)=egaus/N; % BER AWGN only

% results

fprintf('%f \t %e\n',snr(m),pe(m));

end

semilogy(snr,pe,'-')

hold on

semilogy(snr,peg,':')

legend('Rayleigh channel','AWGN channel');

ylabel('Bit Error Rate');

xlabel('Average E_b/N_0 (dB)');

title('Perfomance of BPSK over flat-Rayleigh and AWGN channels');

axis([ snr(1) snr(end) 9.5e-6 1])

grid on

% this function simulate the fading process with jakes spectrum

function z = fading(sigma)

fmax = 0.05/(2*pi);

N = 50;

y = 0;

Cn = sqrt(sigma*2/N);

phase = rand(1,N)*2*pi;

for n=1:N

fn = fmax*sin((pi*n)/(2*N));

y = y + Cn*cos(2*pi*fn*j + phase(1,n));

end %end for

z = y;

- 8th November 2007, 16:19

- 9th November 2007, 15:00 #2

- Join Date
- Sep 2007
- Posts
- 12
- Helped
- 0 / 0
- Points
- 1,010
- Level
- 7

## HELP: BER for a BPSK signal going through a fading channel

anybody care to help?

- 9th November 2007, 15:00

- 11th November 2007, 03:26 #3

- Join Date
- Nov 2007
- Posts
- 62
- Helped
- 7 / 7
- Points
- 1,352
- Level
- 8

## Re: HELP: BER for a BPSK signal going through a fading chann

Hi

I think you are using jakes model as a form of rayleigh fading .

the folowing code produces BER of BPSK in rayleigh fading that matches accurately to the theoretical BER of BPSK in fading channel.

It also uses monte carlo simulation to have more accurate response.

clc;

clf;

clear all;

for snr=1:50

snrnum=10^(snr/10);

psk_fading(snr)=0.5*(1-sqrt(snrnum/(1+snrnum)));

end

snr=1:50;

semilogy(snr,psk_fading);

grid on;

datanrzpolar=randsrc(1,1000);

for snr=1:50

signal_amp=sqrt(10^(snr/10))*datanrzpolar;

for mcr=1:100

noise=randn(1,1000);

noise1=randn(1,1000);

cnoise=complex(noise,noise1);

cnoise=cnoise/(sqrt(var(cnoise)));

p_f=2*pi*randn(1,1000);

x1=randn(1,1000);

x2=randn(1,1000);

x1=x1/(sqrt(var(x1)));

x2=x2/(sqrt(var(x2)));

for i=1:1000

alpha(i)=sqrt(x1(i)^2+x2(i)^2);

end

chi=alpha.^2;

chi_mean=mean(chi);

alpha_normalised=alpha./sqrt(chi_mean);

for i=1:1000

h(i)=alpha_normalised(i)*complex(cos(p_f(i)),-sin(p_f(i)));

r(i)=h(i)*signal_amp(i)+cnoise(i);

end

for i=1:1000

mrc(i)=r(i)*conj(h(i));

end;

for i=1:1000

if(real(mrc(i))>=0)

decision(i)=1;

else

decision(i)=-1;

end

end

hamm=0;

for i=1:1000

if(decision(i)~=datanrzpolar(i))

hamm=hamm+1;

end;

end

pe(mcr)=hamm/1000;

end

pepsk(snr)=mean(pe);

end

snr=1:50;

hold on;

semilogy(snr,pepsk,'r*');

grid on;

i hope its useful for you. The same can be used for simualtion of BER of BFSK in fading channel.

- 11th November 2007, 03:26

- 24th June 2010, 07:31 #4

- Join Date
- Jun 2010
- Location
- india
- Posts
- 13
- Helped
- 1 / 1
- Points
- 519
- Level
- 4

## HELP: BER for a BPSK signal going through a fading channel

www.dsplog.com...u get here wat u require

- 24th June 2010, 12:27 #5

- Join Date
- Oct 2008
- Location
- Sindh, Pakistan
- Posts
- 895
- Helped
- 178 / 178
- Points
- 9,408
- Level
- 23

## Re: HELP: BER for a BPSK signal going through a fading chann

Originally Posted by**yella**

+ Post New Thread

Please login