Code covered by the BSD License  

Highlights from
Interactive Smoothing

image thumbnail
from Interactive Smoothing by Tom O'Haver
Interactive smoothing for time-series signals

s=gsmooth(a,w) % smooth(a,v) smooths vector with a gaussian % convolution function of with w % See also tsmooth(a,w) ... triangular smooth % and bsmooth(a,w) ... boxcar (unweigthed sliding average) smooth center=length(a)./2; v=gaussian([center-w:cen
function s=gsmooth(a,w)
% smooth(a,v) smooths vector with a gaussian
% convolution function of with w
% See also tsmooth(a,w)  ...  triangular smooth
% and bsmooth(a,w)   ...  boxcar (unweigthed sliding average) smooth
center=length(a)./2;
v=gaussian([center-w:center+w],center,w);
S=conv(a,v);
startpoint=round((length(v) + 1)/2);
endpoint=round(length(a)+startpoint-1);
s=S(startpoint:endpoint) ./ sum(v);

Contact us at files@mathworks.com