Documentation of smooth


Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)


Function Synopsis

dout = smooth(vect, data);

Help text


  dout = smooth(vect, data);
  
  vect is the smoothing vector (e.g., [1 2 1]/4)
  data will be smoothed in the column dimension


Cross-Reference Information

This function calls

Listing of function smooth

function dout = smooth(vect, data);
lvect = length(vect);
if ~mod(lvect,2);
  error('This works much better for odd lengthed smoothers');
end
vect = vect/sum(vect);

[ny, nx] = size(data);

data2 = [ones(floor(lvect/2),1)*data(1,:); ...
         data; ...
         ones(floor(lvect/2),1)*data(ny,:)]; 

for i = 1:ny;
  ind = (i-1)+[1:lvect];
  data(i,:) = sum2((vect'*ones(1, nx)).*data2(ind,:));
end

dout = data;