jilly0124
Newbie level 5
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?
Then, I used sub_function here:
Kindly help me for this.
Thanks!
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);
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: