%main.m
clc;
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]; %为时移补零
y_out=zeros(1,LengthOfSignal); %用于信号输出
for i=1:6
%Rayl.m
f=1:2*fm-1; %通频带长度
y=0.5./((1-((f-fm)/fm).^2).^(1/2))/pi; %多普勒功率谱(基带)
Sf=zeros(1,LengthOfSignal);
Sf1=y;%多普勒滤波器的频响
Sf(fc-fm+1:fc+fm-1)=y; %(把基带映射到载波频率)
x1=randn(1,LengthOfSignal);
x2=randn(1,LengthOfSignal);
nc=ifft(fft(x1+i*x2).*sqrt(Sf)); %同相分量
x3=randn(1,LengthOfSignal);
x4=randn(1,LengthOfSignal);
ns=ifft(fft(x3+i*x4).*sqrt(Sf)); %正交分量
r0=(real(nc)+j*real(ns)); %瑞利信号
r=abs(r0); %瑞利信号幅值
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');
- 1
- 2
- 3
- 4
前往页