DSPRelated.com
Forums

Wanted: critically-damped high-pass IIR filter

Started by axlq July 31, 2004
Randy Yates wrote:

> Jerry Avins <jya@ieee.org> writes: > > >>>>>>You don't design a 4th-order filter by stacking two 2nd-order filters. > > > and then proceeded to write: > > >>Suppose that circumstances limit you to cascading single RC circuits. >>Each section rolls off at 6 dB/8ve, but you want a 12 dB/8ve rolloff, so >>you use two. The corner frequency of a single section occurs when RC=1, >>at which point the response is -3 dB, half the asymptotic rolloff. With >>cascaded identical sections, the corner response is -6 dB, again half >>the asymptotic rolloff. The corner be sharpened. I described how above: >>change R1C1 and R2C2, keeping the product R1R2C1C2 constant. When R1C1 >>is twice or half R2C2, the corner will be only 3 dB down. The response >>will show a peak if the disparity is made greater. >> >> |&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;| >> >---/\/\/\/---|---| buffer |---/\/\/\/---|---o >> R1 | |________| R2 | >> | | >> ----- ----- >> ----- C1 ----- C2 >> | | >> | | >> &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; >> &#4294967295;&#4294967295;&#4294967295; &#4294967295;&#4294967295;&#4294967295; >> &#4294967295; &#4294967295; > > > in which he designed a 2nd-order filter by stacking two 1st-order > filters, a very similar exercise. > > I rest my case. > > The problem wasn't one of understanding but rather one of writing > clearly.
I don't understand what case you rest. Alex supposed that by cascading two order-N filters of a particular type, he would realize an order-2N filter of the same type. I tried to disabuse him. You disagreed with my exposition. I evidently don't understand the basis of that disagreement. When I do, I'll very likely agree with you, but until then, I can't. Jerry -- 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;
"Jerry Avins" <jya@ieee.org> wrote in message
news:410fd4a4$0$2824$61fed72c@news.rcn.com...
> Randy Yates wrote: > > > > > in which he designed a 2nd-order filter by stacking two 1st-order > > filters, a very similar exercise. > > > > I rest my case. > > > > The problem wasn't one of understanding but rather one of writing > > clearly. > > I don't understand what case you rest. Alex supposed that by cascading > two order-N filters of a particular type, he would realize an order-2N > filter of the same type. I tried to disabuse him. You disagreed with my > exposition. I evidently don't understand the basis of that disagreement. > When I do, I'll very likely agree with you, but until then, I can't.
OK, allow me to play the part of the mediator. :-) From reading this thread, the confusion between Jerry and Randy lies between 1) the GENERIC ability to construct any higher order filter out of 2nd order sections and 2) the SPECIFIC ability to construct an nth order Butterworth/Bessel/etc. filter out of N/2 identical second order sections, each of which is also Butterworth/Bessel/etc.. Randy is arguing that any higher order filter can be decomposed into second order sections (with possibly an odd first order section required). We all agree with that. Jerry is arguing that you can't make a 4th order Butterworth out of two 2nd order Butterworths. I think we all agree with that as well. There is no discrepancy, merely two people arguing two different points. Looking at the history of this thread, I believe the confusion started when Jerry said: "You don't design a 4th-order filter by stacking two 2nd-order filters. Check this: A pair of cascaded 2-pole Butterworth filters doesn't have a 4-pole butterworth response." (Jerry) Randy then just quoted the first sentence (out of context): "You don't design a 4th-order filter by stacking two 2nd-order filters." He then began to argue that it was incorrect, that you can design any 4th-order filter by decomposing it into two 2nd order sections. I think we can agree that Jerry's first sentence, taken out of context and applied to general filter problem, could be confusing. But that when read in the context of his entire post, is perfectly acceptable. Everyone happy now?!? :-) -Jon
Jon Harris wrote:

