Low-noise Lanczos differentiators

Common approach on computing derivative of a noisy function f(x) numerically is similar to classic central differences we considered before. We approximate “difficult” f(x) by a polynomial near point of interest x^* and assume that f’(x^*) is equal (with some deviance) to the derivative of that polynomial.

Only one important change is required – method of approximation. In case of noisy data there is no sense to use interpolation as we do for central differences (values are already corrupted by noise, no need to preserve them precisely). Instead smoothing least-squares approximation is used in order to remove noise from the data. Filters derived by this procedure are commonly referenced as Savitzky-Golay digital differentiators. We will consider several particular filters of this class named after Cornelius Lanczos. Detailed procedure is described below (skip to the final formulas).

Analogously to central differences, we fix some step h and sample f(x) at N (odd) points around x^*:

f_k = f(x_k),\: x_k = x^*+kh,\: k=-\frac{N-1}{2},\dots,\frac{N-1}{2}.

Then we construct approximating polynomial P_{M}(x)=\sum_{j=0}^{M}{a_jx^j} for f(x) by minimizing cost function

Z = \sum_{k=-(N-1)/2}^{(N-1)/2}{\left(f_k-P_{M}(x_k)\right)^2}

with respect to unknown coefficients \{a_j\}. To do this we need to solve system of linear equations:

 \left\{ \displaystyle\frac{\partial Z}{\partial a_0}=0,\ldots,\displaystyle\frac{\partial Z}{\partial a_{M}}=0 \right\}.

Once polynomial is constructed we can estimate f’(x^*) following to our assumption:

f’(x^*)\approx P’_{M}(x^*)

Power of the polynomial M should be strictly less than N-1 otherwise least-squares approximation will be equivalent to interpolation (number of unknowns will be equal to number of freedom degrees) and we will arrive to central differences.

Methods derived by this procedure are called low-noise Lanczos differentiators for M=2 and super Lanczos low-noise differentiators for M=4. In general

 \begin{tabular}{|r|c|} \hline $N$& Low-Noise Lanczos Differentiators ($M = 2$)\\ \hline &\\ 5&$\displaystyle\frac{f_{1}-f_{-1}+2(f_{2}-f_{-2})}{10h}$\\ &\\ 7&$\displaystyle\frac{f_{1}-f_{-1}+2(f_{2}-f_{-2})+3(f_{3}-f_{-3})}{28h}$\\ &\\ 9&$\displaystyle\frac{f_{1}-f_{-1}+2(f_{2}-f_{-2})+3(f_{3}-f_{-3})+4(f_{4}-f_{-4})}{60h}$\\ &\\ 11&$\displaystyle\frac{f_{1}-f_{-1}+2(f_{2}-f_{-2})+3(f_{3}-f_{-3})+4(f_{4}-f_{-4})+5(f_{5}-f_{-5})}{110h}$\\ &\\ \hline \end{tabular}

These differentiators have very simple structure and can be written in general form for any N:

\displaystyle{f’(x^*)\approx \frac{3}{h}\sum_{k=1}^{m}{k\frac{f_k-f_{-k}}{m(m+1)(2m+1)}}, \quad m=\frac{N-1}{2}}

Interesting fact is that denominators constitute special sequence of integer numbers appeared in many fields of mathematics and physics. For example, these numbers are coincide with maximum accumulated number of electrons at energy level m. Check this website for more details.

 \begin{tabular}{|r|c|} \hline $N$& Super Lanczos Low-Noise Differentiators ($M = 4$)\\ \hline &\\ 7&$\displaystyle\frac{58(f_{1}-f_{-1})+67(f_{2}-f_{-2})-22(f_{3}-f_{-3})}{252h}$\\ &\\ 9&$\displaystyle\frac{126(f_{1}-f_{-1})+193(f_{2}-f_{-2})+142(f_{3}-f_{-3})-86(f_{4}-f_{-4})}{1188h}$\\ &\\ 11&$\displaystyle\frac{296(f_{1}-f_{-1})+503(f_{2}-f_{-2})+532(f_{3}-f_{-3})+294(f_{4}-f_{-4})-300(f_{5}-f_{-5})}{5148h}$\\ &\\ \hline \end{tabular}

To differentiate a digital signal u_n we need to use h=1/SamplingRate and replace f_k by u_{n+k} in the expressions above. Magnitude responses of low-noise differentiators for M=2,4 are drawn below:

As it can be clearly seen this method is much more robust to noise than plain central differences. However due to least-squares nature Lanczos differentiators cannot guarantee complete noise suppression in high frequencies. Its magnitude response doesn’t go smoothly to zero near \pi. Instead they resemble “wavy” always-non-zero response on high frequencies.

Improved filters with guaranteed suppression of noisy high frequencies are presented in the next article:

Disclaimer

You can use materials from this site in any legal activity (research, teaching, engineering, etc.) freely on the basis of respecting my authorship by giving clear statement and reference to my site or particular page on it in your work. Besides brief description of your project is very welcome in the comments below. One point though, if you use my materials in commercial project please consider supporting my site and me by donation.


1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00)
Loading ... Loading ...
Print This Page Print This Page

3 Comments

  1. manoj
    Posted August 9, 2009 at 1:31 pm | Permalink

    Why low-noise Lanczos differentiators do not work with noisy data?

    • Wirbel
      Posted January 1, 2010 at 8:38 am | Permalink

      I suppose of wrong coefficients!
      Change signs of 22 (N=7), 86 (N=9) and 300 (N=11)

Post a Comment

Your email is never published nor shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting