?? jakes.m
字號:
function g2 = jakes(N)% function g2 = jakes(N)% use Jakes method to simulate the amplitude of a fading channel% returns |g|^2, which is the SQUARE magnitude of the channel.% % e.g., to plot in dB, use plot(10*log10(g2));% Jakes method is described in _Microwave_Mobile_Communication,% IEEE Press, 1993.% Copyright 2004 by Todd K. Moon% Permission is granted to use this program/data% for educational/research onlyM = floor(0.5*(0.5*N-1));nlist = 1:N;mlist = 1:M;%betan = pi*mlist/M;betan = 2*pi*rand(1,M);alpha = 0;alpha = 2*pi*rand(1);fmT = 0.1;fnT = fmT*cos(2*pi*mlist/N);tT = 0:200;j = sqrt(-1);g = sqrt(2)*(cos(alpha)*cos(2*pi*fmT*tT) + j*sin(alpha)*cos(2*pi*fmT*tT));gi2 = M + cos(alpha)^2;gq2 = M + sin(alpha)^2;giq2 = sin(alpha)*cos(alpha);for n=1:M g=g+2*(cos(betan(n))*cos(2*pi*fnT(n)*tT)+j*sin(betan(n))*cos(2*pi*fnT(n)*tT)); gi2 = gi2 + cos(2*betan(n)); gq2 = gq2 - cos(2*betan(n)); giq2 = giq2 + 2*sin(betan(n))*cos(betan(n));endg2 = g.*conj(g);g2 = g2/(gi2 + gq2); % normalize for unit MSEplot(10*log10(g2));
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -