DSPRelated.com
Forums

Maximizing dynamic range of fixed point IIR filter

Started by Vladimir Vassilevsky December 22, 2009
On Dec 23, 12:34�am, robert bristow-johnson
<r...@audioimagination.com> wrote:
> > BTW, i might highly recommend the DF1 for cascaded biquads over the > DF2. &#4294967295;for order N, the DF2 being canonical, requires N states and the > cascaded DF1 requires N+2 states (not the 2N states that the naive > think). &#4294967295;if you use a double-wide accumulator, there is only one point > of quantization in the DF1 (two for a single DF2 stage, but if you're > willing to carry a double precision result into the next section, you > can make the number of quantizers N+1 for DF2 compared to N for DF1).
ooops, i forgot that N is the order (let's assume even for shits and grins) not the number of sections which is N/2. so there are 2 quantization points in a single DF2 section, but if you're carrying a double precision result to the input of the following DF2 section, you can make the total number of quantization points to be N/2 +1 compared to N/2 for the DF1. dotting the t's and crossing the i's is important. r b-j
Tim Wescott wrote:
> On Tue, 22 Dec 2009 23:04:06 -0500, Jerry Avins wrote: > >> Vladimir Vassilevsky wrote: >>> >>> Tim Wescott wrote: >>>> On Tue, 22 Dec 2009 13:59:28 -0600, Vladimir Vassilevsky wrote: >>>> >>>> >>>>> Let's say we need to implement H(z) = P(z)/Q(z) in the fixed point. >>>>> The typical implementation would be a cascade of biquads. So we >>>>> factor P(z) and Q(z) and distribute poles and zeroes between the >>>>> stages. >>>>> >>>>> The dynamic range of a filter is limited by overflow at the top, and >>>>> by quantization artifacts at the bottom. We can try all variants of >>>>> assignment of poles and zeroes to different stages to maximize the >>>>> dynamic range from rms quantization noise to full scale sine wave at >>>>> the "worst" frequency. So far so good. >>>>> >>>>> However, this doesn't tell if some stage of filter can overflow if >>>>> the input is an arbitrary non-harmonic waveform. How could we >>>>> optimize the filter for this case? >>>>> >>>> I _think_ that if the transfer function from input to each state in >>>> the filter is less than unity (or whatever the critical gain is >>>> necessary to prevent overflow) for all possible frequencies, you can't >>>> overflow. >>>> But I don't _know_ -- I'd have to try to prove it, and may end up >>>> disproving it instead! >>> Unfortunately, not. Think of a highpass filter with the gain of 1 and >>> the data range is +/-1. Let the input -1,-1,-1....-1, +1, so here is >>> overflow. >> I think I remember a proof here that there are pathological waveforms -- >> not the result of sampling -- that will cause any IIR structure to >> overflow. The worst case for a transversal filter is easy to demonstrate >> but unrealistically stringent. > > Can't be, at least not for a stable filter. Any linear time-invariant > filter that's stable in the "poles strictly inside the stability region" > sense is also stable in the bounded-input, bounded-output sense. > > If it's BIBO stable, then that means you can select your overflow level > to be just outside the output bounds (or your gain to _keep_ the output > bounds to just inside the overflow level).
Maybe Randy Yates remembers what's tickling my mind. (It was injected into one of our on-line arguments in which we were both right about what we wrote, but both wrong about what we understood the other to be writing.) The standard analyses -- and yours -- assume certain properties for the data. Someone here figured out -- Andor Bariska? -- a pathology that violated the standard assumptions. I'm not sure what structure or operation it applied to. but I clearly remember being astounded at the result. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
In article <1326b66a-e7a1-4912-b1f1-
1455978ccb40@k17g2000yqh.googlegroups.com>, rbj@audioimagination.com 
says...

>i can't imagine that some IEEE dude hasn't already written a treatise >about this in the 60s or 70s. no? maybe some old Bell System >Technical Journal? (*never* assume you've invented or discovered >something novel until you check there.)
The problem was extensively studied in the 1970s. The classic IEEE book "Programs for Digital Signal Processing" contains a big Fortran program called EQIIR that handles exactly this problem and can take into account coefficient quantization. The program's author, G.F. Dehner, revisited the issue in 2003 in a paper called "Noise optimized IIR digital filter design: tutorial and some new aspects," Signal Processing, Volume 83, Issue 8 (August 2003). http://portal.acm.org/citation.cfm?id=876820