datasheets.com EBN.com EDN.com EETimes.com Embedded.com PlanetAnalog.com TechOnline.com
Events
UBM Tech
UBM Tech

Design Article

# Synthesize FIR filters using high-school algebra (Part 2)

## 3/19/2012 11:09 AM EDT

Flattening the passband

Our filter has got useful stopband behaviour, but the passband response isn't flat anywhere, it rolls off in the passband right from low frequencies. The response is actually close to Gaussian; you can see from the coefficients that the filter isn't going to overshoot at all on a step input signal. How to tell? Just look at the sum of progressively more terms in the impulse response; it's monotonically increasing because all the filter coefficients are positive, so the time response to a step never falls as each extra coefficient is 'uncovered'. That behaviour can be useful, but what do you do if you'd rather have a flatter frequency response over at least part of the passband?

We can add more factors to our polynomial to flatten out that droop, choosing those that contribute a gently rising response as frequency increases from DC. Look back at Figure 1; some of those polynomial terms didn't give us a null, but just a gentle slope up or down in response. These acted together to give a flatter overall frequency response to our original example, plotted in Part 1. We can construct our own terms to flatten out that gentle low frequency droop. Each quadratic factor you add will increase the coefficient count by two; multiplying in a linear term just adds one to the tap count.

The general analytic expression for the frequency response of an arbitrary root value (or pair of values) is quite clunky and I won't write it down here. It's quite possible to build an optimization script (think Million Monkeys) that can tweak the coefficients of extra linear and quadratic terms to flatten out the passband to the desired level.

Here's an example done entirely empirically; I've taken our synthesized filter and multiplied the polynomial by an additional (z-0.65). The rising response of this extra term has the effect of flattening out the droopy passband at lower frequencies – and also degrading the stopband rejection a little. Figure 5 shows what those coefficients look like when entered back into PSoC Creator's filter tool. The impulse response has become non-symmetrical, meaning it's no longer a linear phase filter. We can rectify that with yet more terms – but not today, I'm out of space and time! “Swings and roundabouts” works for filter design too.

Figure 5: Throw in another root (z-0.65) and we can flatten that passband a bit

Let's be honest; this isn't intended as a replacement for more conventional filter design techniques, especially if you're in a hurry! But it's a really good way of understanding the effect that those roots – filter designers call them 'zeroes' – of the filter polynomial are getting up to under the hood. For our example hum rejection filter, we got a useful result (we'll be using it commercially), with the added satisfaction that we built the coefficient set up right from first principles, and we understand exactly why it has its nulls where they are.

I hope this shows you that it's sometimes useful to break down the apparently monolithic, single-stage nature of an FIR filter into simpler pieces that can be separately manipulated. Try dialing some of these nulls into your next FIR filter design. It's the 'notchural' way! best / Kendall

View the Filter Wizard's archive of spells.

P.S.  Check out my Cypress blog at www.cypress.com/go/thefilterwizard - you can also email me from there.

Kendall Castor-Perry is a Principal Architect at Cypress Semiconductor,doing mixed-signal system analysis and design for the new PSoC platform.  Kendall uses decades of experience in analog engineering, filtering and signal processing to capture signals across many domains, extract the information from them and do something useful with it.

For more articles like this and others related to audio design, visit Audio Designline and/or subscribe to the monthly Audio newsletter (free registration).

Frank Eory

4/3/2012 6:04 PM EDT

Thanks for this great article Kendall. I see now why you bothered factoring -- it does provide good insight into which coefficients create which zeros.