Reply by robert bristow-johnson April 2, 20072007-04-02
On Apr 2, 7:31 pm, "robert bristow-johnson"
<r...@audioimagination.com> wrote:
> > we were just talking about this at the music-dsp mailing list. do you > want explicit closed form formulae for biquad coefs for Butterworth. > they exist. if you want i can get my email copies (and correct them, > 'cuz i did copulate 'em up a bit at first, but i think we fixed it). >
use this in reference to the Audio EQ cookbook that presently (and forever, i hope) lives at: http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt for an Nth order Butterworth (N even or odd) you will have N/2 biquad sections ((N-1)/2 for odd N or floor(N/2) for either even or odd N), each will have the same resonant frequency w0 and will have Q: Q = 1/( 2*sin((pi/N)*(n + 1/2)) ) where 0 <= n < (N-1)/2 then, use the cookbook LPF or HPF to get the coefs for each biquad section. if it's an odd order Butterworth, you'll need an additional 1st order section: H(z) = (b0 + b1*z^-1)/(a0 + a1*z^-1) 1st order LPF: H(s) = 1/(s+1) b0 = sin(w0) b1 = sin(w0) a0 = cos(w0) + sin(w0) + 1 a1 = sin(w0) - cos(w0) - 1 1st order HPF: H(s) = s/(s+1) b0 = cos(w0) + 1 b1 = -(cos(w0) + 1) a0 = cos(w0) + sin(w0) + 1 a1 = sin(w0) - cos(w0) - 1 credits to Peter Schoffhauzer <scoofyGET_THE_SPAM_OUT@inf.elte.hu> for catching and fixing errors. r b-j
Reply by Jerry Avins April 2, 20072007-04-02
bngguy wrote:

   ...

> Hello Vladimir, > Thanks for your reply,what i'm trying to do is i > have the coefficients for 1st order and 2nd order filters, im trying > to use them to compute the coefficients of any given order N by > breaking them into 1st and 2nd order filters, for example if i need > the coeffs for a 9th order filter i break them into 1 X 1st order and > 4 X 2nd order filters.since i already have the coeffs i just need to > find the transfer function for the entire filter by multiplying the > transfer functions of all of them together.unfortunately this method > does not produce the correct coeffs.
You don't already have the coefficients. The two biquads of a fifth-order Butterworth are different, and neither of them are the same as the one in a third-order filter. 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;
Reply by robert bristow-johnson April 2, 20072007-04-02
On Apr 2, 7:24 pm, "bngguy" <bng...@gmail.com> wrote:
> On Apr 2, 12:44 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com> > wrote: > > ... what i'm trying to do is i > have the coefficients for 1st order and 2nd order filters, im trying > to use them to compute the coefficients of any given order N by > breaking them into 1st and 2nd order filters, for example if i need > the coeffs for a 9th order filter i break them into 1 X 1st order and > 4 X 2nd order filters.since i already have the coeffs i just need to > find the transfer function for the entire filter by multiplying the > transfer functions of all of them together.unfortunately this method > does not produce the correct coeffs.
we were just talking about this at the music-dsp mailing list. do you want explicit closed form formulae for biquad coefs for Butterworth. they exist. if you want i can get my email copies (and correct them, 'cuz i did copulate 'em up a bit at first, but i think we fixed it). r b-j
Reply by bngguy April 2, 20072007-04-02
On Apr 2, 12:44 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> bngguy wrote: > > Hello All, > > I'm trying to develop code to implement cascade form IIR > > filters,i have already developed code to compute the coefficients for > > direct form filters and they work really well, now my problem is i > > have to compute coefficients for cascade form filters,from what i > > understand by reading various books and online material all i have to > > do is reduce the filter into biquads , for example lets say i want to > > compute the coefficents for a 5th order lowpass butterworth filter, > > i split up the the filter into two biquads and a 1st order filter, ie > > i multiply the transfer functions of the 2 biquads and 1st order > > filter together which should effectively give me the 5th order > > filter.I would like to know if this is an efficient way of computing > > coefficients given the filter order.Are there any other ways of > > computing cascade form filter coefficients from the direct form > > coefficients. I would appreciate any help. > > The Butterworth filter has the poles equally spaced on the half circle > in the S plane. All you have to do is remap those poles into Z plane > using the BLT. Obviously the each pair of the complex conjugate poles > gives you the coefficients for the corresponding biquad section, and the > real pole corresponds to the 1st order section. > > Vladimir Vassilevsky > > DSP and Mixed Signal Design Consultant > > http://www.abvolt.com
Hello Vladimir, Thanks for your reply,what i'm trying to do is i have the coefficients for 1st order and 2nd order filters, im trying to use them to compute the coefficients of any given order N by breaking them into 1st and 2nd order filters, for example if i need the coeffs for a 9th order filter i break them into 1 X 1st order and 4 X 2nd order filters.since i already have the coeffs i just need to find the transfer function for the entire filter by multiplying the transfer functions of all of them together.unfortunately this method does not produce the correct coeffs. Thanks Tim
Reply by Vladimir Vassilevsky April 2, 20072007-04-02

bngguy wrote:

> Hello All, > I'm trying to develop code to implement cascade form IIR > filters,i have already developed code to compute the coefficients for > direct form filters and they work really well, now my problem is i > have to compute coefficients for cascade form filters,from what i > understand by reading various books and online material all i have to > do is reduce the filter into biquads , for example lets say i want to > compute the coefficents for a 5th order lowpass butterworth filter, > i split up the the filter into two biquads and a 1st order filter, ie > i multiply the transfer functions of the 2 biquads and 1st order > filter together which should effectively give me the 5th order > filter.I would like to know if this is an efficient way of computing > coefficients given the filter order.Are there any other ways of > computing cascade form filter coefficients from the direct form > coefficients. I would appreciate any help.
The Butterworth filter has the poles equally spaced on the half circle in the S plane. All you have to do is remap those poles into Z plane using the BLT. Obviously the each pair of the complex conjugate poles gives you the coefficients for the corresponding biquad section, and the real pole corresponds to the 1st order section. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Reply by bngguy April 2, 20072007-04-02
Hello All,
             I'm trying to develop code to implement cascade form IIR
filters,i have already developed code to compute the coefficients for
direct form filters and they work really well, now my problem is i
have to compute coefficients for cascade form filters,from what i
understand by reading various books and online material all i have to
do is reduce the  filter into biquads , for example lets say i want to
compute the coefficents for a 5th order lowpass butterworth filter,
i split up the the filter into two biquads and a 1st order filter, ie
i multiply the transfer functions of the 2 biquads and 1st order
filter together which should effectively give me the 5th order
filter.I would like to know if this is an efficient way of computing
coefficients given the filter order.Are there any other ways of
computing cascade form filter coefficients from the direct form
coefficients. I would appreciate any help.

Thanks
Tim