Order, Order, Order! | Cypress Semiconductor
Order, Order, Order!
How exciting! My very own Cypress blog. I was just thinking how I didn't have enough work to do... not! Just kidding - it's going to be fun, sharing stuff that's a bit more directly useful to the growing band of devotees of Cypress's latest PSoC3 and PSoC5 products. My regular "Filter Wizard" articles on the EETimes network of sites and newsletters (such as Planet Analog) usually steer clear of direct references to what you can do with Cypress products, and I'll still be writing those general articles when I can. My next one is overdue (sorry, Paul) but we need to kick-start this new channel, so here I am. I'm getting involved in many filtering, signal conditioning and audio projects with PSoC3, so there will be plenty to talk about.
If you've already started working with our graphical design tool PSoC Creator, you may know that we're already supporting FIR digital filters running on the embedded Digital Filter Block found within some models in the PSoC3 and PSoC5 family. People regularly ask us when we'll have support for some other filter types, IIR being top of their list. Well, we're working on providing some tools for that, of course. But meanwhile, a few of us here get to design these filters one by one, for the applications that already benefit from them. And the results from some of the IIR filter design tools out there (both free and expensive!) leave a whole lot to be desired. One of my current projects needed a pretty sharp lowpass filter with good phase linearity in the audio band, so I dug up an ancient analogue design I'd done years ago, as an exercise in conversion.
Filter Wizard article readers may have spotted that I'm a fan of the bilinear transform method for migrating good old s-domain analogue transfer functions into z-domain digital ones. A significant benefit of this approach used on a cascade of biquad sections is that the cumulative amplitude responses at the successive outputs of the biquads is preserved (allowing for the frequency 'warping', of course). So, if you take a well-designed analogue transfer function that has been optimized to get the best dynamic range out of a cascade of analogue sections, it usually transforms into a digital design of close-to-optimum performance.
And this is the reason for my witty and amusing blog title (yeah, right - Ed.). For it's the order of the poles and zeroes, and also the stage-by-stage gain scaling factors, that determine how much of the cascaded filter's dynamic range potential is available. The frequency-dependent feedback built into a second order filter section has a magnifying effect on the internal noise created by that filter, whether it comes from an op-amp's input stage or from the truncation of numerical results after all that multiply/accumulating has been done.
I sort of 'cracked' this problem years ago for analogue filters when they used to be my 'day job'. Basically you need to make sure that the signal level in the passband never gets either too big (you'll overload early) or too small (the gain needed to make this up boosts the nose as well). Given all the poles and zeroes in a transfer function, there's generally a best arrangement which minimizes the output noise with respect to the maximum undistorted signal level. There are some subtle differences working with standard digital biquads, and I'm looking at adapting the method to work under these conditions. So I spent much of this morning cranking add-on functions to an old program of mine that contains code dating back over twenty years... no point in reinventing the wheel when all that's needed is a slightly different hub-cap, eh?
If I can get these tools easy enough to use (if you can get them working, you mean - Ed.), I might make them available to you on a case-by-case basis before our proper DFB support is ready. If you're designing a PSoC3- (or PSoC5-) based system and you think you need some particularly good or critical digital filters, send your comments and requests through to... well, this column is so new that it doesn't have an email address yet, but I'm sure it soon will, and then you can use it!
That's all for this week. Keep filtering! best - Kendall