This page is about numerical differentiation of a noisy data or functions. Description begins with analysis of well known central differences establishing reasons of its weak noise suppression properties. Then we consider differentiators with improved noise suppression based on binomial expansion formula for negative power pdf-squares smoothing.
Such filters are known as low-noise Lanczos differentiators or Savitzky-Golay filters. You can skip directly to the table of final formulas. August 13, 2015: Andrey Paramonov went further and extended the ideas to build similar filters for smoothing. Please read his article for more details: Noise-robust smoothing filter. November 10, 2011: It is not technically correct to state that Savitzky-Golay filters are inferior to proposed ones.
Actually both have situations when one outperforms another. Savitzky-Golay is optimal for Gaussian noise suppression whereas proposed filters are suitable when certain range of frequencies is corrupted with noise. Red dashed line is the response of an ideal differentiator . Although amplitude of waves is decreasing for longer filters in order to achieve acceptable suppression one should choose very long filters. See Low-noise Lanczos differentiators page for more details.
From signal processing point of view differentiators are anti-symmetric digital filters with finite impulse response of Type III. There are powerful methods for its construction: based on windowed Fourier series, frequency sampling, etc. Additionally it should have computationally favorable structure to be effectively applied in practice. Finally we arrive at the simple solution . Frequency-domain characteristics for the differentiators are drawn below. Red dashed line is the response of ideal differentiator . Besides guaranteed noise suppression smooth differentiators have efficient computational structure.
Costly floating-point division can be completely avoided. These filters also show smooth noise suppression with extended passband. Proposed method can be easily extended to calculate numerical derivative for irregular spaced data. Another extension is filters using only past data or forward differentiators. 2D smooth differentiators of any order, band-pass differentiators, etc. Here I present only second order smooth differentiators with their properties.
I will post other extensions upon request. Coefficients of these filters can be computed by simple recursive procedure for any . Also they can be easily extended for irregular spaced data as well as for one-sided derivative estimation when only past data are available. Contact me by e-mail if you are interested in more specific cases. In case of higher approximating order we get following estimation. Brief description of your project is welcome in the comments below. One point though, if you use my materials in commercial project please consider supporting my site and me financially.
I’d like to know if you have the formula of a one-sided version, as using a centered version forces me to introduce a time lag. I am very grateful for your feedback. It is very exciting for me to know about real-world applications using my work. As always, longer impulse response means better noise suppression. One-sided filters have several disadvantages comparing to centered versions. Then I can try to design one-sided filter with the similar properties.