> "Jerry Avins" <jya@ieee.org> wrote in message > news:410fd4a4$0$2824$61fed72c@news.rcn.com... > >>Randy Yates wrote: >> >> >>>in which he designed a 2nd-order filter by stacking two 1st-order >>>filters, a very similar exercise. >>> >>>I rest my case. >>> >>>The problem wasn't one of understanding but rather one of writing >>>clearly. >> >>I don't understand what case you rest. Alex supposed that by cascading >>two order-N filters of a particular type, he would realize an order-2N >>filter of the same type. I tried to disabuse him. You disagreed with my >>exposition. I evidently don't understand the basis of that disagreement. >>When I do, I'll very likely agree with you, but until then, I can't. > > > OK, allow me to play the part of the mediator. :-) > > From reading this thread, the confusion between Jerry and Randy lies between 1) > the GENERIC ability to construct any higher order filter out of 2nd order > sections and 2) the SPECIFIC ability to construct an nth order > Butterworth/Bessel/etc. filter out of N/2 identical second order sections, each > of which is also Butterworth/Bessel/etc.. > > Randy is arguing that any higher order filter can be decomposed into second > order sections (with possibly an odd first order section required). We all > agree with that. > > Jerry is arguing that you can't make a 4th order Butterworth out of two 2nd > order Butterworths. I think we all agree with that as well. > > There is no discrepancy, merely two people arguing two different points. > > Looking at the history of this thread, I believe the confusion started when > Jerry said: > > "You don't design a 4th-order filter by stacking two 2nd-order filters. > Check this: A pair of cascaded 2-pole Butterworth filters doesn't have a > 4-pole butterworth response." (Jerry) > > Randy then just quoted the first sentence (out of context): "You don't design a > 4th-order filter by stacking two 2nd-order filters." He then began to argue that > it was incorrect, that you can design any 4th-order filter by decomposing it > into two 2nd order sections. > > I think we can agree that Jerry's first sentence, taken out of context and > applied to general filter problem, could be confusing. But that when read in > the context of his entire post, is perfectly acceptable. > > Everyone happy now?!? :-) > > -Jon
I hope you're right. That certainly makes me happy. I appreciate your help, but I wouldn't call it mediating. Clarifying was all that was needed. Thanks. Jerry -- 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;
In article <410fd4a4$0$2824$61fed72c@news.rcn.com>,
Jerry Avins  <jya@ieee.org> wrote:
>I don't understand what case you rest. Alex supposed that by cascading >two order-N filters of a particular type, he would realize an order-2N >filter of the same type. I tried to disabuse him.
And you did. I think what both of you are saying, both of you can agree with: Jerry: You can't get a 2N-order Butterworth (or any specific type) by cascading N 2-order filters of that type. Randy: You CAN get some sort of 2N-order filter by cascading N 2-order filters. Both statements are true, are they not? -Alex
In article <2na4dhFtq2njU1@uni-berlin.de>,
Jon Harris <goldentully@hotmail.com> wrote:
>Randy is arguing that any higher order filter can be decomposed into second >order sections (with possibly an odd first order section required). We all >agree with that. > >Jerry is arguing that you can't make a 4th order Butterworth out of two 2nd >order Butterworths. I think we all agree with that as well. > >There is no discrepancy, merely two people arguing two different points.
And this all started with me quoting a web page http://www.rane.com/note147.html which stated that cascading N 2-order Butterworths gives you a 2N-order Butterworth, because the filter coefficients for any 2N-order Butterworth can be calculated via recursing the 2-order coefficients. I now know that, while the latter is true, the former is not. -Alex
In article <410fbb50$0$2820$61fed72c@news.rcn.com>,
Jerry Avins  <jya@ieee.org> wrote:
>axlq wrote: > >> ... If I had any more than my limited >> DSP knowledge, I'd try to come up with a 4th-order or 6th-order >> critically-damped highpass filter in one go, rather than by stacking >> 2nd-order filters, but I don't have the knowledge to construct such >> a thing. > >Whatever you design, implement as a cascade of second-order sections. >Higher orders lead to numerical instability, such as needing the >difference between large approximate numbers yielding a result whose >potential error exceeds its size. Cascades are hard enough -- in >practice, even their order matters. Don't buy trouble.
Even a 4th-order Bessel will lead to instability? Or a 4th-order critically damped Butterworth-like thing? The reason I wanted this was because I noticed that my 2nd-order critically damped high pass filter, when cascaded, stopped being critically damped. I suspected that the stacking might be responsible somehow. This made me curious if a 4th-order critically damped highpass filter, designed from scratch, would exhibit the same ringing I observed when cascading two 2nd order filters. -Alex
In article <2n9vicFu6stdU1@uni-berlin.de>,
Jon Harris <goldentully@hotmail.com> wrote:
>"Randy Yates" <yates@ieee.org> wrote in message news:acxciftz.fsf@ieee.org... > >> but I don't think relevent to the OPs inquiry. He just wants >> a high order filter with no overshoot or ringing and could >> give a squat as to whether or not the individual sections are >> Butterworth, Bessel, or Rube Goldberg. > >It may be relevant because the OP had complained that when he >cascaded 2 of his identical filters, the response wasn't what he >expected/wanted.
You're both right... I did complain that the cascading two of my critically-damped 2nd-order filters resulted in losing the critical damping. And yes, I really do want a high-order high-pass filter that's critically damped, with no overshoot or ringing, and I don't care what kind of filter it is or how it's constructed, as long as it works. It needs to be an IIR filter because I may need to dynamically change the cutoff in real time, and this isn't practical with an FIR filter. Peter Nachtwey posted in this thread the algorithm for a 2-pole highpass Bessel. I coded it up last night but haven't tried stacking them yet to see how the damping works at higher orders (I had to leave on a business trip, so won't get back to it until Friday). I was interested to see that the frequency response falls off at the same rate as the critically-damped "Butterworth" filter, although the Bessel has a slightly sharper shoulder when adjusted for the same 3 dB point. As the "OP" here, I want to thank you all for the lively discussion. I don't know much about deriving my own filters (yet). Z-transforms and how to use them still mystify me (although I'm slowly "getting it"). I don't have any feel for how poles and zeros must be distributed in the z plane to get the behavior I want -- especially balancing my frequency-domain requirements with my time-domain requirements. And I suspect I might need to learn something like Matlab or Mathcad. All of this seems like a dauntingly steep learning curve to build a little filter. Is there any good book or web site that is technically detailed yete intellectually accessible to a layman? Everything I find is either too basic or too obscure. All I know about DSP I've learned by osmosis, and this thread has contributed much enlightenment. Even better, if a "DSP Recipes" book exists, analogous to the classic "Numerical Recipes" book, that would be a godsend. I can sort of understand the FIR/IIR filtering chapter in Numerical Recipes, but there's not enough there. -Alex
In article <10gu9cutj123gf7@corp.supernews.com>,
Tim Wescott  <tim@wescottnospamdesign.com> wrote:
>By "critically damped" do you mean "poles only occur in pairs on the >real line" or do you mean "monotonic time domain response"? > >Where I come from (control theory) "critically damped" means the former, >_not_ the latter.
Where I come from, it means that the response to a step function converges most quickly without overshoot. I'm not well-versed enough in this field of DSP to know what that means in terms of distribution of poles and zeros. The critically-damped filter I was using looks exactly like a Butterworth, except for a term in the coefficient denominator being 2W instead of sqrt(2)W, where W is "omega" the angular cutoff frequency. I have described the calculations for this filter at http://unicorn.us.com/alex/buttercrit.html The calculation includes a correction factor for the cutoff frequency when cascading multiple filters, to preserve the 3 dB frequency at the desired value. -Alex
"axlq" <axlq@spamcop.net> wrote in message
news:cep3vq$7vs$4@blue.rahul.net...

> Peter Nachtwey posted in this thread the algorithm for a 2-pole > highpass Bessel. I coded it up last night but haven't tried > stacking them yet to see how the damping works at higher orders > (I had to leave on a business trip, so won't get back to it until > Friday). I was interested to see that the frequency response falls > off at the same rate as the critically-damped "Butterworth" filter, > although the Bessel has a slightly sharper shoulder when adjusted > for the same 3 dB point. > > As the "OP" here, I want to thank you all for the lively discussion. > I don't know much about deriving my own filters (yet). Z-transforms > and how to use them still mystify me (although I'm slowly "getting > it"). I don't have any feel for how poles and zeros must be > distributed in the z plane to get the behavior I want -- especially > balancing my frequency-domain requirements with my time-domain > requirements. And I suspect I might need to learn something like > Matlab or Mathcad. All of this seems like a dauntingly steep > learning curve to build a little filter. Is there any good book or > web site that is technically detailed yete intellectually accessible > to a layman? Everything I find is either too basic or too obscure. > All I know about DSP I've learned by osmosis, and this thread has > contributed much enlightenment. > > -Alex
There has been some good info here. Alex, get a math package. A math good math package will allow you to learn more faster. You can also see that they are good for documentation as they can express the formulas easily. It takes me about 15 minutes to make one of those filter webpages in Mathcad format and another 5 minutes to convert it to a web page and post it. That isn't much effort. One can make filters and test theories in minutes. Jerry is right about being able to cascade two non Bessel filters to get a fourth order Bessel filter. It is easy to see if you looked at a root locus of either a 4 pole Bessel or Butterworth filter that the poles are spread around and are not duplicates like what would happen if two indentical second order filters were cascaded. To cascade two second order filters into a equivelent fourth order, one needs to find the poles of the fourth order and then make two second order filters that have those poles. Not hard. I have always seen a four order Butterworth filter expressed as cascaded second order filters that are not the same. BTW, it is easy to see that both of these second order filters are underdamped as both the cos(pi/8) and the sin(pi/8) are both less than 1. Peter Nachtwey
Peter Nachtwey wrote:

