Tweets by @dsprelated

A Quadrature Signals Tutorial: Complex, But Not Complicated

Understanding the 'Phasing Method' of Single Sideband Demodulation

Complex Digital Signal Processing in Telecommunications

Introduction to Sound Processing

Introduction of C Programming for DSP Applications

Richard Lyons is a Contracting Systems Engineer and Lecturer at Besser Associates, Mountain View, Calif. He has written over 30 articles and conference papers on DSP top...show full bio

**Would you like to be notified by email when Rick Lyons publishes a new blog?**

Follow @DSPRelated

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

**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

The solid blue α_{cor} magnitude curve in Figure 2 has the desired -3 dB value at *f _{c}* = 0.1

When we set *f _{c}* = 0.2

It turns out that the Eq. (1) approximation formula is only reasonably accurate at low values of *f _{c}*. As the

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.1

**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:

where ω = 2Π*f _{c}*/

Richard Lyons is a Contracting Systems Engineer and Lecturer at Besser Associates, Mountain View, Calif. He has written over 30 articles and conference papers on DSP topics, and authored Amazon.com's top selling DSP book "Understanding Digital Signal Processing, 3rd Ed.". He served as an Associate Editor at IEEE Signal Processing Magazine, for nine years, where he created and edited the "DSP Tips & Tricks" column. Lyons is the editor of, and contributor to, the book "Streamlining Digital Signal Processing-A Tricks of the Trade Guidebook, 2nd Ed." (Wiley & Sons, 2012).

Previous post by Rick Lyons:

Next post by Rick Lyons:

Comments / Replies

kaz

Said:

Thanks Rick

I looked at your blog of multiplier-less Averager and it does correlate with my comments.

In FPGAs we are used to avoid multipliers by any means including shift multiplication(for power 2 coefficient), addition for small integer coefficient, pre-adding for symmetry etc. So the method in your blog of multiplierless approach applies in general to any case and not just the expenential averager.

But surely it suits the case as it has single coefficient in effect.

My general concept of integrators is as follows:

case(1): a simple accumulator that keeps adding up its own output with some extra bits.

case(2) as above but add up fraction of output by truncatiing few LSBs

case(3) as above but have some control over cutoff point such the alpha examples above.

case 1 may be ok for getting the mean of bipolar stream. but could easily overflow and break otherwise.

case 2 is similar to case 3 but with x(n) coefficient = 1 and y(n-1) coefficient = 1/2^n (n = number of lsbs chopped off.

case 3: Changing the sense of alpha as explained in my first comment is equivalent since then alpha will be redefined as e^fc/fs rather than 1-e^fc/fs.

Regards

Kaz

I looked at your blog of multiplier-less Averager and it does correlate with my comments.

In FPGAs we are used to avoid multipliers by any means including shift multiplication(for power 2 coefficient), addition for small integer coefficient, pre-adding for symmetry etc. So the method in your blog of multiplierless approach applies in general to any case and not just the expenential averager.

But surely it suits the case as it has single coefficient in effect.

My general concept of integrators is as follows:

case(1): a simple accumulator that keeps adding up its own output with some extra bits.

case(2) as above but add up fraction of output by truncatiing few LSBs

case(3) as above but have some control over cutoff point such the alpha examples above.

case 1 may be ok for getting the mean of bipolar stream. but could easily overflow and break otherwise.

case 2 is similar to case 3 but with x(n) coefficient = 1 and y(n-1) coefficient = 1/2^n (n = number of lsbs chopped off.

case 3: Changing the sense of alpha as explained in my first comment is equivalent since then alpha will be redefined as e^fc/fs rather than 1-e^fc/fs.

Regards

Kaz

Sorry, you need javascript enabled to post any comments.

Sorry, you need javascript enabled to post any comments.

I assume the difference equation of your filter is:

y(n) = alpha.x(n) + (1-alpha).y(n-1) corresponding to figure 1 a, two multipliers

and if rearranged becomes:

y(n) = alpha.(x(n) - y(n-1) + y(n-1) corresponding to figure 1 b, one multiplier

However, I am used to the equation as follows:

y(n) = (1-alpha).x(n) + alpha.y(n-1)

In effect similar but with alpha defined in opposite sense.

Kaz