?? dopler1.m
字號(hào):
%[目標(biāo)]:用正弦波疊加的方式生成一個(gè)最簡(jiǎn)單的 Rayleigh Fading Process ,具有 Doppler Frequency 。
%也就是生成一個(gè) Rayleigh flat-fading channel with Doppler shift 。
%[摘要]:Paper中公式(10)-(12) 給出了生成 Rayleigh Fading Process 的一種簡(jiǎn)單的數(shù)學(xué)表達(dá)式。
%接下來(lái)給出了 matlab 源代碼。
%[參考文獻(xiàn)]:Mobile Radio Channels Modeling in Matlab
% function [r]=ray_doppler(fm, M, dt, N)
% 程序目的:為了實(shí)現(xiàn)文獻(xiàn)4中提到的改進(jìn)型正弦波疊加Jakes接收機(jī)
%
% 參數(shù)設(shè)置
% fm -- 最大多普勒頻移,單位Hz
% M -- 多徑的個(gè)數(shù),決定了用來(lái)疊加的正弦波的個(gè)數(shù),通常取4的倍數(shù), M/4 > 16
% dt -- 符號(hào)間隔,單位s
% N -- 衰落序列的長(zhǎng)度,以符號(hào)為單位;或者說(shuō)衰落信道的長(zhǎng)度
fm=90;
M=64;
dt=10;
N=10000;
T=N*dt-dt;
t=0:dt:T;
c=2*sqrt(4/M); % scaling factor of power
% c=1/sqrt(4/M)
w=2*pi*fm; % maximum Doppler frequency in rad
x=0;
y=0;
MM=M/4;
for n=1:MM
alpha=(2*pi*n-pi+(2*pi*rand-pi))/(4*MM);
ph1=2*pi*rand-pi;
% ph2=2*pi*rand-pi;
theta1=2*pi*rand-pi;
% theta2=2*pi*rand-pi;
x=x+cos(theta1)*cos(w*t*cos(alpha)+ph1); % x-axis Gaussian process, power is 1
y=y+sin(theta1)*cos(w*t*cos(alpha)+ph1); % y-axis Gaussian process, power is 1
end
x=c*x;
y=c*y;
% generate a complex-valued sequence
% its amplitude is Rayleigh distributed
% its angle is uniformly distributed
channel=(x+sqrt(-1)*y)/sqrt(2); % normalized to the unit power
%檢驗(yàn)本程序的功能使用語(yǔ)句;ray_doppler(0.02, 64, 0.1, 100)即可。
%檢測(cè)信道的PDF
step=0.1;
range=0:step:4;
h=hist(abs(channel),range);
fr_approx=h/(step*sum(h));
fr=(range/0.5).*exp(-range.^2);
figure ;
plot(range,fr_approx,'ko',range,fr,'b');
title('Rayleigh PDF'); xlabel('Amplitude/RMS(dB)'); ylabel('logCDF Fn(x)');
grid;
% Rayleigh Fading process
rayleigh_fading_process = abs (channel);
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -