Jump to content

Savitzky–Golay filter

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 71.184.79.70 (talk) at 18:25, 28 December 2012 (Case of a constant step: Corrected typo "smothed" to "smoothed".). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Algorithm applied on a gaussian peak with random noise, with a degree 3 and a width of 9 points. Smoothing (top), first derivation (middle), second derivation (bottom).

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 ≤ in. 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.

Convolution coefficients for smoothing
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
Convolution coefficients for 1st derivative
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
Convolution coefficients for 2nd derivative
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

References

  1. ^ 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.
  2. ^ "75 Most Cited Publications". Analytical Chemistry. American Chemical Society. 2004. Retrieved 2007-03-30. [dead link]
  3. ^ Riordon, James; Zubritsky, Elizabeth; Newman, Alan (2000). "Top 10 Articles". Analytical Chemistry. 72 (9): 24 A–329 A. doi:10.1021/ac002801q.