資源簡介
該代碼是瑞利衰落信道的仿真代碼,使用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
評論
共有 條評論