DSPRelated.com
Forums

1st Order IIR to 2nd Order IIR

Started by davidross March 22, 2006
"Rune Allnor" <allnor@tele.ntnu.no> wrote in
news:1143618776.758556.80540@z34g2000cwc.googlegroups.com: 

> > davidross wrote: > ... >> I found even designing a second order butterworth filter from scratch >> quite tricky, but maybe I'm looking at the wrong references. Probably >> I shoudl start digging amongst the journals now.
I'm the last guy to say that you shouldn't read books or journals. I have 40-50 DSP books. However.... Most DSP guys use computer programs to generate coefficents and analyze filter responses. It's been a very long time since I calculated a filter by hand. One of the features that many filter programs can do is set the precision of the coefficents and whether they are in floating or fixed point. This can be very useful when you are trying to look at performance of real filters with finite precision. Poles that might be close to the unit circle with perfect math, might even be outside the unit with finite precision math. I'm sure everyone has their favorite filter program. I like QEDesign 1000 (www.mds.com). I have used versions of QED since its original fortran implementation. One of the hidden benefits of QED design is that the programmer is an excellent DSP guy (Jerry Purcell). Jerry understands a lot of the subtleties to good filter design. I think they have a free demo program. Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
> > No, don't. > > Filter design by analog prototypes is a "classical" design technique > by now. > The heyday was during the 60s, when lots of people knew how to design > analog IIR filters, but before discrete-time techniques had been > developed > (it seems Ken Steiglitz was the central person around 1970). The > relevant > journal literature dates from the mid-late 60s, and is all but > incomprehensable > for the casual reader. > > Nowadays these techniques are so "well known" that only rudimentary > accounts are included in textbooks on DSP. A few months ago, a book > appeared > > http://www.amazon.com/gp/product/0071454241/qid=1143618441/sr=1-1/ref=s > r_1_1/103-2220054-5955052?s=books&v=glance&n=283155 > > that apparently is an extension of a "classical" filter design. This > book is > the only book I know of, that reviews IIR filter design in a decent > way. > If you are interested in these kinds of things, get a copy. This type > of > material is not likely to be available in one book until this book is > in its > next edition, or in a Dover reprint. > >> My original thinking about my post was - if i have a nice easy 1st >> order filter design algorithm - use it, square it, and then cascade >> it if need be, instead of delving into advanced elliptic design. >> Maybe its time too though. > > I suppose you can do things that way. The price to pay is that it > takes > > a lot of fiddling around to get to a desired response, and the filter > order > becomes unnecessary high. > > It is very cumbersome to derive the design formulas for eliptic > filters, > but those filters are close to optimum what filter order is concerned. > The elliptic filter gets the job done with a minimum of FLOPs. > > So it's a trade-off between who is to get the hard job: You, deriving > the > filter, or the computer crunching the numbers. > > Rune >
--
Al Clark wrote:
> "Rune Allnor" <allnor@tele.ntnu.no> wrote in > news:1143618776.758556.80540@z34g2000cwc.googlegroups.com: > > > > > davidross wrote: > > ... > >> I found even designing a second order butterworth filter from scratch > >> quite tricky, but maybe I'm looking at the wrong references. Probably > >> I shoudl start digging amongst the journals now. > > I'm the last guy to say that you shouldn't read books or journals. I have > 40-50 DSP books.
Don't misunderstand me wrong... My response was based on my impression that the OP has a casual interest in DSP. Reading books and journals is necessary if you take classes or need in for your job, it may be a bit overwhelming if you start too early. As for IIR filter design, the Antoniou book seems to be the only reasonably recent book that actually deals with this in a systematical way.
> However.... > > Most DSP guys use computer programs to generate coefficents and analyze > filter responses. It's been a very long time since I calculated a filter > by hand.
Sure. A few months a go I implemented my own rudimentary filter design program. While it is by no means as elaborate as some of the professional tools, it lets me do stuff I can't do with Matlab's Signal Processing Toolbox. As wellas let me explore some techniques of computer programming I hadn't really tested before. I used the IIR filter design as a case study. While the main benefit was that I learned how to "really" do object oriented programming in C++, I also discovered a few bells and whistles to fine-tune the filter responses. Assuming "perfect" maths, but still. Rune
"Rune Allnor" <allnor@tele.ntnu.no> wrote in
news:1143795767.709380.327030@t31g2000cwb.googlegroups.com: 

