function [xs] = smooth(x)
%
% This is a simple 1-2-1 one-dimensional data smoother. It can be applied multiple times.
% K. Emanuel, 12/30/2004
%
m=max(size(x));
xs=x;
for i=2:m-1
   xs(i)=0.25.*(x(i-1)+x(i+1))+0.5.*x(i);
end   

