www.gusucode.com > OFDM_16QAM系统仿真源码程序 > OFDM_16QAM系统仿真源码程序/code/channel_Rayleigh.m

    %======================
%   Rayleigh process
%====================== 
function ray_out = channel_Rayleigh(f1,c1,th1,f2,c2,th2,N_sim,T_s,T_start);

% Simulation for Rayleigh process, output is complex Gaussian process %

t = (0:N_sim-1)*T_s + T_start;
ray_out_I = 0;
ray_out_Q = 0;
for k=1:length(f1)
    ray_out_I = ray_out_I + c1(k)*cos(2*pi*f1(k)*t+th1(k));
end    
for k=1:length(f2)
    ray_out_Q = ray_out_Q + c2(k)*cos(2*pi*f2(k)*t+th2(k));
end  

ray_out = ray_out_I + j * ray_out_Q;
%ray_out = abs(ray_out);