Reply by Jerry Avins July 13, 20052005-07-13
Robin Clark wrote:
> On Sat, 12 Jun 2004 09:35:13 +0000, Tim Wescott wrote: > > >>sammyd wrote: >> >> >>>Hi, >>>i would like to design a 10 tap IIR butterworth filter with a given >>>cutoff. What tools are available to help me realise this in C. >>> >>>for example for RBJ's biquad filters there are equations on how to >>>update your coefficients when your cutoff or sr changes. i'm looking to >>>do something similar but on a higher order filter. >>> >>>thanks for any suggestions or pointers ... >>> >>>regards, >>>sam >>> >> >>I hope you mean that you want to implement a 10th order IIR filter, not >>that you're going to try and implement a 10th order polynomial directly! >> >>Direct polynomial implementations get very bad very quickly -- the >>precision required goes up exponentially with the number of poles, so >>even if your poles are fairly distant from z = 1.0 you still get into >>numeric trouble fairly quickly. >> >>It's much better to implement your filter as a cascade of 1st- and >>2nd-order filters. > >
> Not exponentially. > It goes up linearly. > Have an 8 bit filter that is two stage, and say a precision of > 16 bits, then a 3 stage needs 24 and 4 stage needs 32 and so on. Linear in bits is exponential in precision. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by Andor July 13, 20052005-07-13
Robin wrote:

> It goes up linearly. > > Have an 8 bit filter that is two stage, and say a precision of > 16 bits, then a 3 stage needs 24 and 4 stage needs 32 and so on.
I'd say that bits are a lograthmic measure for resolution. Therefore, a linear increase in the number of bits would imply exponential increase in resolution. Regards, Andor
Reply by Robin Clark July 13, 20052005-07-13
On Sat, 12 Jun 2004 09:35:13 +0000, Tim Wescott wrote:

> sammyd wrote: > >> Hi, >> i would like to design a 10 tap IIR butterworth filter with a given >> cutoff. What tools are available to help me realise this in C. >> >> for example for RBJ's biquad filters there are equations on how to >> update your coefficients when your cutoff or sr changes. i'm looking to >> do something similar but on a higher order filter. >> >> thanks for any suggestions or pointers ... >> >> regards, >> sam >> > > I hope you mean that you want to implement a 10th order IIR filter, not > that you're going to try and implement a 10th order polynomial directly! > > Direct polynomial implementations get very bad very quickly -- the > precision required goes up exponentially with the number of poles, so > even if your poles are fairly distant from z = 1.0 you still get into > numeric trouble fairly quickly. > > It's much better to implement your filter as a cascade of 1st- and > 2nd-order filters.
-- Not exponentially. It goes up linearly. Have an 8 bit filter that is two stage, and say a precision of 16 bits, then a 3 stage needs 24 and 4 stage needs 32 and so on. |
Reply by Robin Clark July 13, 20052005-07-13
On Sat, 12 Jun 2004 09:35:13 +0000, Tim Wescott wrote:

> sammyd wrote: > >> Hi, >> i would like to design a 10 tap IIR butterworth filter with a given >> cutoff. What tools are available to help me realise this in C. >> >> for example for RBJ's biquad filters there are equations on how to >> update your coefficients when your cutoff or sr changes. i'm looking to >> do something similar but on a higher order filter. >> >> thanks for any suggestions or pointers ... >> >> regards, >> sam >> > > I hope you mean that you want to implement a 10th order IIR filter, not > that you're going to try and implement a 10th order polynomial directly! > > Direct polynomial implementations get very bad very quickly -- the > precision required goes up exponentially with the number of poles, so > even if your poles are fairly distant from z = 1.0 you still get into > numeric trouble fairly quickly. > > It's much better to implement your filter as a cascade of 1st- and > 2nd-order filters.
-- Not exponentially. It goes up linearly. Have an 8 bit filter that is two stage, and say a precision of 16 bits, then a 3 stage needs 24 and 4 stage needs 32 and so on. |
Reply by Adrian June 16, 20042004-06-16
try me digital filter design tool:
http://www.winfilter.20m.com

regards,
Adrian

sammyd wrote:

