Savitzky-Golay filter design
Savitzky-Golay smoothing filters (also called digital smoothing polynomial filters or least squares smoothing filters) are typically used to “smooth out” a noisy signal whose frequency span (without noise) is large. In this type of application, Savitzky-Golay smoothing filters perform much better than standard averaging FIR filters, which tend to filter out a significant portion of the signal's high frequency content along with the noise.
You can implement data smoothing to measure a variable that is both slowly varying and also corrupted by random noise. Since nearby points measure nearly the same underlying value, you can replace each data point by a local average of the surrounding data points. Savitzky-Golay filters are optimal in the sense that they minimize the least-squares error in fitting a polynomial to each frame of noisy data.
[1] Orfanidis, Sophocles J. Introduction to Signal Processing. Englewood Cliffs, NJ: Prentice Hall, 1996.
[2] Press, William. H, Teukolsky, S. A, Vetterling, W. A, and Flannery, B. P . Numerical Recipes in C: The Art of Scientific Computing. Cambridge University Press, New York, NY, USA 1992 .
filter
| fir1
| firls
| sgolayfilt