h=ones(1,5)/5;
x=linspace(0,pi,25);
s=sin(x);
r=(-0.5+rand(1,25))/2;
sn=s+r;
z=conv(h,sn);
dtz=(-2):26;
%subplot(3,1,1); plot(x,s)
%title('Original data')
subplot(2,1,1); plot(x,sn,'x',x,s)
title('Noisy data')
subplot(2,1,2); plot(x,z(3:27),'o-b',x,s,x,sn,'xr')
title('Filtered data')
