This site uses cookies to deliver our services and to show you relevant ads and job listings. By using our site, you acknowledge that you have read and understand our Cookie Policy , Privacy Policy , and our Terms of Service . Your use of the Related Sites, including DSPRelated.com, FPGARelated.com, EmbeddedRelated.com and Electronics-Related.com, is subject to these policies and terms.

This blog discusses two ways to determine an exponential averager's weighting factor so that the averager has a given 3-dB cutoff frequency. Here we assume the reader is familiar with exponential averaging lowpass filters, also called a "leaky integrators", to reduce noise fluctuations that contaminate constant-amplitude signal measurements. Exponential averagers are useful because they allow us to implement lowpass filtering at a low computational workload per output sample.

Figure 1 shows two, a two-multiply and a one-multiply [1,2], exponential averagers. Given the same value for the α weighting factor, the two averagers have identical performance.

WEIGHTING FACTOR APPROXIMATION FORMULA

Years ago I was introduced to the following expression for computing the α weighting factor to set an averager's 3-dB cutoff frequency to f c Hz:

where f s is the averager's input data sample rate in Hz [1]. The “app” subscript in Eq. (1) stands for approximation. I did some Matlab modeling of Eq. (1) and found it to be useful so long as f c was less than roughly 0.1f s . I hadn't thought much more about Eq. (1) after that, thinking that it was a little-known approximation formula. However, I recently received an E-mail from a signal processing engineer asking why I didn't include Eq. (1) in the 'Averaging' chapter of my DSP book. So perhaps Eq. (1) is more widely known than I thought. That E-mail convinced me that it might be useful to write a short blog on how to design an exponential averager with a given 3-dB cutoff frequency.

EXACT WEIGHTING FACTOR FORMULA

The correct expression for computing the α weighting factor to set an exponential averager's 3-dB cutoff frequency to f c Hz is [3]:

The “cor” subscript in Eq. (2) stands for correct. The derivation of the messy Eq. (2) is given in the Appendix.

So the question is, “What is the error in using the α app approximate weighting factor for various values of the 3-dB cutoff frequency f c ?” Figure 2 shows the frequency magnitude and phase responses of two exponential averagers when the f c cutoff frequency is one tenth of the f s sample rate. The solid blue curves correspond to a correct α cor computed using Eq. (2). The dashed red curves correspond to an α app computed using Eq. (1).

The solid blue α cor magnitude curve in Figure 2 has the desired -3 dB value at f c = 0.1f s Hz. The dashed red α app magnitude curve's value at f c Hz is -2.86 dB. So at such a low value of f c , the two magnitude curves are quite similar and Eq. (1) is an acceptable approximation to Eq. (2).

When we set f c = 0.2f s Hz, on the other hand, Eq. (1)'s α app falls short on performance. Figure 3 shows the performance of the two exponential averagers when f c = 0.2f s Hz. The solid blue α cor magnitude curve in Figure 3 has the desired -3 dB value at f c = 0.2f s Hz. The dashed red α app magnitude curve's value at f c Hz is -2.46 dB, an error of 0.54-dB (an 18% error). At this higher value of f c Eq. (1) is not an acceptable approximation to Eq. (2).

It turns out that the Eq. (1) approximation formula is only reasonably accurate at low values of f c . As the f c cutoff frequency is increased in value the greater is the error when using Eq. (1), as shown in Figure 3.

The bottom line of this blog is that the Eq. (1) expression gives reasonably accurate results when the f c cutoff frequency is less than 0.1f s . Equation (2) gives exactly correct results regardless of the f c value.

REFERENCES

[1] V. Vassilevsky, “Efficient Multi-tone Detection,” IEEE Signal

Processing Magazine, “DSP Tips & Tricks” column, March 2007.

[2] R. Lyons, “Understanding Digital Signal Processing”, 3rd

Edition, Prentice Hall Publishing, 2011, pp. 789-780.

[3] Pages 613-614 of Reference [2].







APPENDIX A – Deriving Equation (2)

Here's how to derive Eq. (2). The expression for the frequency magnitude response of an exponential averager is [3]:

where frequency ω is a normalized angle in the range of 0 ≤ ω ≤ π (corresponding to a continuous-time frequency range of 0 –to- f s /2 Hz).

So the question is, "What's the expression for α, in terms of ω, so that |H exp (ω)| = 1/sqrt(2) = 0.707?" If we square Eq. (A-1) and set |H exp (ω)|2 = 0.5, we end up with:

Equation (A-2) can be written as:

Using the quadratic equation we can solve Eq. (A-3) for α as: