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

📄 u5.m

📁 基于多径传输和多普勒频移的 瑞利(Rayleigh)信道的仿真 主要考虑不同条件下的仿真
💻 M
字号:
clear all;
s=[ones(1,10),zeros(1,90)]; % transmitted signal
s_f=fft(s);
x=s_f([1:50]);
y=s_f([51:100]);
signal_f=[y,x]; %input spectrum
dt=5/10; % each time interval is 0.01 micro sec
df=1/(100*dt);
f_s=df*([0:99]-50);% frequecy vector
an=[1,0.3,-0.8,0.5,-0.4,0.2]; %amplitudes
f=f_s;
w=2*pi*f;
tn_1=[0,1,2,3,4,5]; % arrival times for case 1
for i=1:6;
h1(i,:)=an(i)*exp(-j*w*tn_1(i));
end
h_1=sum(h1(:,1:end));%transfer function
y_1=h_1.*signal_f;%output spectrum
tn_2=[0,0.1,0.2,0.3,0.4,0.5]; % arrival times for case 2
for i=1:6;
h2(i,:)=an(i)*exp(-j*w*tn_2(i));
end
h_2=sum(h2(:,1:end));%transfer function
y_2=h_2.*signal_f;%output spectrum
figure(1)
subplot(2,3,1);
plot(f_s,abs(signal_f));
ylabel('magnitude');title('I/P spectrum')
subplot(2,3,4);
plot(f_s,angle(signal_f));
ylabel('Phase');
xlabel('Frequency(MHz)');
14
subplot(2,3,2);
plot(f,abs(h_1));
title('channel 1')
subplot(2,3,5);
plot(f,angle(h_1));
xlabel('Frequency(MHz)');
subplot(2,3,3);
plot(f,abs(h_2));
title('channel 2')
subplot(2,3,6);
plot(f,angle(h_2));
xlabel('Frequency(MHz)');
figure(2)
subplot(2,3,1);
plot(f_s,abs(signal_f));
ylabel('magnitude');title('I/P spectrum')
subplot(2,3,4);
plot(f_s,angle(signal_f));
ylabel('Phase');
xlabel('Frequency(MHz)');
subplot(2,3,2);
plot(f,abs(y_1));
title('O/P spectrum 1')
subplot(2,3,5);
plot(f,angle(y_1));
xlabel('Frequency(MHz)');
subplot(2,3,3);
plot(f,abs(y_2));
title('O/P spectrum 2')
subplot(2,3,6);
plot(f,angle(y_2));
xlabel('Frequency(MHz)');

⌨️ 快捷键说明

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