How to implement Lyons’ Differentiator

Maybe offtopic, but I don’t see why these differentiator filters are so great. They are not min-max optimal (unlike Parks–McClellan), I think? Lyons doesn’t really explain how he came up with it or by what criteria it is optimal.

For comparison, if you simply generate 5-point and 7-point finite-difference stencils using stencil(-2:2, 0//1) and stencil(-3:3, 0//1) from this post, respectively, then I get a frequency response that is pretty good compared to the ones Lyons proposes. (Though for broadband you should probably do a whole-band optimization like Parks–McClellan, whereas stencil is designed to be much more accurate as \omega \to 0.)

Am I missing something? What is special about the filter coefficients proposed by Lyons?

I guess they could be viewed as slightly better than the high-order stencil in a min-max (L_\infty) sense over certain bandwidths, e.g. if you look at the right plot and ask over what bandwidth the |error| is < 0.1 it is a bit wider for lyons5 than stencil5. But if you care about L_\infty error over such a wide bandwidth, why not use Parks–McClellan?

Lyons mentions that his filter “can be implemented, if need be, without performing numerical multiplications”, by which I guess he means that the denominators are powers of two so that they can be implemented by bit shifts if you are using fixed-point arithmetic. (This isn’t true of the high-order finite-difference stencils.) Is that the key advantage? If so, it doesn’t apply to you since you are using floating-point calculations.

2 Likes