DSPRelated.com
Forums

IIR Filter Recommendations

Started by davidross September 6, 2005
Hi Folks,

This is my first post on the list. Pleased to meet you all :-) This seems
to be an excellent resource of DSP knowledge and I look forward to
learning a lot.

My first question is with regards to IIR filters. I am looking to design
some IIR filters for audio (Low pass, band pass, and high pass). I know
there are several design approaches available and several structures but i
am interested to know if anyone could recommend a good design approach to
use. I mean, I know they are all good, if not great, but are there any
which are better suited to audio than others? I'm looking for a nice sharp
transition band and good stopband attenuation. Ideally I would like to make
a 3 Band Equalizer which has gain control over each band.

Thanks for any tips!

Cheers,
David


		
This message was sent using the Comp.DSP web interface on
www.DSPRelated.com
davidross wrote:
> Hi Folks, > > This is my first post on the list. Pleased to meet you all :-) This seems > to be an excellent resource of DSP knowledge and I look forward to > learning a lot. > > My first question is with regards to IIR filters. I am looking to design > some IIR filters for audio (Low pass, band pass, and high pass). I know > there are several design approaches available and several structures but i > am interested to know if anyone could recommend a good design approach to > use. I mean, I know they are all good, if not great, but are there any > which are better suited to audio than others? I'm looking for a nice sharp > transition band and good stopband attenuation. Ideally I would like to make > a 3 Band Equalizer which has gain control over each band. > > Thanks for any tips!
http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt should provide what you want. A three-band equalizer can be built with two filters and a gain control. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
in article ebOdnZ2dnZ2vvMb2nZ2dnUwlgN6dnZ2dRVn-zp2dnZ0@rcn.net, Jerry Avins
at jya@ieee.org wrote on 09/06/2005 11:42:

> davidross wrote: >> Hi Folks, >> >> This is my first post on the list. Pleased to meet you all :-) This seems >> to be an excellent resource of DSP knowledge and I look forward to >> learning a lot. >> >> My first question is with regards to IIR filters. I am looking to design >> some IIR filters for audio (Low pass, band pass, and high pass). I know >> there are several design approaches available and several structures but i >> am interested to know if anyone could recommend a good design approach to >> use. I mean, I know they are all good, if not great, but are there any >> which are better suited to audio than others? I'm looking for a nice sharp >> transition band and good stopband attenuation. Ideally I would like to make >> a 3 Band Equalizer which has gain control over each band. >> >> Thanks for any tips! > > http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt should provide what > you want. A three-band equalizer can be built with two filters and a > gain control.
second order might not be good enough for David -> "... nice sharp transition band and good stopband attenuation." if he finds some nice concise information on higher order Butterworth or Tchebyshev, he can still use the cookbook for each 2nd order section. dunno. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
robert bristow-johnson wrote:
> in article ebOdnZ2dnZ2vvMb2nZ2dnUwlgN6dnZ2dRVn-zp2dnZ0@rcn.net, Jerry Avins > at jya@ieee.org wrote on 09/06/2005 11:42: > > >>davidross wrote: >> >>>Hi Folks, >>> >>>This is my first post on the list. Pleased to meet you all :-) This seems >>>to be an excellent resource of DSP knowledge and I look forward to >>>learning a lot. >>> >>>My first question is with regards to IIR filters. I am looking to design >>>some IIR filters for audio (Low pass, band pass, and high pass). I know >>>there are several design approaches available and several structures but i >>>am interested to know if anyone could recommend a good design approach to >>>use. I mean, I know they are all good, if not great, but are there any >>>which are better suited to audio than others? I'm looking for a nice sharp >>>transition band and good stopband attenuation. Ideally I would like to make >>>a 3 Band Equalizer which has gain control over each band. >>> >>>Thanks for any tips! >> >>http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt should provide what >>you want. A three-band equalizer can be built with two filters and a >>gain control. > > > second order might not be good enough for David -> "... nice sharp > transition band and good stopband attenuation." if he finds some nice > concise information on higher order Butterworth or Tchebyshev, he can still > use the cookbook for each 2nd order section. dunno.
I read that but overlooked it. A "nice sharp transition band" is a poor choice for most audio program material. Granted, there are exceptions. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
"Jerry Avins" <jya@ieee.org> wrote in message 
news:FOKdnX64RMJGj4PeRVn-3A@rcn.net...
> robert bristow-johnson wrote: >> in article ebOdnZ2dnZ2vvMb2nZ2dnUwlgN6dnZ2dRVn-zp2dnZ0@rcn.net, Jerry Avins >> at jya@ieee.org wrote on 09/06/2005 11:42: >> >> >>>davidross wrote: >>> >>>>Hi Folks, >>>> >>>>This is my first post on the list. Pleased to meet you all :-) This seems >>>>to be an excellent resource of DSP knowledge and I look forward to >>>>learning a lot. >>>> >>>>My first question is with regards to IIR filters. I am looking to design >>>>some IIR filters for audio (Low pass, band pass, and high pass). I know >>>>there are several design approaches available and several structures but i >>>>am interested to know if anyone could recommend a good design approach to >>>>use. I mean, I know they are all good, if not great, but are there any >>>>which are better suited to audio than others? I'm looking for a nice sharp >>>>transition band and good stopband attenuation. Ideally I would like to make >>>>a 3 Band Equalizer which has gain control over each band. >>>> >>>>Thanks for any tips! >>> >>>http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt should provide what >>>you want. A three-band equalizer can be built with two filters and a >>>gain control. >> >> >> second order might not be good enough for David -> "... nice sharp >> transition band and good stopband attenuation." if he finds some nice >> concise information on higher order Butterworth or Tchebyshev, he can still >> use the cookbook for each 2nd order section. dunno. > > I read that but overlooked it. A "nice sharp transition band" is a poor choice > for most audio program material. Granted, there are exceptions.
If the OP wants to emulate traditional analog equalizers, then a second order IIR is the way to go. In a 3-band implementation, the center band is almost always a "peaking" filter (see the cookbook for definition). The top and bottom bands may either be high shelf and low shelf respectively, or also be peaking filters. I'm not sure which is more common in the analog world.
Hi folks,

Thanks very much for your answers and help. I have used the cookbook
before and implemented some filters using the algorithms straight from the
cookbook. Yep, they are classics. I had considered maybe cascading the
second order sections from the cookbook to get a better response i.e.
sharper transition. Someone mentioned that sharp transitions are not
recommended for 3 Band Equalizers. Is that because the EQ could then sound
to 'harsh' i.e it is nicer to have a smoother sounding rolloff?

RBJ also mentioned that I could find a good reference on Butterworth or
Chebshev but still use the Cookbook second order sections? Do you mean I
could use the structure of the second order IIR routine i.e. the time
domain implementation, or that I could use for example (for HP)...

 b0 =  (1 + cos(w0))/2
 b1 = -(1 + cos(w0))
 b2 =  (1 + cos(w0))/2
 a0 =   1 + alpha
 a1 =  -2*cos(w0)
 a2 =   1 - alpha

..and use a Butterworth or Chebyshev design to compute the 'alpha'
value?

Thanks once again for your help. Its great to be in the presence of such
Filter Gods!

Cheers,
David



		
This message was sent using the Comp.DSP web interface on
www.DSPRelated.com
davidross wrote:
> > Thanks very much for your answers and help. I have used the cookbook > before > ... they are classics.
there are some hardcore analog audio guys that would take issue with that. particularly the way i (mis)define Q or BW for the peakingEQ.
> I had considered maybe cascading the > second order sections from the cookbook to get a better response i.e. > sharper transition.
> RBJ also mentioned that I could find a good reference on Butterworth or > Chebshev but still use the Cookbook second order sections? Do you mean I > could use the structure of the second order IIR routine i.e. the time > domain implementation, or that I could use for example (for HP)... > > b0 = (1 + cos(w0))/2 > b1 = -(1 + cos(w0)) > b2 = (1 + cos(w0))/2 > a0 = 1 + alpha > a1 = -2*cos(w0) > a2 = 1 - alpha > > ..and use a Butterworth or Chebyshev design to compute the 'alpha' > value?
yes. particularly for the Butterworth. there's a nice formula for the Q for each section for an Nth order Butterworth (and they all have the same w0. for Chebyshev, there are different w0 and Q for each section. i don't have the math handy. maybe someone else does. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message 
news:1126141185.137440.269720@g44g2000cwa.googlegroups.com...
> > davidross wrote: >> >> Thanks very much for your answers and help. I have used the cookbook >> before >> ... they are classics. > > there are some hardcore analog audio guys that would take issue with > that. particularly the way i (mis)define Q or BW for the peakingEQ.
Is there any standardized way of defining it?
Thanks, I'll look into that..

David

>there's a nice formula for the >Q for each section for an Nth order Butterworth (and they all have the >same w0. for Chebyshev, there are different w0 and Q for each section. > >i don't have the math handy. maybe someone else does. > >-- > >r b-j rbj@audioimagination.com > >"Imagination is more important than knowledge." > >
This message was sent using the Comp.DSP web interface on www.DSPRelated.com
in article EVNTe.83$QK2.77@trnddc03, Jon Harris at jon99_harris7@hotmail.com
wrote on 09/07/2005 23:07:

> "robert bristow-johnson" <rbj@audioimagination.com> wrote in message > news:1126141185.137440.269720@g44g2000cwa.googlegroups.com... >> >> davidross wrote: >>> >>> Thanks very much for your answers and help. I have used the cookbook >>> before >>> ... they are classics. >> >> there are some hardcore analog audio guys that would take issue with >> that. particularly the way i (mis)define Q or BW for the peakingEQ. > > Is there any standardized way of defining it?
i wouldn't necessarily call it "standard", but the common definition of Q for a peakingEQ that is *boosting* ("dBgain > 0) is to express it as a BPF in parallel with a "wire", and the Q of the BPF is the Q of the EQ. for the case of cutting, if you don't modify the definition of Q, your cut of N dB will not match a boost of N dB with the same Q. so they modify the definition of Q for cutting so that it is a mirror image of the boost with the same Q. in any case for analog EQs, the bandwidth in octaves and the Q are related as 1/Q = 2*sinh(ln(2)/2*BW) for a digital EQ, i think a better relationship would be 1/Q = 2*sinh(ln(2)/2*BW*w0/sin(w0)) where w0 = 2*pi*f0/Fs because of frequency warping. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."