sgolayfilt
Savitzky-Golay filtering
Description
y = sgolayfilt(x,order,framelen)
applies a Savitzky-Golay finite impulse response (FIR) smoothing filter of
polynomial order order and frame length
framelen to the data in vector x. If
x is a matrix, then sgolayfilt
operates on each column.
Examples
Steady-State and Transient Savitzky-Golay Filters
Generate a random signal and smooth it using sgolayfilt. Specify a polynomial order of 3 and a frame length of 11. Plot the original and smoothed signals.
order = 3;
framelen = 11;
lx = 34;
x = randn(lx,1);
sgf = sgolayfilt(x,order,framelen);
plot(x,':')
hold on
plot(sgf,'.-')
legend('signal','sgolay')
The sgolayfilt functio