ex3_1.m
来自「radar equation for target estimation」· M 代码 · 共 46 行
M
46 行
%SIMULATION OF AWGN CHANNEL
%generating a rect. amplitude +/-5 pulse sequence
e=20; %sample time
seq=[-5 5 -5 -5 5 -5 5 -5 5 5]; %pulse sequence
for j=1:10,
L=seq(j);
for i=1:e,
x((j-1)*20+i)=L; %generating the pulse train
end
end
%subplot(211);
%plot(seq);
subplot(411);
plot(x);
grid on;
ylim([-10 10]);
title('Original Signal');
%to generate unit variance gaussian noise
%sequence of the same length
n=randn(e*10,1);
subplot(412);
plot(n);
grid on;
title('Additive White Gaussian Noise with unit variance');
%signal corrupted with white noise
for i=1:e*10,
y(i)=x(i)+n(i);
end
subplot(413);
plot(y);
grid on;
title('Corrupted signal');
%SIMULATION OF MATCHED FILTER
for i=1:20,
h(i)=pulse(e-i+1);
end
%output of matched filter t
t=conv(y,h)*1/20;
subplot(414);
plot(t);
grid on;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?