n=50;
nn=500;

x=ones(1,n);

% x=real(exp(i*[-(n-1)/2:(n-1)/2]*pi/2));% +...
% x=real(exp(i*[-(n-1)/2:(n-1)/2]*pi/40));

x=[zeros(1,10) x zeros(1,nn-10)];
m=nn+n;

y=x;
plot(x);
axis([0,m,-1,2]);
pause

al=0.999;

for k=1:1000
   for j=2:m-1
      y(j)=(1-al)/2*x(j+1)+(1+al)/2*x(j-1);
   end
   plot(y);
   axis([0,m,-1,2]);
   pause
   x=y;
end