> Hi, > i would like to design a 10 tap IIR butterworth filter with a given > cutoff. What tools are available to help me realise this in C. > > for example for RBJ's biquad filters there are equations on how to > update your coefficients when your cutoff or sr changes. i'm looking to > do something similar but on a higher order filter. > > thanks for any suggestions or pointers ... > > regards, > sam >
Reply by Robin Clark June 13, 20042004-06-13
On Sun, 13 Jun 2004 09:20:15 +0000, Jerry Avins wrote:

> Robin Clark wrote: > >> On Sat, 12 Jun 2004 09:35:13 +0000, Tim Wescott wrote: >> >> >>>sammyd wrote: >>> >>> >>>>Hi, >>>>i would like to design a 10 tap IIR butterworth filter with a given >>>>cutoff. What tools are available to help me realise this in C. >>>> >> >> >>>It's much better to implement your filter as a cascade of 1st- and >>>2nd-order filters. >> >> Aggree > > > but Not exponentially. > > > > It goes up linearly. > > > Have an 8 bit filter that is two stage, and say a precision of > > 16 bits, then a 3 stage needs 24 and 4 stage needs 32 and so on. > > Linearly in bit count, exponentially in magnitude.
Yup. By by powers of 2.... A well defined exponential... -- [=========] -==++""" . /. . . \ . """++==- -+"" \ .. . . | .. . | . . . / ""+- /\ +-"" `-----=====\ <O> /=====-----' ""-+ /\ / / ""="" \ \ / / \ \ // | \\ /") \ | / ("\ \o\ \*/ /o/ \ ) --**O**-- ( / /*\ / | \ |
Reply by Jerry Avins June 13, 20042004-06-13
Robin Clark wrote:

> On Sat, 12 Jun 2004 09:35:13 +0000, Tim Wescott wrote: > > >>sammyd wrote: >> >> >>>Hi, >>>i would like to design a 10 tap IIR butterworth filter with a given >>>cutoff. What tools are available to help me realise this in C. >>> > > >>It's much better to implement your filter as a cascade of 1st- and >>2nd-order filters. > > Aggree
> but Not exponentially. > > It goes up linearly. > Have an 8 bit filter that is two stage, and say a precision of > 16 bits, then a 3 stage needs 24 and 4 stage needs 32 and so on. Linearly in bit count, exponentially in magnitude. -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Robin Clark June 13, 20042004-06-13
On Sat, 12 Jun 2004 09:35:13 +0000, Tim Wescott wrote:

> sammyd wrote: > >> Hi, >> i would like to design a 10 tap IIR butterworth filter with a given >> cutoff. What tools are available to help me realise this in C. >>
> It's much better to implement your filter as a cascade of 1st- and > 2nd-order filters.
Aggree -- but Not exponentially. It goes up linearly. Have an 8 bit filter that is two stage, and say a precision of 16 bits, then a 3 stage needs 24 and 4 stage needs 32 and so on. |
Reply by Stephan M. Bernsee June 13, 20042004-06-13
Hi Jerry,

actually, your example works on my machine as well. However, the
bandpass resonator I tried does not (sr=44100, fc=1000, q=10). Maybe
that applet is broken...

Thanks!
--smb


Jerry Avins <jya@ieee.org> wrote in message news:<40cb442a$0$2983$61fed72c@news.rcn.com>...
> Stephan M. Bernsee wrote: > > > Hi Erik, > > > > did you actually try that page? All I'm getting is an "Error! Command > > failed (return code 256)" message no matter what kind of filter I > > try... :-( > > > > --smb > > ... > > "You specified the following parameters: > > filtertype = Butterworth > passtype = Lowpass > ripple = > order = 6 > samplerate = 8000 > corner1 = 200" > > worked for me. Could it be a problem with Java on your machine? > > Jerry
Reply by Tim Wescott June 12, 20042004-06-12
Erik de Castro Lopo wrote:

> sammyd wrote: > >>Hi, >>i would like to design a 10 tap IIR butterworth filter with a given >>cutoff. What tools are available to help me realise this in C. >> >>for example for RBJ's biquad filters there are equations on how to >>update your coefficients when your cutoff or sr changes. i'm looking to >>do something similar but on a higher order filter. > > > Try this: > > http://www-users.cs.york.ac.uk/~fisher/mkfilter/ > > Erik
Same comments -- with an IIR you want to be careful about a direct realization because of numerical problems. I would use cascaded 2nd-order filters to avoid this. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com