Code covered by the BSD License
-
DemoSmooth1(n,h)
Re-draws graph when smooth width slider is moved
-
DemoSmooth2(n,h)
Re-draws graph when number of passes slider is moved
-
DemoSmooth3(n,h)
Re-draws graph when the Resample slider is moved
-
SmoothSlider1(n,h)
Re-draws graph when smooth width slider is moved
-
SmoothSlider2(n,h)
Re-draws graph when smooth passes slider is moved
-
[PeakX, PeakY, Width]=PeakEst...
Least-squares estimate of peak height, position, and width of a Gaussian
-
exp(-((x-pos)./(0.6006.*wid))...
-
rtslid(fig,f,hh,varargin)
RTSLID Slider widget that responds to dragging realtime
-
s=bsmooth(a,w)
% Convolution...
-
s=bsmooth2(a,w)
% bsmooth(a,...
-
s=gsmooth(a,w)
% smooth(a,v) ...
-
s=tsmooth(Y,w)
% tsmooth(Y,w...
-
s=tsmooth2(Y,w)
% tsmooth(Y,...
-
smoothwidth. Faster than
% c...
-
smoothwidth. Works well with ...
-
DemoSmoothRedraw.m
-
DemoSmoothRedraw2.m
-
DemoSmoothSlider.m
-
DemoSmoothSlider2.m
-
SmoothSlider.m
-
SmoothSliderRedraw.m
-
SmoothSliderTest.m
-
View all files
from
Interactive Smoothing
by Tom O'Haver
Interactive smoothing for time-series signals
|
| smoothwidth. Works well with signals up to
% 100,000 points in length and smooth widths up to 1000 points.
% Faster than tsmooth for smooth widths above 600 points.
% T. C. O'Haver, 2006.
w=round(smoothwidth);
SumPoints=sum(Y(1:w));
s=zeros(size(Y));
h |
function SmoothY=fastsmooth(Y,smoothwidth)
% fastsmooth(Y,w) smooths vector Y by triangular
% smooth of width = smoothwidth. Works well with signals up to
% 100,000 points in length and smooth widths up to 1000 points.
% Faster than tsmooth for smooth widths above 600 points.
% T. C. O'Haver, 2006.
w=round(smoothwidth);
SumPoints=sum(Y(1:w));
s=zeros(size(Y));
halfw=round(w/2);
for k=1:length(Y)-w,
s(k+halfw)=SumPoints;
SumPoints=SumPoints-Y(k);
SumPoints=SumPoints+Y(k+w);
end
s=s./w;
SumPoints=sum(s(1:w));
SmoothY=zeros(size(s));
for k=1:length(s)-w,
SmoothY(k+halfw)=SumPoints;
SumPoints=SumPoints-s(k);
SumPoints=SumPoints+s(k+w);
end
SmoothY=SmoothY./w;
|
|
Contact us at files@mathworks.com