-
Notifications
You must be signed in to change notification settings - Fork 284
savitzky_golay_filter
#Savitzky-Golay Filter
##Description The SavitzkyGolayFilter implements a Savitzky-Golay filter. The SavitzkyGolayFilter is part of the Preprocessing Modules.
An example of a signal (sine wave at 0.1Hz, 0.5Hz, 1Hz, 2Hz, 4Hz and 8Hz) filtered using a Savitzky-Golay filter. The number of left and right hand points for the filter was set to 15. The red signal is the raw signal and the green signal is the filtered signal. The signal and filtered data was generated using the example code below. Note that the filter removes most of the noise added to the sine wave, while also maintaining the higher frequency signals. Other filtering techniques, such as a moving average filter for example, would usually 'flatten' the higher frequency signals.
##Advantages 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 a moving average filter, for example).
##Disadvantages The main disadvantage of the SavitzkyGolayFilter is that a small amount of experimentation is normally required to find the appropriate filter values required to best filter a specific signal.
##Example Savitzky–Golay Filter Example