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.

AWGN channel to Rayleigh

Status
Not open for further replies.

Rob87

Newbie level 1
Joined
Dec 7, 2008
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
recov_data matlab

Hello everyone,

I've been trying to simulate a Rayleigh channel in Matlab and have stumbled upon a difficulty. Originaly i was given a simulation that calculates the BER of an AWGN channel in QPSK, and was asked to change it to a Rayleigh fading channel.

The Original program is as such:

-------------------------------------------------------------------------------------

clear;
N_loop = 10^4;
N_sym =100 ;
N_bit=2*N_sym;
awgn_sigma = sqrt(0.5);
Eb_dB=5:1:9;
Eb = 10.^(Eb_dB/10);
sqrt_Es = sqrt(2*Eb);
BER = zeros(1,length(Eb));
normalized = 1/sqrt(2);
BER1 = zeros(1,length(Eb));

for n=1:N_loop;
D = floor(2*rand(1,N_sym))+j*floor(2*rand(1,N_sym));
Tx_data = normalized * (2*D-(1+j));
Noise=awgn_sigma*(randn(N_sym,length(Eb_dB))+j*randn(N_sym,length(Eb_dB)));
Rx_data =transpose(Tx_data)*sqrt_Es+ Noise;
Recov_data = 0.5*(1+j+sign(real(Rx_data))+j * sign(imag(Rx_data)));
BER = BER+sum((abs(Recov_data-transpose(D)*ones(1,length(Eb_dB)))).^2)/N_bit;



end;
BER = BER/N_loop

semilogy(Eb_dB,BER,'*-');
xlabel('Eb/N0 (dB)');
ylabel('BER');

-------------------------------------------------------------------------------------

The problem i'm facing is, even though i know the channel can be described as two Gaussian sources like:

H= awgn_sigma*(randn(N_sym,length(Eb_dB))+j*randn(N_sym,length(Eb_dB)));

i get an error in matlab telling me that the inner matrix dimensions must agree. i changed the function of H to be a 1x1 matrix, but when i add it to my signal

Rx_data =H*transpose(Tx_data)*sqrt_Es+ Noise;

i get a BER of 0.5 which i know is wrong.

If anyone can please help me. I'm sure i got the theory down right, but i can't seem to apply it to my simulation.

Thanks in advance,
Robert
 

awgn channel

The first error is that you are using the same variance for H as the noise. so that your received sequence will be a total noise and it is obvious that the BER is 1/2. you should normalize H matrix to have variance equal to one so that it won't affect the SNR. H=sqrt(1/2)*(randn.....)
Also you should change your detector accordingly but I didn't understand your detection scheme to help you about that.
good luck
 

awgn or rician channel?

can u give me the code of simulating simple rician channel with QPSK modulation with AWGN noise
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top