> "axlq" <axlq@spamcop.net> wrote in message > news:cep3vq$7vs$4@blue.rahul.net... > > >>Peter Nachtwey posted in this thread the algorithm for a 2-pole >>highpass Bessel. I coded it up last night but haven't tried >>stacking them yet to see how the damping works at higher orders >>(I had to leave on a business trip, so won't get back to it until >>Friday). I was interested to see that the frequency response falls >>off at the same rate as the critically-damped "Butterworth" filter, >>although the Bessel has a slightly sharper shoulder when adjusted >>for the same 3 dB point. >> >>As the "OP" here, I want to thank you all for the lively discussion. >>I don't know much about deriving my own filters (yet). Z-transforms >>and how to use them still mystify me (although I'm slowly "getting >>it"). I don't have any feel for how poles and zeros must be >>distributed in the z plane to get the behavior I want -- especially >>balancing my frequency-domain requirements with my time-domain >>requirements. And I suspect I might need to learn something like >>Matlab or Mathcad. All of this seems like a dauntingly steep >>learning curve to build a little filter. Is there any good book or >>web site that is technically detailed yete intellectually accessible >>to a layman? Everything I find is either too basic or too obscure. >>All I know about DSP I've learned by osmosis, and this thread has >>contributed much enlightenment. >> >>-Alex > > > There has been some good info here. Alex, get a math package. A math good > math package will allow you to learn more faster. You can also see that > they are good for documentation as they can express the formulas easily. > It takes me about 15 minutes to make one of those filter webpages in > Mathcad format and another 5 minutes to convert it to a web page and post > it. That isn't much effort. One can make filters and test theories in > minutes. Jerry is right about being able to cascade two non Bessel > filters to get a fourth order Bessel filter. It is easy to see if you > looked at a root locus of either a 4 pole Bessel or Butterworth filter that > the poles are spread around and are not duplicates like what would happen if > two indentical second order filters were cascaded. To cascade two second > order filters into a equivelent fourth order, one needs to find the poles of > the fourth order and then make two second order filters that have those > poles. Not hard. I have always seen a four order Butterworth filter > expressed as cascaded second order filters that are not the same. BTW, it > is easy to see that both of these second order filters are underdamped as > both the cos(pi/8) and the sin(pi/8) are both less than 1. > > Peter Nachtwey > > > >
If cost is an issue get Scilab instead of Matlab (http://www.scilab.org). If cost isn't an issue, get MathCad or one of it's brothers. Matlab and MathCad are two completely different critters, I use each for different things. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com