close all
clear
F=1/10;
N=20;
x=cos(2*pi*F*(0:N-1));
M=6;
h=ones(1,M)*1/M;
y=conv(x,h);
figure(1)
stem((0:N-1),x)
hold on
if floor(M/2)*2==M
    L=M/2+1
else
    L=(M+1)/2
end
stem((0:N-1),y(L:N-1+L),'r')
% same as y=conv(x,h,'same')
hold off
% help floor