# A Differentiator With a Difference

Some time ago I was studying various digital differentiating networks, i.e., networks that approximate the process of taking the derivative of a discrete time-domain sequence. By "studying" I mean that I was experimenting with various differentiating filter coefficients, and I discovered a computationally-efficient digital differentiator. A differentiator that, for low fequency signals, has the power of George Foreman's right hand! Before I describe this differentiator, let's review a few fundamentals of simple digital differentiators.

# Digital Differentiation

While the idea of differentiation is well-defined in the world of continuous signals, the notion of differentiation is not well defined for discrete signals. However, fortunately we can approximate the calculus of a derivative operation in the domain of discrete signals. (While DSP purists prefer to use the terminology digital differencer, here I'll use the phrase differentiator.) To briefly review the notion of differentiation, think about a continuous sinewave, whose frequency is ω radians/second, represented by

 (1)

The derivative of that sinewave is

 (2)

So the derivative of a sinewave is a cosine wave whose amplitude is proportional to the original x(t) sinewave's frequency. Equation (2) tells us that an ideal differentiator's frequency magnitude response is a straight line increasing with frequency ω. With that thought in mind, I'll now mention two common discrete-time FIR (nonrecursive) differentiators: a first-difference and a central-difference differentiator. They are computationally simple schemes for estimating the derivative of a digital x(n) time-domain signal sequence with respect to time.

The first-difference differentiator, the simple process of computing the difference between successive x(n) signal samples, is defined in the time domain by

 (3)

The frequency magnitude response of that differentiator is the dashed |Hfd(ω)| curve in Figure 1(a). (For comparison reasons, I also show an ideal differentiator's straight-line |Hideal(ω)| = ωmagnitude response in Figure 1(a). The frequency axis in that figure covers the positive frequency range 0 ≤ω≤ π samples/radian, corresponding to a cyclic frequency range of 0 to fs/2, where fs is the x(n) sample rate in Hz.) Equation (3) is sweet in its simplicity but unfortunately its |Hfd(ω)| tends to amplify high-frequency noise that often contaminates real-world signals. For that reason the central-difference differentiator is often used in practice.

The time-domain expression of the central-difference differentiator is

 (4)

The central-difference differentiator's frequency magnitude response is the dotted |Hcd(ω)| curve in Figure 1(a). The price we pay for |Hcd(ω)|'s desirable high-frequency (noise) attenuation is that its frequency range of linear operation is only from zero to roughly ω = 0.16π samples/radian (0.08fs Hz) which is, unfortunately, less than the frequency range of linear operation of the first-difference differentiator.

# Here's the Beef

Now, ... for the computationally-efficient differentiator that maintains the central-difference differentiator's beneficial high-frequency attenuation behavior, but extends its frequency range of linear operation. The differentiator that I'm promoting is defined by

 (5)

This novel differentiator's normalized magnitude response is the solid |Hdif(ω)| curve in Figure 1(a), where we see that its frequency range of linear operation extends from zero to approximately ω= 0.34π samples/radian (0.17fs Hz). The ydif(n) differentiator is twice the usable frequency range of the central-difference differentiator.

The implementation of the ydif(n) differentiator is shown in Figure 1(b) where a delay block comprises two unit delays. The folded-FIR block diagram for this differentiator is presented in Figure 1(c) where only a single multiply need be performed per ydif(n) output sample. The really slick aspect of the ydif(n) differentiator is that its non-unity coefficients (±1/16) are integer powers of two. This means that a multiplication in Figure 1 can be implemented with an arithmetic right shift by four bits. Happily, such a binary right-shift implementation is a linear-phase multiplierless differentiator!

Figure 1: Efficient differentiator: (a) performance; (b) standard block diagram; (c) folded block diagram.

Another valuable feature of the Equation (5) ydif(n) differentiator is that its time delay (group delay) is exactly three sample periods (3/fs). Having a delay that's an integer number of samples makes this differentiator convenient when the differentiator's output must be synchronized with other time-domain sequences, such as for use with popular FM demodulation methods.

[Sept. 2015 Note: I've written a more recent blog regarding another interesting differentiator. That blog is at:

Next post by Rick Lyons:
Spectral Flipping Around Signal Center Frequency

nithinbaburaj
Said:
this is really simple to understand and i really apreciate the way you have put things...i think i almost grabbed most of it..
9 years ago
0