Re: Fixed Point IIR implementation
- From: "robert bristow-johnson" <rbj@xxxxxxxxxxxxxxxxxxxx>
- Date: 30 Nov 2005 09:57:01 -0800
Fred Nach wrote:
>
> I would like to implement a IIR Biquad filter using the fixed point
> arithmetics...
> Hence to reduced the intermediate states I plan to use the following trick:
> s(k) = x(k) -a1*s(k-1) -a2*s(k-2)
> y(n) = b0*s(k) + b1*s(k-1) + b2*s(k-2)
>
> The I can compute each y, saving only 2 states (s(k-1) aénd s(k-2))...
this is the Direct 2 Form (sometimes called the "Direct II Canonical
Form"). unrecommeded for floating-point (if the Q is quite high, you
end up subtracting numbers very close to each other and losing
precision) and *highly* unrecommended for fixed-point (saturation
clipping will be your lot).
try the Direct 1 Form:
y[n] = b0*x[n] + b1*x[n-1] + b2*x[n-2] - a1*y[n-1] - a2*y[n-2]
every product on the right side of the = sign is a double precision
fixed point and all of those products should be added together in
double precision. this is trivial in the Mot 56K and the ADI SHArC and
maybe in the TI fixed-pointers.
> BUT ... in order to scale my coefficients or input, I need to know what
> are the boundaries of the s(k) serie... in order to find a proper Fixed
> Point format for my coefficients..
your coefs are defined strictly in terms of the frequency response you
want. the gross range of a1 is -2 to +2 and a2 is -1 to +1 for any
stable biquad filter. the b0, b1, b2 coefs can be nearly anything but
you will have to choose a range and possibly do some scaling using the
arithmetic shift operation on the result before saving to y[n].
> So my questions are :
>
> * for which conditions, s(k) is bounded
> * If the s(k) is bounded, what are the boundaries?
that is a purely artificial construct. are your fixed-point signal
values considered 16 bit signed integers? then it's -32768 <= x[n] <
+32768 . are they normalized? then it's -1 <= x[n]< +1. their range
is whatever you want them to be.
> Thanks in advance for your help (and sorry for my poor englsih)
as Jerry said, your English is fine.
r b-j
.
- Follow-Ups:
- Re: Fixed Point IIR implementation
- From: Fred Nach
- Re: Fixed Point IIR implementation
- References:
- Fixed Point IIR implementation
- From: Fred Nach
- Fixed Point IIR implementation
- Prev by Date: Interpolation
- Next by Date: Re: Fixed Point IIR implementation
- Previous by thread: Re: Fixed Point IIR implementation
- Next by thread: Re: Fixed Point IIR implementation
- Index(es):
Relevant Pages
|