DSPRelated.com
Forums

Wanted: critically-damped high-pass IIR filter

Started by axlq July 31, 2004
In article <fz74sxi1.fsf@ieee.org>, Randy Yates  <yates@ieee.org> wrote:
>And also, now that I think about this for a second more, it MUST be >the case, at least theoretically, that cascaded filters give the >same response as one big filter. This is basic linear system theory. >The sections are linear systems, and the frequency response of the >composite filter is the product of the invidividual filters.
Yes, but as mentioned elsewhere in this thread, cascaded filters won't give the same response as one big filter of the same type. That is, you can cascade two 2nd-order non-Butterworth filters to get a 4th-order Butterworth. Or you can cascade two 2nd-order Butterworths and you'll get something like, but not quite, a 4th-order Butterworth (I think that particular result might be called a "4th-order Linkwitz-Riley filter").
>If there is some problem in cascading, it must be a practical >one. Can you expound?
Me? I had asked the question originally. The only problems *I* can think of is some additional calculation time, and possibly a messy job figuring out what cutoff frequency to use for the cascaded filters to get the desired cutoff frequency in the end result. I've also noticed a problem (which is what started this whole thread; see the subject) that a critically-damped 2nd-order high pass filter stops being critically damped if you try to cascade them, and I'm not sure why. 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. -Alex
axlq wrote:

> In article <4qnlt0ax.fsf@ieee.org>, Randy Yates <yates@ieee.org> wrote: > >>Jerry Avins <jya@ieee.org> writes: >> >>>You don't design a 4th-order filter by stacking two 2nd-order filters. >> >>I should also add that I'm fairly certain I've seen Nth order digital >>filters split into N/2 biquad (2nd-order) sections (N = 2n). > > > Yes, here is was confused me: > > http://kwon3d.com/theory/filtering/fil.html > > Near the bottom there are some recursive formulas for generating > filter coefficients for a Butterworth filter of order 2N. > > Following those formulas there's this statement: "For example, > a 6th-order low-pass filter has 3 (6 divided by 2) elementary > 2nd-order filters. Passing the data through these 3 2nd-order > filters consecutively is the same to passing them through the > 6th-order filter once." > > So, I believed it until someone else demonstrated to me by sending > graphics in private email that cascading two 2nd-order Butterworths > isn't the same as a 4th-order Butterworth. > > I must ask: besides computation time, is there an advantage to using > a single 4th-order or higher-order filter, rather than cascading > some 2nd-order filters to acheive approximately the same result? > > -A
Cascading two second order Butterworths doesn't give you one fourth order Butterworths, but _any_ 2N-order filter can be made by cascading N 2nd-order filters. You just make one 2nd-order filter for each of the complex pole pairs in the big filter, distribute your zeros appropriately, and cascade away. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
axlq wrote:

> A critically-damped 2-pole Butterworth lowpass filter is described > in http://people.umass.edu/exsci735/Robertson&Dowling.pdf > > A method to convert this filter to a highpass filter is described in > http://www.health.uottawa.ca/biomech/lab/docs/ncb2_sm.pdf > > Those two papers are short and simple enough for a non-DSP guy > like me to understand. One thing the second paper doesn't say is > that one must invert the lowpass correction factor to preserve > the high-pass cutoff frequency when cascading multiple high-pass > filters. > > A 2-pole Butterworth highpass filter constructed this way works > fine, critical damping and all. The frequency response is as > one would expect, both for a single pass and also when cascading > multiple filters. > > PROBLEM: The critical damping feature is lost when one tries to > cascade multiple high-pass filters to achieve better rejection > of low frequencies. The critically damped highpass filter rings > (albeit more slowly than the Butterworth), and seems to take forever > to settle down. > > Does anyone have an algorithm for a high-pass critically-damped > filter that has better low frequency rejection than a 2-pole > Butterworth? I don't care how uniformly the frequency response > falls off toward low frequencies (i.e. the dB/octave is free to > be different in any octave). All I want is critical damping (no > overshoot or ringing), combined with about 20 dB attenuation at 1/2 > the 3 dB cutoff frequency. > > Unfortunately I'm not well versed enough in how to use z transforms > and such to figure it out for myself. I appreciate any help or > pointers in the right direction. > > -Alex
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. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Tim Wescott wrote:

