You are on page 1of 3

t=0:0.

01:1;
x= sin(2*pi*t);
figure(1);
plot(x,'linewidth',2)
t=0:0.01:1;
y= cos(2*pi*t);
figure(2);
plot(y,'linewidth',2)
%add awgn
t=0:0.01:1;
z=awgn(x,20,'measured')
figure(3);
plot(t,x,t,z)
%conv
xy=conv(z,y);
figure(4);
plot(xy,'linewidth',2)
%matched filter
hw = phased.sinusoidconvolution('PulseWidth',1e-4,'PRF',5e3);
x = step(hw);
hmf = phased.MatchedFilter(...
'Coefficients',getMatchedFilter(hw));
y = step(hmf,x);
subplot(211),plot(real(x));
xlabel('Samples'); ylabel('Amplitude');
title('Input Signal');

subplot(212),plot(real(y));
xlabel('Samples'); ylabel('Amplitude');
title('Matched Filter Output');

You might also like