• 大小: 1KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-20
  • 语言: Matlab
  • 标签: 瑞利信道  matlab  

资源简介

该代码是瑞利衰落信道的仿真代码,使用matlab编写而成,可运行

资源截图

代码片段和文件信息

%m.m
clc;
LengthOfSignal=20140; %信号长度(最好大于两倍fc)
fm=5000;   %最大多普勒频移
fc=5120;   %载波频率
t=1:LengthOfSignal;  % SignalInput=sin(t/100);
s=640*pi;
i=0:1:LengthOfSignal-1;
t=i/LengthOfSignal;
t1=(t-1/8).^2;t3=(t-3/8).^2;t4=(t-4/8).^2;
t6=(t-6/8).^2;t7=(t-7/8).^2;
xm=exp(-s*t1)+exp(-s*t3)+exp(-s*t4)+exp(-s*t6)+exp(-s*t7);
c=cos(2*pi*fc*t);
SignalInput=xm.*c;%双边带信号输入
delay=[0 31 71 109 173 251];
power=[0 -1 -9 -10 -15 -20];   %dB
y_in=[zeros(1delay(6)) SignalInput];   %为时移补零
y_out=zeros(1LengthOfSignal);   %用于信号输出
for i=1:6
R;    y_out=y_out+r.*y_in(delay(6)+1-delay(i):delay(6)+LengthOfSignal-delay(i))*10^(power(i)/20);
end;
am=y_out.*c;  %信号解调
wp=0.1*pi;ws=0.12*pi;Rp=1;As=10;    %设置滤波器
[Nwn]=buttord(wp/piws/piRpAs);
[ba]=butter(Nwn);
m1=filter(baam);
m1=2*m1;
figure(1);
subplot(311);
plot(xm(delay(6)+1:LengthOfSignal)); %去除时延造成的空白信号
title(‘调制信号‘);
subplot(312);
plot(SignalInput(delay(6)+1:LengthOfSignal)); 
title(‘信号输入‘);
subplot(313);
plot(y_out(delay(6)+1:LengthOfSignal));
title(‘信号输出‘);
figure(2);
subplot(211);
plot(am(delay(6)+1:LengthOfSignal)); 
title(‘解调信号‘);
subplot(212);
plot(m1(delay(6)+1:LengthOfSignal)); 
title(‘低通滤波器‘);
figure(3);
subplot(211);
hist(r256);
title(‘Amplitude Distribution Of Rayleigh Signal‘)
subplot(212);
hist(angle(r0));
title(‘Angle Distribution Of Rayleigh Signal‘);
figure(4);
plot(Sf1);
title(‘The Frequency Response of Doppler Filter‘);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1545  2012-12-25 09:16  m.m
     文件         462  2012-12-25 09:16  R.m

评论

共有 条评论