> > Al Clark wrote: >> "Rune Allnor" <allnor@tele.ntnu.no> wrote in >> news:1143618776.758556.80540@z34g2000cwc.googlegroups.com: >> >> > >> > davidross wrote: >> > ... >> >> I found even designing a second order butterworth filter from >> >> scratch quite tricky, but maybe I'm looking at the wrong >> >> references. Probably I shoudl start digging amongst the journals >> >> now. >> >> I'm the last guy to say that you shouldn't read books or journals. I >> have 40-50 DSP books. > > Don't misunderstand me wrong... > > My response was based on my impression that the OP has a casual > interest in DSP. Reading books and journals is necessary if you take > classes or need in for your job, it may be a bit overwhelming if you > start > too early. As for IIR filter design, the Antoniou book seems to be the > only reasonably recent book that actually deals with this in a > systematical way. > >> However.... >> >> Most DSP guys use computer programs to generate coefficents and >> analyze filter responses. It's been a very long time since I >> calculated a filter by hand. > > Sure. A few months a go I implemented my own rudimentary filter design > program. While it is by no means as elaborate as some of the > professional > tools, it lets me do stuff I can't do with Matlab's Signal Processing > Toolbox. > As wellas let me explore some techniques of computer programming > I hadn't really tested before. > > I used the IIR filter design as a case study. While the main benefit > was > that I learned how to "really" do object oriented programming in C++, > I also discovered a few bells and whistles to fine-tune the filter > responses. > Assuming "perfect" maths, but still. > > Rune > >
There is really nothing better than a real project to learn something new. I got the same impression that OP has a casual interest. I think he really wants/needs a basic book. I have an old addition of Antoniou. It also has some of the IIR details you mention although maybe not the same as the later addition. I think what OP really wants/needs is a recipe. 1. Buy this or that filter program. 2. Implement the filter structure appropriate for his situation and target. 3. Move on to the next thing. -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
Hi,

Thanks for the tips about the books. It looks like what I need as I'm
wanting to delve deeper into filter design and as I think you picked up
I'm currently not doing this as a job, and perhaps never will, but I 'do'
enjoy coding filters and do it really as a hobby just now. I really use it
to design real-time audio effects and like to use Matlab to design the
algorithms and plot the responses etc...

I'm aware I can use packages to design the coefficients directly, such as
Matlab. However, i need to have a filter which I can tweak the parameters
\ specifications in real-time. So for this reason alone I need to 'design
the whole filter from scratch'. Its definetly a good thing to learn about
books such as the one you mentioned! I have a text which i view as being
good by Sophociles Orfanidis but it doesnt concnetrate on just filter
design... so maybe I need a book which concentrates on just filter design
like the one mentioned. Hopefully my library will have a copy, luckily
they tend to be pretty good with there DSP books.

Its funny you mention designing your own filter design package. I recently
also made a Filter Design Web Service Application using C#. Probably not
all that useful but it was fun to make. Currently it supports 1st Order
IIR High and Low Pass, and 2nd Order IIR Peaking and Notch filters. Quite
rudimentary but its a start. Most of these filters I ported over from
Matlab, then to C++ where I use them for audio effects. I like the object
oriented approach where I can have a dedicated 'filter class'. Makes using
the filter a lot easier. However, I need to concentrate more now on the
actual filter design still so I can make the end filters better. Time to
get that book now!

Best Regards,
David
Al Clark wrote:
> I have an old addition of Antoniou. It > also has some of the IIR details you mention although maybe not the same > as the later addition.
I haven't seen the older versions, but the new one is the only DSP book I have seen (I have browsed DSP books regularly since around 1990) where the IIR design techniques are treated systematically. I don't know if those techniques are so "common" that everybody who was trained before 1990 take them for granted, but I searched for a long time to find all those details. The best I could come up with was the Van Valkenburg book from 1982 on analog filter design. It is so much easier to do these kinds of things when all the necessary material can be found in one place. Rune