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.

Rayleigh multipath channel simulation

Status
Not open for further replies.

jilly0124

Newbie level 5
Joined
Dec 2, 2011
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,337
I have a code to simulate Rayleigh multipath channel, but the system says there is some errors which i cannot find.
Can you give me some help?

Code:
EB_NO_dB=0:2:20;
EB_NO = 10.^(EB_NO_dB/10);
sigmaN=sqrt(N/EB_NO )
[ch_spread_sig h t_delay]= mulit_pathchan(spread_sig,sigmaN);
Then, I used sub_function here:
Code:
function [ch_spread_sig h t_delay]=mulit_pathchan(spread_sig,sigmaN)

R=10000;                              % The length of the bit stream.
t_offset=[0 1 2 3];                  %Delay
gain=[0 -10 -15 -20];              %Channel gain in dB
gain_linear=10.^(gain/10);
n = sigmaN*(randn(1,R)+1j*randn(1,R))/sqrt(2);

for ii=1:length(gain_linear)
h(ii,:)=sqrt(gain_linear(ii))*(1/sqrt(2)*(randn(1,R) + 1j*randn(1,R)));           % Rayleigh channel
path_out(ii,:)=h(ii,:).*[zeros(1,t_offset(ii)) spread_sig(1:end-t_offset(ii))];
end

ch_spread_sig=sum(path_out,1)+n; % Multipath
t_delay=t_offset;

Kindly help me for this.

Thanks!
 
Last edited by a moderator:

Can u print tat error??

Error using ==> times
Matrix dimensions must agree.

Error in ==> path_out(ii,:)=h(ii,:).*[zeros(1,t_offset(ii)) spread_sig(1:end-t_offset(ii))];

Error in ==> [ch_spread_sig h t_delay]= mulit_pathchan(spread_sig,sigmaN);
 

you can simply use rayleighchan() MATLAB function
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top