Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Status
Not open for further replies.

tomatokid

Newbie level 6
Joined
Sep 3, 2007
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,379
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;
 

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.
 

**broken link removed** u get here wat u require
 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top