From: Tim Wescott on
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?

Oh wait - I have it. You didn't even distract me from paying work (just
a fun model airplane project, you b&^%$#!).

For any given linear shift-invariant causal system that starts at rest,
the maximum value that it's output can ever reach for an input that is
subject to a bound on its absolute value is the sum of the absolute
values of the samples of its impulse response times the bound on the
input. Why? Because the best input you could choose to overload the
thing would be a time-inverted version of it's impulse response, run
through the sign function and multiplied by the worst-case bounds. This
would result in an ever-growing output culminating at a sample whose
value is the afore-mentioned sum.

So find the impulse response from input to each state, then sum the
absolute values, then do the math.

This time I'm right. Really. I'm so sure that I'm right that if I'm
wrong and you come to the _right_ part of Oregon* this time I'll buy you
a beer.

In your case of H = (z-1)/z the impulse response is +1, -1, the sum of
the absolute values is 2, so you'd have to either (a) bound the inputs to
+/- 1/2, or (b) halve the transfer function.

My transfer function idea won't work because it'd be guaranteeing total
energy (via Parseval's Theorem), but that says little about crest factor.

* McMinnamin's Oregon City is the _right_ part of Oregon.

--
www.wescottdesign.com
From: Jerry Avins on
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.

Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������
From: Robert Orban on
In article <1326b66a-e7a1-4912-b1f1-
1455978ccb40(a)k17g2000yqh.googlegroups.com>, rbj(a)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