⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dopler1.m

📁 一个改进型的正弦波叠加发实现平坦衰落的程序
💻 M
字号:
%[目标]:用正弦波叠加的方式生成一个最简单的 Rayleigh Fading Process ,具有 Doppler Frequency 。
%也就是生成一个 Rayleigh flat-fading channel with Doppler shift 。

%[摘要]:Paper中公式(10)-(12) 给出了生成 Rayleigh Fading Process 的一种简单的数学表达式。
%接下来给出了 matlab 源代码。

%[参考文献]:Mobile Radio Channels Modeling in Matlab

% function [r]=ray_doppler(fm, M, dt, N)

% 程序目的:为了实现文献4中提到的改进型正弦波叠加Jakes接收机
%
% 参数设置
% fm -- 最大多普勒频移,单位Hz
% M -- 多径的个数,决定了用来叠加的正弦波的个数,通常取4的倍数, M/4 > 16
% dt -- 符号间隔,单位s 
% N -- 衰落序列的长度,以符号为单位;或者说衰落信道的长度
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 


%检验本程序的功能使用语句;ray_doppler(0.02, 64, 0.1, 100)即可。

%检测信道的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); 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -