Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
EE Times-Asia > Amplifiers/Converters

Designing custom digital filter (Part 2)

Posted: 25 Aug 2015 ?? ?Print Version ?Bookmark and Share

Keywords:filter? decimation filter? stopband? PSoC? sinewave?

The story so far... In Part 1, I created a continuous-time filter transfer function for my special-purpose 10th order decimation filter. It had a final stopband slope of -18 dB per octave in the far stopband at frequencies much higher than the transmission zeros (something that 'standard 'catalogue' filters can't do) and a reasonably linear phase response across much of the audio band.

Now, there's much more to making a practical filter than just getting a transfer function that calculates out nicely. I see a lot of younger engineers do wonders with "filter design packages", producing beautiful plots of fine filters that work fine as long as you implement them in double-precision floating point. In the real world we have limited resources, whether analogue or digital. Most filters I see, analogue or digital, are not limited by the approximation stage (finding a transfer function that fits the requirements) but by the synthesis or implementation stages (finding coefficient or component values for a topology that can apply the filtering magic to your signal).

In the case of a filter that's made from a cascade of 2nd order sections ("biquads"), the two critical factors to consider are the choice of biquad topology, and the way in which you distribute the filter poles and zeros (the roots of the denominator and numerator polynomials respectively). This is just as true in the digital domain as in the analogue domain.

In this case, the topology decision was made for me because the filter needed to be implemented straight away using the Direct Form code we had available at the time for the Digital Filter Block in our PSoC device. This topology is definitely not the best that can be done for signal to noise ratio when the ratio of sample frequency to pole frequency is high. But it's easy to design and understand, and economical in resource terms. It's the digital equivalent of the "single amplifier biquad", the second order analogue filter made with a single op-amp. These often have poorer performance metrics than more complicated filter sections. But sometimes it's hard to persuade people that it's better to use two or even three opamps rather than one. People will thing you're just trying to sell them op-amps. Anyway, back to the plot...

Step 4: Optimise pole-zero ordering for best passband SNR
The transfer functions of the 7th order filter and the 3rd order equaliser are cascaded to produce a 10th order transfer function. This is the product of five 2nd order rational functions, each of which has a numerator and a denominator with some frequency-dependent behaviour.

Because they are all multiplied together, the numerators can all be swapped round without affecting the overall response. Likewise the denominators. What this means is that there are 5! ways of selecting an order for the numerators, and also 5! ways of independently selecting an order for the denominators. This means that there are up to 14400 ways of making up this transfer function (depending on how many duplicated factors there are in the transfer function). That naturally begs the question: which one of these is 'best', in some meaningful way?

This "pole/zero ordering problem" is an important one in filter design. Note that it's quite distinct from the internal overload problem resolved by calculating scaling factors. I solved this problem for several specific analogue filter design approaches a long time ago, but my old solutions weren't quite right for the digital biquad case. So I spent some time analysing the process from scratch and building it into my normal transfer function management tools (also ancient, and with direct lineage back to the BBC Micro days) so that some sort of 'best' solution could be automated.

1???2???3?Next Page?Last Page

Article Comments - Designing custom digital filter (Par...
*? You can enter [0] more charecters.
*Verify code:


Visit Asia Webinars to learn about the latest in technology and get practical design tips.

Back to Top