From: JohnSumner on
Dear all,

I have exactly the same problem as Anton, but I'm not clear how the
suggested solution will work correctly (no disrespect intended to Robert).

For a single stage biquad (for simplicity), we have:

w(n) = x(n) - a1*w(n-1) - a2*w(n-2)
y(n) = b0*w(n) + b1*w(n-1) + b2*w(n-2)

In Anton's example (for his second stage), the coefficients are:

a0 = 1
a1 = -1.9497
a2 = 0.9535

b0 = 1
b1 = 2
b2 = 1

(Matlab outputs the coefficients in the order b0, b1, b2, a0, a1, a2)

I see immediately how one can scale the 'b' coefficients at will, and
rescale the output, because each 'b' coefficient acts on w(n), w(n-1) and
w(n-2) to yield y(n).

However, the iircas5 function only accepts a1 and a2 (a0 is implicitly
equal to 1). Therefore, dividing the 'a' coefficients by a factor of 2 (in
this case) will alter the filter characteristics. The coefficients would
then be:

a0 = 1 (implicit)
a1 = -0.9748
a2 = 0.4767

As the 'a' coefficients are applied recursively, dividing a1 and a2 by a
factor of 2 would essentially be dividing the three terms in my first
equation by 1, 2 and 4.

Hopefully I have explained that reasonably clearly, and having banged my
head against this particular problem for a day or two, someone can point
out the error in my logic, or explain how one uses iircas5 under these
circumstances!

Many thanks in advance,

John Sumner

>Thanks a lot Robert!
>
>r_obert(a)REMOVE_THIS.hotmail.com wrote in message
news:<7lu2iv8sfe3fb9t0dv9dr0resudjkue6sn(a)4ax.com>...
>> Divide them by the power of two that makes them all less than one in
>> absolute magnitude. Multiply the resulting numbers by 32768. Round
>> to the nearest integer. That's your coefficients. Take the
>> pre-divide out after the filter multiplication and additions, using
>> shifts.
>>
>> Robert
>>
>> www.gldsp.com
>>
>> ( modify address for return email )
>>
>> www.numbersusa.com
>> www.americanpatrol.com
>