function xf=moyglis(x,n);
N=length(x);
if (fix(n/2)~=n/2)
    n=n+1;
end
for k=n/2:N-n/2
    xf(k)=mean(x(k-n/2+1:k+n/2));
end
xf(1:n/2-1)=xf(n/2);
xf(N-n/2:N)=xf(N-n/2);

    