瑞利信道仿真源码
%main.m
clc;
clear;
close all;
LengthOfSignal=10240; %信號長度(最好大于兩倍fc)
fm=512; %最大多普勒頻移
fc=5120; %載波頻率
t=1:LengthOfSignal;
% SignalInput=sin(t/100);
SignalInput=sin(t/100)+cos(t/65); %信號輸入
?
delay=[0 31 71 109 173 251];
power=[0 -1 -9 -10 -15 -20]; %dB
y_in=[zeros(1,delay(6)) SignalInput]; %為時移補(bǔ)零
y_out=zeros(1,LengthOfSignal); %用于信號輸出
for i=1:6
? ? Rayl;
? ? y_out=y_out+r.*y_in(delay(6)+1-delay(i):delay(6)+LengthOfSignal-delay(i))*10^(power(i)/20);
end;
?
figure(1);
subplot(2,1,1);
plot(SignalInput(delay(6)+1:LengthOfSignal)); %去除時延造成的空白信號
title('Signal Input');
subplot(2,1,2);
plot(y_out(delay(6)+1:LengthOfSignal)); %去除時延造成的空白信號
title('Signal Output');
figure(2);
subplot(2,1,1);
hist(r,256);
title('Amplitude Distribution Of Rayleigh Signal')
subplot(2,1,2);
hist(angle(r0));
title('Angle Distribution Of Rayleigh Signal');
figure(3);
plot(Sf1);
title('The Frequency Response of Doppler Filter');
?
總結(jié)
- 上一篇: Error:不允许有匹配 [xX][mM
- 下一篇: 2020年西南交通大学数据仓库与数据挖掘