?? sefade.m
字號(hào):
%sefade.m
%多徑衰落信道仿真程序
function[iout,qout,ramp,rcos,rsin]=sefade(idata,qdata,itau,dlvl,n0,itn,n1,nsamp,tstp,fd,flat)
%******************variables*************************
%idata輸入I信道的數(shù)據(jù)
%qdata輸入Q信道的數(shù)據(jù)
%iout I信道的輸出
%qout Q信道的輸出
%ramp:衰落影響的幅度
%rcos:衰落影響的cosine值
%rsin:衰落影響的sine值
%itau:每徑的延遲時(shí)間
%dlvl:每徑的相對(duì)衰落能量
%n0:每徑產(chǎn)生衰落的波數(shù)
%itn:每徑的衰落計(jì)數(shù)器
%n1:衰落和延遲總波數(shù)
%nsamp:仿真的點(diǎn)數(shù)
%tstp:最小判定時(shí)間
%fd:最大doppler頻率
%flat衰落模式
%(1->flat(平衰落),0->nomal(相位和幅度均衰落)
%******************************************************
iout=zeros(1,nsamp);
qout=zeros(1,nsamp);
total_attn=sum(10.^(-1.0.*dlvl./10.0));
for k=1:n1
atts=10.^(-0.05.*dlvl(k));
if dlvl(k)>=40.0
atts=0.0;
end
[itmp,qtmp]=delay(idata,qdata,nsamp,itau(k));
[itmp3,qtmp3,ramp,rcos,rsin]=fade(itmp,qtmp,nsamp,tstp,fd,n0(k),itn(k),flat);
iout=iout+atts.*itmp3./sqrt(total_attn);
qout=qout+atts.*qtmp3./sqrt(total_attn);
end
%************************end of file***********************************
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -