Forums

IIR filter reference designs

Started by Rune Allnor June 9, 2005
Clay wrote:
> Hello Rune, > > Using a normalized Butterworth filter (cutoff is at 1), the zeroes of > the transfer equation (LaPlace form) are on the unit circle. You can > grab pairs (taken symmetrically above and below the real axis) of the > zeros and form your transfer equation. The full set of zeroes are the > 2n roots of 1. For just your filter, pick the ones in the left hand > plane (causal).
... For a Chebychev filter, the zeros are on an ellipse, foreshortened as if the circle were rotated about the Y axis Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������

Clay wrote:
> Hello Rune, > > Using a normalized Butterworth filter (cutoff is at 1), the zeroes of > the transfer equation (LaPlace form) are on the unit circle. You can > grab pairs (taken symmetrically above and below the real axis) of the > zeros and form your transfer equation. The full set of zeroes are the > 2n roots of 1. For just your filter, pick the ones in the left hand > plane (causal).
That's what I have done for the Butterworth. It works, the numbers match with the worked-out examples I find in the books, the results from the bilinear transform make sense when I plot them and I even get reasonable answers when using the frequency transform to find highpass, bandpass and bandstop filters. [Details snipped...]
> For Chebyshev, the method is similar, except instead of a unit circle, > you now have ponts on an ellipse. The major and minor axes are given by > sinh() and cosh() functions of the passband wobble.
Yep, I know. The problem is that when I adapt my Butterworth procedure to the Chebyshev filter, the results no longer make sense. The one example I found (prior to digging up the van Valkenburg book) only computed the coefficients of the analog system function. No details were listed on coefficients in z domain. I got the s-domain numbers to match, but the bilinear transform did not produce numbers that made sense. Which means I either have messed the Cheb 1 procedure up seriously, or that there are two errors in my Butterworth + BLT code, one in each stage, that mutually cancel. A ridiculous thing to say, perhaps, but I would have been a lot happier if my Butterworth code didn't work so well...
> When I get back to my house, I can find my notes where I have this all > worked out. > > Are you interested in these details?
I am, but I prefer to work it out for myself. I suspect the error is due to some detail I haven't understood. I would be very interested, though, in seeing the s-domain coefficients of some Cheb 1 filter (cascade form of 1st and 2nd order units) along with the spec (w_p, w_s, d_1, d_2) and also the result of applying the BLT on those coefficients (just the BLT, no pre-warping or anything). With such reference numbers available, I would probably be able to track down what I am doing wrong. Rune

Rune Allnor wrote:

> I would be very interested, though, in seeing the s-domain > coefficients of some Cheb 1 filter (cascade form of 1st and > 2nd order units) along with the spec (w_p, w_s, d_1, d_2) > and also the result of applying the BLT on those coefficients > (just the BLT, no pre-warping or anything). > > With such reference numbers available, I would probably be able > to track down what I am doing wrong. > > Rune
Never mind. I don't know what I did wrong, but I wrote another Cheb 1 function based on the recipe in van Valkenburg's chapter 8. When I was able to correctly reproduce his table 8.1, "pole locations", everything else came nicely together. I suspect the problem was due to the infamous "matlab-starts-indexing-at-1-and- not-at-0-as-most-textbook-formulae-do" syndrome. However, I did find one very confusing formula, possibly a typo: van Valkenburg's equation 8.33 says acosh w = 1/N acosh(1/e) which I agree with. However, solving this for w yelds, according to van Valkenburg (his equation 8.34), w = cosh(1/N) acosh (1/e). [*] I interperet this as a cosh() term multiplied by an acosh() term. I don't agree with that, I think it should be w = cosh((1/N) acosh(1/e)) [**] (added another set of parentheses to denote that the product of the 1/N term and the acosh() term is taken as argument to the cosh() function). For the record, van Valkenburg uses the form [**] in his design recipe in table 8.2. Is it me who is overly pedantic or is it "obvious" from [*] that the function should be computed as in [**]? To me, it isn't. Rune
Rune Allnor wrote:

   ...

> Is it me who is overly pedantic or is it "obvious" from [*] that > the function should be computed as in [**]? To me, it isn't.
Error. Typesetter's or van Valkenburg's we'll never know, so we can't blame the proofreader. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Rune,

i haven't figgered out the gist of the thread.  do you want closed form
expressions for the poles/zeros or coefficients for Tchebyshev type 1 or 2
filters?  (mapping to z domian with BLT is not a big deal, unless there is
prewarping.)

-- 

r b-j                  rbj@audioimagination.com

"Imagination is more important than knowledge."



robert bristow-johnson wrote:
> Rune, > > i haven't figgered out the gist of the thread. do you want closed form > expressions for the poles/zeros or coefficients for Tchebyshev type 1 or 2 > filters? (mapping to z domian with BLT is not a big deal, unless there is > prewarping.)
I just wanted the coefficients that pop out from a given spec and algorithm, to check that the code I implement myself actually works. I believe my code for the Cheb 1 case works (I haven't tested it with pre-warping and frequency transforms) and I thought I would have a try at the Cheb 2 case today. Naively, I thought it would be a piece of cake to implement a recipe for Cheb 1 and Cheb 2 filters as found in e.g. Proakis & Manolakis, but I was wrong. While working on the Butterworth case, I found two typos in the expression for the lowpass -> bandstop transform. First, the sign of the substitute for z^{-1} is wrong, it should be the opposite of the sign in the lowpass -> bandpass case. Second, there is an internal variable on the form q = 2*alpha /(K-1) (sorry, I don't have my copy of P&M here, so the details in the formula above may be wrong, and I can't tell you the table number and page where the typos are) that has the wrong sign. The fact that these typos exist in the 3rd edition indicate to me that no one have used the P&M book as basis for an implementation of these transforms. And so there may be further undetected typos in the examples. My confidence in P&M have faded a bit over the last few days... With trusted reference data available I can track down my own typos, misunderstandings and blunders. The recipes and tables I found in van Valkenburgs book were invaluable. I had working code half an hour after I sat down with that book. The algorithm was explained very well in the text, succintly distilled in a design recipe, and the tables of pole locations in prototype filters were very useful during debugging. For comparision, I spent a whole day on the P&M Cheb 1 recipe and got only garbage. Rune
in article 1118556798.292050.210830@g47g2000cwa.googlegroups.com, Rune
Allnor at allnor@tele.ntnu.no wrote on 06/12/2005 02:13:

> I just wanted the coefficients that pop out from a given spec and > algorithm,
sounds like closed form.
> to check that the code I implement myself actually works. > I believe my code for the Cheb 1 case works (I haven't tested it > with pre-warping and frequency transforms) and I thought I would have > a try at the Cheb 2 case today.
i think i have closed form solutions to the s-plane poles as zeros of the Tchebyshev (type 1) and Inverse Chebyshev (type 2) low-pass filters. i used to have formulae for the complete digital design (z plane poles/zeros) but it's left at a previous employer. i might be able to rederive it. do you want me to post it? -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."

robert bristow-johnson wrote:
> in article 1118556798.292050.210830@g47g2000cwa.googlegroups.com, Rune > Allnor at allnor@tele.ntnu.no wrote on 06/12/2005 02:13: > > > I just wanted the coefficients that pop out from a given spec and > > algorithm, > > sounds like closed form. > > > to check that the code I implement myself actually works. > > I believe my code for the Cheb 1 case works (I haven't tested it > > with pre-warping and frequency transforms) and I thought I would have > > a try at the Cheb 2 case today. > > i think i have closed form solutions to the s-plane poles as zeros of the > Tchebyshev (type 1) and Inverse Chebyshev (type 2) low-pass filters. i used > to have formulae for the complete digital design (z plane poles/zeros) but > it's left at a previous employer. > > i might be able to rederive it. do you want me to post it?
No, I don't think so. The sentence "it's left with a previous emplyer" is a turn-off; I don't want to get you into trouble. Rune
in article 1118655971.796709.5760@g47g2000cwa.googlegroups.com, Rune Allnor
at allnor@tele.ntnu.no wrote on 06/13/2005 05:46:

> No, I don't think so. The sentence "it's left with a previous emplyer" > is a turn-off; I don't want to get you into trouble.
i understand. it's really just textbook sorta stuff (BLT, nothing more), but if you're having trouble with your textbook about it, then maybe it isn't. i have this 30 year old book, "Active Network Design" by Lindquist that has closed form s-plane formulae. nobody can get after me for that. do you want those or does your Van Valkenberg book have those? one thing to do, to compare both types of Tchebychev to each other and to Butterworth, is to fix the -3 dB corner frequency to the same place. there is a simple expression that relates the -3 dB frequency to the passband edge (Tcheb type 1) or stopband edge (type 2). by fudging those frequencies a little, you can make sure that you compare apples to apples. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Jerry Avins <jya@ieee.org> writes:

> Error. Typesetter's or van Valkenburg's we'll never know, so we can't blame the > proofreader.
"Mac" van Valkenburg has been dead for a few years now, so we may never know. I will check my copy at home for any penciled in marks from his class.