mjakesch.m
来自「a method of ofdm simulation using matlab」· M 代码 · 共 44 行
M
44 行
function h=MJakesCH(PowerProfile,fm,fs,t0,L_symbol,tau)
% Input:
% PowerProfile: The power delay profile in dB for Rayleigh fading channel.
% fm: Maximum Doppler frequency shift
% fs: The sampling frequency of the generated multipath channel.
% t0: Initial time for channel simulation process.
% L_symbol: Number of symbols of the sampled channel responses.
% tau: Locations for nonzero paths.
% Output:
% h: The path coefficients
% Setting of independent osillators.
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)*1250/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 + =
减小字号Ctrl + -
显示快捷键?