Why and how Savitzky-Golay filters should be replaced

M. Schmid, D. Rath, U. Diebold

Institut für Angewandte Physik, TU Wien, 1040 Wien, Austria

ACS Meas. Sci. Au 2 (2022) 185-196

Savitzky-Golay (SG) filtering, based on local least-squares fitting of the data by polynomials, is a popular method for smoothing data and calculations of derivatives of noisy data. At frequencies above the cutoff, SG filters have poor noise suppression; this unnecessarily reduces the signal-to-noise ratio, especially when calculating derivatives of the data. In addition, SG filtering near the boundaries of the data range is prone to artifacts, which are especially strong when using SG filters for calculating derivatives of the data. We show how these disadvantages can be avoided while keeping the advantageous properties of SG filters. We present two classes of finite impulse response (FIR) filters with substantially improved frequency response: (i) SG filters with fitting weights in the shape of a window function and (ii) convolution kernels based on the sinc function with a Gaussian-like window function and additional corrections for improving the frequency response in the passband (modified sinc kernel). Compared with standard SG filters, the only price to pay for the improvement is a moderate increase in the kernel size. Smoothing at the boundaries of the data can be improved with a non-FIR method, the Whittaker-Henderson smoother, or by linear extrapolation of the data, followed by convolution with a modified sinc kernel, and we show that the latter is preferable in most cases. We provide computer programs and equations for the smoothing parameters of these smoothers when used as plug-in replacements for SG filters and describe how to choose smoothing parameters to preserve peak heights in spectra.

Corresponding author: Michael Schmid (schmid at iap_tuwien_ac_at).

Note that there is an error in one of the Java programs supplied as Supporting Information with this article. A corrected version is provided in the IAP Surface Physics download page.

You can download a PDF file of this open-access article from ACS Measurement Science Au or from the IAP/TU Wien web server.