Savitzky–Golay filter
The Savitzky–Golay smoothing filter is a filter that essentially performs a local polynomial regression (of degree k) on a series of values (of at least k+1 points which are treated as being equally spaced in the series) to determine the smoothed value for each point. The main advantage of this approach is that it tends to preserve features of the distribution such as relative maxima, minima and width, which are usually 'flattened' by other adjacent averaging techniques (like moving averages, for example).
This filtering algorithm was first described in 1964 by Abraham Savitzky and Marcel J. E. Golay.[1]
Savitzky and Golay's paper is one of the most widely cited papers in the journal Analytical Chemistry[2] and is classed by that journal as one of its "10 seminal papers" saying "it can be argued that the dawn of the computer-controlled analytical instrument can be traced to this article".[3]
Case of a constant step
Let us consider a collection of data (xi, yi)1 ≤ i ≤ n. When the step xi - xi - 1 is constant, the Savitzky-Golay smoothing is a finite impulse response filter (FIR). For example, if we use a third degree polynomial and a window size of 5 points, then the value of the smoothed curve, ysm, and the value of the first and second derivative, y'sm and y''sm, can be calculated by the following linear combinations:
- ;
- ;
- .
Some coefficients are tabulated.
Degree | 2/3 (quadratic/cubic) | 4/5 (quartic/quintic) | ||||
---|---|---|---|---|---|---|
Window size | 5 | 7 | 9 | 7 | 9 | |
-4 | -21 | 15 | ||||
-3 | -2 | 14 | 5 | -55 | ||
-2 | -3 | 3 | 39 | -30 | 30 | |
-1 | 12 | 6 | 54 | 75 | 135 | |
0 | 17 | 7 | 59 | 131 | 179 | |
1 | 12 | 6 | 54 | 75 | 135 | |
2 | -3 | 3 | 39 | -30 | 30 | |
3 | -2 | 14 | 5 | -55 | ||
4 | -21 | 15 | ||||
Normalisation | 35 | 21 | 231 | 231 | 429 |
Degree | 2 (quadratic) | 3/4 (cubic/quartic) | ||||
---|---|---|---|---|---|---|
Window size | 5 | 7 | 9 | 5 | 7 | 9 |
-4 | -4 | 86 | ||||
-3 | -3 | -3 | 22 | -142 | ||
-2 | -2 | -2 | -2 | 1 | -67 | -193 |
-1 | -1 | -1 | -1 | -8 | -58 | -126 |
0 | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 1 | 1 | 1 | 8 | 58 | 126 |
2 | 2 | 2 | 2 | -1 | 67 | 193 |
3 | 3 | 3 | -22 | 142 | ||
4 | 4 | -86 | ||||
Normalisation | 10 | 28 | 60 | 12 | 252 | 1,188 |
Degree | 2/3 (quadratic/cubic) | 4/5 (quartic/quintic) | ||||
---|---|---|---|---|---|---|
Window size | 5 | 7 | 9 | 5 | 7 | 9 |
-4 | 28 | −4,158 | ||||
-3 | 5 | 7 | -117 | 12,243 | ||
-2 | 2 | 0 | -8 | -3 | 603 | 4,983 |
-1 | -1 | -3 | -17 | 48 | -171 | −6,963 |
0 | -2 | -4 | -20 | -90 | -630 | −12,210 |
1 | -1 | -3 | -17 | 48 | -171 | −6,963 |
2 | 2 | 0 | -8 | -3 | 603 | 4,983 |
3 | 5 | 7 | -117 | 12,243 | ||
4 | 28 | −4,158 | ||||
Normalisation | 7 | 42 | 462 | 36 | 1,188 | 56,628 |
See also
External links
References
- ^ Savitzky, A.; Golay, M.J.E. (1964). "Smoothing and Differentiation of Data by Simplified Least Squares Procedures". Analytical Chemistry. 36 (8): 1627–1639. doi:10.1021/ac60214a047.
- ^ "75 Most Cited Publications". Analytical Chemistry. American Chemical Society. 2004. Retrieved 2007-03-30. [dead link]
- ^ Riordon, James; Zubritsky, Elizabeth; Newman, Alan (2000). "Top 10 Articles". Analytical Chemistry. 72 (9): 24 A–329 A. doi:10.1021/ac002801q.