📄 mjakesch.m
字号:
function h=MJakesCH(PowerProfile,fm,fs,t0,L_symbol,tau)
% Input:
% PowerProfile: The power delay profile in dB for Rayleigh fading channel.
% fc: The carrier frequency
% v: The moving velocity of the receiver
% fs: The sampling frequency of the generated multipath channel.,in the real system, it is 20M
% t0: Initial time for channel simulation process.
% L_symbol: Number of symbols of the sampled channel responses.
% tau: Locations for nonzero paths.
% fm: the Doppler freq bias
% Output:
% h: The path coefficients
% Setting of independent osillators.
clc
j=sqrt(-1);
tapNum=length(PowerProfile);
if tapNum<16
N0=16;
else
N0=tapNum+1;
end
Wm=2*pi*fm;%Maximum Doppler frequency shift.
W(1:N0,1)=Wm*cos(2*pi*((1:N0)-0.5)/(4*(N0+1)))';
% Calculat h
for c1=1:tapNum
sita(1,1:N0)=pi*c1*(1:N0)/N0;
h(c1,:)=(cos(sita)+j*sin(sita))*cos(W*(t0+(1:L_symbol)*1240/fs)+pi*c1/2);
h(c1,:)=sqrt(size(h,2))*h(c1,:)/norm(h(c1,:));
end
MeanAmp=10.^(PowerProfile/10);
MeanAmp=MeanAmp/sum(MeanAmp);
MeanAmp=sqrt(MeanAmp);
h=diag(MeanAmp)*h;
PathNum=max(tau);
Tmp=zeros(PathNum,size(h,2));
Index=1;
for c1=1:PathNum
if c1==tau(Index,1)
Tmp(c1,:)=h(Index,:);
Index=Index+1;
end
end
h=zeros(size(Tmp));
h=Tmp;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -