time_domain_view.m
来自「多径多普勒信道模型」· M 代码 · 共 32 行
M
32 行
clear all;
an=[1,0.3,-0.8,0.5,-0.4,0.2];
tn=[0,1,2,3,4,5;0,0.1,0.2,0.3,0.4,0.5];
tn=[0,1,2,3,4,5;0,0.3,0.6,1.2,2.4,3.6];
signal=[0, zeros(1,0),ones(1,501),zeros(1,1000)]; % transmitted signal
for k=1:2; %for two cases
for i=1:6;
ray(i,:)=an(i)*[0, zeros(1,(100*tn(k,i))),ones(1,501),zeros(1,(1000-100*tn(k,i)))];
end
y(k,:)=sum(ray(:,1:end));
end
t=((1:1:length(y(1,:)))-1)*10^(-2);
subplot(2,2,1);plot(t,signal);
ylabel('transmitted signal s(t)');
title('case 1 & case 2 & case 3')
axis([ 0 20 -0.5 1.5])
subplot(2,2,2);plot(t,y(1,:));
ylabel('received signal y(t)');
title('case 1: large delay spread')
subplot(2,2,4);
plot(t,y(2,:));
xlabel('Time(us)');
ylabel('received signal y(t)');
title('case 2: small delay spread')
noise = 0.1*rands(1,length(signal));
subplot(2,2,3);plot(t,signal+noise);
ylabel('transmitted signal s(t)');
title('case 3: ADD GAUSS NIOSE')
figure
plot(t,y(2,:)+noise)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?