> axlq wrote: > >> In article <4qnlt0ax.fsf@ieee.org>, Randy Yates <yates@ieee.org> wrote: >> >>> Jerry Avins <jya@ieee.org> writes: >>> >>>> You don't design a 4th-order filter by stacking two 2nd-order filters. >>> >>> >>> I should also add that I'm fairly certain I've seen Nth order digital >>> filters split into N/2 biquad (2nd-order) sections (N = 2n). >> >> >> >> Yes, here is was confused me: >> >> http://kwon3d.com/theory/filtering/fil.html >> >> Near the bottom there are some recursive formulas for generating >> filter coefficients for a Butterworth filter of order 2N. >> >> Following those formulas there's this statement: "For example, >> a 6th-order low-pass filter has 3 (6 divided by 2) elementary >> 2nd-order filters. Passing the data through these 3 2nd-order >> filters consecutively is the same to passing them through the >> 6th-order filter once." >> >> So, I believed it until someone else demonstrated to me by sending >> graphics in private email that cascading two 2nd-order Butterworths >> isn't the same as a 4th-order Butterworth. >> >> I must ask: besides computation time, is there an advantage to using >> a single 4th-order or higher-order filter, rather than cascading >> some 2nd-order filters to acheive approximately the same result? >> >> -A > > > Cascading two second order Butterworths doesn't give you one fourth > order Butterworths, but _any_ 2N-order filter can be made by cascading N > 2nd-order filters. You just make one 2nd-order filter for each of the > complex pole pairs in the big filter, distribute your zeros > appropriately, and cascade away. >
To expand (the explanation): Say you have z^4 F(z) = ---------------------------------. z^4 + a3*z^3 + a2*z^2 + a1*z + a0 The denominator will, as guaranteed by the fundamental theorem of algebra, factor into a collection of 1st- or 2nd-order polynomials. Say that the thing has two complex pole pairs. Then you'll get: z^4 F(z) = --------------------------------------------------. (z^2-2*d1*cos(th1)z+d1^2)(z^2-2*d2*cos(th2)z+d1^2) This can be easily split into two filters: z^2 F1(z) = ----------------------- z^2-2*d1*cos(th1)z+d1^2 z^2 and F2(z) = -----------------------. z^2-2*d2*cos(th2)z+d2^2 So you design your 4th-order filter (or 6th, or 7th, or 23rd, whatever) filter and you realize it as a cascade, thereby avoiding all sorts of numerical difficulties. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Tim Wescott <tim@wescottnospamdesign.com> writes:
> > Cascading two second order Butterworths doesn't give you one fourth > order Butterworths, but _any_ 2N-order filter can be made by cascading > N 2nd-order filters. > > You just make one 2nd-order filter for each of the complex pole > pairs in the big filter, distribute your zeros appropriately, and > cascade away.
Your point, then, is that, e.g., a fourth-order Butterworth does not decompose into second-order Butterworths when factored. That is, the second-order sections that result from factoring a fourth-order Butterworth are not Butterworth. This may be true (my books are at work so I can't look up the defining characteristics of Butterworth filters), 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. -- % Randy Yates % "I met someone who looks alot like you, %% Fuquay-Varina, NC % she does the things you do, %%% 919-577-9882 % but she is an IBM." %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://home.earthlink.net/~yatescr
Randy Yates wrote:

> Jerry Avins <jya@ieee.org> writes: > > >>Randy Yates wrote: >> >> >>>Jerry Avins <jya@ieee.org> writes: >>> >>> >>>>You don't design a 4th-order filter by stacking two 2nd-order filters. >>> >>>Why not? If you consider the "order" the number of dB/octave the >>>composite >>>filter rolls off in the stopband divided by 12, then this is exactly what >>>a Bode plot will tell you. If the two 2nd-order filters have different >>>cutoff frequencies, then of course you'll have to measure the rolloff >>>past the highest one. Or have I completely forgotten Electronic >>>Systems 101? >> >>Maybe. For simplicity, cascade two low-pass sections, >>1/(1+st)^2 and examine the sharpness of the corner. Compare to >>1/(1+ast)*(1+st/a). The first example is the equivalent of a=1. The >>corner is as sharp as it can get without peaking when a=sqrt(2). > > > First of all, what is t? These are s-domain equations, right? What > is a "t" doing in them (if it is time)?
Read "tau", the time constant. RC, if you like, rarely L/R. The product st is dimensionless, as it must be. (Otherwise, what would exp(st) mean?
> Second, of course these two filters won't be the same. They're different > (if a != 1). If a = 1, then they should be identical. And if a != 1, > if you cascaded 1/(1 + ast) with 1/(1 + st/a) you should get identical > results and one filter with response 1/[(1 + ast)(1 + st/a)]. > > There are second-order systems that can't be factored into real, first-order > systems. Is that what you're getting at?
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; The buffer isn't always needed in practice. Interaction between the two sections will be small if R2 is many larger than R1. Analog circuits and s-tau may seem out of place in comp.dsp, but some Circuits 101 stuff is worth remembering. 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;
axlq wrote:

> In article <4qnlt0ax.fsf@ieee.org>, Randy Yates <yates@ieee.org> wrote: > >>Jerry Avins <jya@ieee.org> writes: >> >>>You don't design a 4th-order filter by stacking two 2nd-order filters. >> >>I should also add that I'm fairly certain I've seen Nth order digital >>filters split into N/2 biquad (2nd-order) sections (N = 2n). > > > Yes, here is was confused me: > > http://kwon3d.com/theory/filtering/fil.html > > Near the bottom there are some recursive formulas for generating > filter coefficients for a Butterworth filter of order 2N. > > Following those formulas there's this statement: "For example, > a 6th-order low-pass filter has 3 (6 divided by 2) elementary > 2nd-order filters. Passing the data through these 3 2nd-order > filters consecutively is the same to passing them through the > 6th-order filter once." > > So, I believed it until someone else demonstrated to me by sending > graphics in private email that cascading two 2nd-order Butterworths > isn't the same as a 4th-order Butterworth. > > I must ask: besides computation time, is there an advantage to using > a single 4th-order or higher-order filter, rather than cascading > some 2nd-order filters to acheive approximately the same result? > > -A
Believe it still. There are two second-order filters which, when cascaded, have a fourth-order Butterworth response. Those filters are not identical, nor do they have Butterworth responses. The sixth-order filter Kwon refers to consists of three different second-order sections. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; 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;
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. 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> 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. -- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124
"Randy Yates" <yates@ieee.org> wrote in message news:acxciftz.fsf@ieee.org...
> Tim Wescott <tim@wescottnospamdesign.com> writes: > > > > Cascading two second order Butterworths doesn't give you one fourth > > order Butterworths, but _any_ 2N-order filter can be made by cascading > > N 2nd-order filters. > > > > You just make one 2nd-order filter for each of the complex pole > > pairs in the big filter, distribute your zeros appropriately, and > > cascade away. > > Your point, then, is that, e.g., a fourth-order Butterworth does > not decompose into second-order Butterworths when factored. That > is, the second-order sections that result from factoring a > fourth-order Butterworth are not Butterworth.
This is true.
> This may be true (my books are at work so I can't look up the > defining characteristics of Butterworth filters),
I'm sure you will find this to be the case when you have access to the books. For starters, a Butterworth filter is 3dB down at its corner frequency. Two cascaded Butterworths are 6dB down at the same point from simple algebra. Another poster pointed out that this is a Linkwitzt-Riley filter, often used in audio crossovers.
> 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.