DSPRelated.com
Forums

IIR filter design libray

Started by CoCo January 19, 2005
hi...
>Just to make things clearer, what I'm looking for is a software >library that can be called from code of my own. Indeed, in my >application, filters need to be design dynamically to meet user >requirements.
--------- I am currently using Intell IPP library for making an IIR filter. Though I am currently facing some problems (u can see my thread "How to calculate Bandwidth or Q from slope" on this site itself). u can download the evaluation version for the same. I think it suits the major needs of all filter designers. But if u find the solution to my problem do provide the same to me. all the best. This message was sent using the Comp.DSP web interface on www.DSPRelated.com
"Rune Allnor" <allnor@tele.ntnu.no> wrote in message 
news:1109830502.664232.15840@g14g2000cwa.googlegroups.com...
> > > Along the same lines -- does anyone know where to find > algorithms for numerically transforming LP IIR prototypes > into highpass, bandpass and bandstop filters? > > I don't want packages that do the job for me, I want to > be able write my own package. > > Rune >
Hello Rune, The book "Digital Signal Processing: Theory, Design, and Implementation" by Peled and Liu has conversion formulae for converting lowpass recursive filters into the other types. Clay
Clay S. Turner wrote:
> "Rune Allnor" <allnor@tele.ntnu.no> wrote in message > news:1109830502.664232.15840@g14g2000cwa.googlegroups.com... > > > > > > Along the same lines -- does anyone know where to find > > algorithms for numerically transforming LP IIR prototypes > > into highpass, bandpass and bandstop filters? > > > > I don't want packages that do the job for me, I want to > > be able write my own package. > > > > Rune > > > > Hello Rune, > > The book "Digital Signal Processing: Theory, Design, and
Implementation" by
> Peled and Liu has conversion formulae for converting lowpass
recursive
> filters into the other types.
Thanks, Clay. I don't have the book you suggest readily available, so this one may be different from the rest. Generally speaking, lots of DSP books list the conversion formulae between LP prototypes and other filter types. I just haven't seen a description of how to do that *numerically*. Assuming one wants to design a band pass Cheb I filter, I'd start with the analog LP prototype and convert it to discrete time domain by the bilinear transform. But that's not enough. Somewhere, the LP filter must be transformed to a BP filter. Where? Analytically in s domain before the bilinear transform? Analytically in z domain after the bilinear transform? Numerically? If so, where and how? I'll appreciate any enlightenment on such issues. Rune
Hello Rune,

Here are some formulae gleened from the book that will let you convert
lowpass filters into other types given a lowpass prototype.

I hope this helps.

Clay







Given an S equation for a lowpass filter whose cutoff frequency is
normalized to 1 radian/second, the following
transformations will yield various digital filter types.


Note: All digital frequecies given below are relative to the sampling
rate.
      I.e., if f==0.25, then this is 1/4 of the sampling rate.



Formulae taken from sections 2.2 - 2.4 of "Digital Signal
Processing:Theory, Design, and Implementation"
                    by Abraham Peled and Bede Liu, 1976, John Wiley &
Sons, ISBN 0-471-01941-0



Lowpass:
--------

f is the cutoff

c = cot(pi*f)

s = c*(z-1)/(z+1)


Highpass:
---------

f is the cutoff


c = tan(pi*f)

s = c*(z+1)/(z-1)


Bandpass:
---------

f1 is lower pass band frequency

f2 is upper pass band frequency



a = cot(pi*(f2-f1))


          sin(2pi*(f1+f2))
b = -------------------------------
      sin(2pi*f1)+sin(2pi*f2)



          z^2 -2bz + 1
s = a* ------------------
             z^2 - 1



Bandstop:
---------

f1 is lower stop band frequency

f2 is upper stop band frequency

      cos(2pi*f1)-cos(2pi*f2)
a = --------------------------------
      sin(2pi*f1)+sin(2pi*f2)


          sin(2pi*(f1+f2))
b = ------------------------------
      sin(2pi*f1)+sin(2pi*f2)


        a*(z^2 -1)
s = ------------------
      z^2 - 2bz +1

Clay wrote:
> Hello Rune, > > Here are some formulae gleened from the book that will let you
convert
> lowpass filters into other types given a lowpass prototype. > > I hope this helps. > > Clay >
Hello Rune, Did the formulae give you what you needed, or did you need something else? Hopefully you saw where the substitution for "s" in the band pass and band stop filters resulted in a doubling of the filter order. Clay
Clay wrote:
> Clay wrote: > > Hello Rune, > > > > Here are some formulae gleened from the book that will let you > convert > > lowpass filters into other types given a lowpass prototype. > > > > I hope this helps. > > > > Clay > > > > Hello Rune, > > Did the formulae give you what you needed, or did you need something > else? Hopefully you saw where the substitution for "s" in the band
pass
> and band stop filters resulted in a doubling of the filter order. > > Clay
Hi Clay, Sorry for the delayed answer. The formulae you cite appear to be what I find everywhere else. The "obvious" way of implementing these types of things in a computer program would be to get to a z domain LP prototype and then calculate analytical expressions for the various LP->BP etc. transforms in z domain. For some reason I can't really believe that's how things are done "in the real world". I might be wrong, though. Rune
"Rune Allnor" <allnor@tele.ntnu.no> wrote in message 
news:1110370463.479520.182950@l41g2000cwc.googlegroups.com...
> > > Hi Clay, > > Sorry for the delayed answer. The formulae you cite appear to be > what I find everywhere else. The "obvious" way of implementing > these types of things in a computer program would be to > get to a z domain LP prototype and then calculate analytical > expressions for the various LP->BP etc. transforms in z domain. > > For some reason I can't really believe that's how things are > done "in the real world". I might be wrong, though. > > Rune >
Hello Rune, No problem with the delay. Most of us are pretty busy these days. I'll be doing field measurements all day tomorrow. As you have gathered, one way to make your filters is to do an analytic substitution in a proto type lowpass filter. Then using the cutoff frequency or frequencies adjust the coefs. Yes it is kind of painful. However not a problem in a program like MathCad. Another way is to have prototypes for lowpass, highpass, bandpass, and bandstop filters all in s equation form. And simply use a BLT to convert them. There are tables of the s equations, factored into biquads that may be used as a source. Also you obtain a copy of Don Lancaster's "Active Filter Cookbook", which contains many wonderful methods for designing s equations for filters, and then just use a BLT. For bandpass and bandstop filters, he uses a simple model for selecting the relative Qs of each of the cascaded biquads. The book has nomographs for picking Qs and relative frequencies. These can be easily programmed. There is also a pole zero placement method for designing filters, and there is even a program for designing optimal IIR filters. A paper by Steiglitz[1] gives details and there is some Fortran code implementing his method floating about. This program is listed in the Peled - Liu book. So the real world method is a mix of these various methods. Later, Clay [1] K. Steiglitz, Computer Aided Design of Recursive Digital Filters, IEEE Trans. Audio Electroacoust., vol. AU-18 June 1970, pp. 123-129. p.s. I know you like going and taking pictures of some of the local fauna on your northern travels. There is a fellow countryman of yours who does a lot with nature photography. A link to his site is: http://www.naturfotograf.com/index2.html
Clay S. Turner wrote:
> "Rune Allnor" <allnor@tele.ntnu.no> wrote in message > news:1110370463.479520.182950@l41g2000cwc.googlegroups.com... > > > > > > Hi Clay, > > > > Sorry for the delayed answer. The formulae you cite appear to be > > what I find everywhere else. The "obvious" way of implementing > > these types of things in a computer program would be to > > get to a z domain LP prototype and then calculate analytical > > expressions for the various LP->BP etc. transforms in z domain. > > > > For some reason I can't really believe that's how things are > > done "in the real world". I might be wrong, though. > > > > Rune > > > > Hello Rune, > > No problem with the delay. Most of us are pretty busy these days.
I'll be
> doing field measurements all day tomorrow.
Practical measurements are fun. Especially when they work out the way one wants... a couple of weeks ago I went to the lab and helped some guys to design an acoustic measurement system. We did anticipate some problems that indeed made their presence noted during initial tests. The fun part was when we tried some very simple but perhaps slightly unconventional means to remove those problems. It worked wonders. I'll float on those three days in the lab for months to come...
> As you have gathered, one way to make your filters is to do an
analytic
> substitution in a proto type lowpass filter. Then using the cutoff
frequency
> or frequencies adjust the coefs. Yes it is kind of painful. However
not a
> problem in a program like MathCad.
I was more thinking about numerical packages. IIR filter designs else than LP is just about the only thing in mtalab's Signal Processing Toolbox I am not capable of implementing myself. I have discovered the hard way that I need matlab to get any work done, but the SP toolbox is more a matter of being able to run other people's programs. While I have to spend some hard-earned cash on a matlab basic lisence, I would really like to avoid spending half as much again on the SP toolbox. There are some marked strategists over at The MathWorks who really have earned their salaries!
> Another way is to have prototypes for lowpass, highpass, bandpass,
and
> bandstop filters all in s equation form. And simply use a BLT to
convert
> them. There are tables of the s equations, factored into biquads that
may be
> used as a source. Also you obtain a copy of Don Lancaster's "Active
Filter
> Cookbook", which contains many wonderful methods for designing s
equations
> for filters, and then just use a BLT. For bandpass and bandstop
filters, he
> uses a simple model for selecting the relative Qs of each of the
cascaded
> biquads. The book has nomographs for picking Qs and relative
frequencies.
> These can be easily programmed. > > There is also a pole zero placement method for designing filters, and
there
> is even a program for designing optimal IIR filters. A paper by
Steiglitz[1]
> gives details and there is some Fortran code implementing his method > floating about. This program is listed in the Peled - Liu book. > > So the real world method is a mix of these various methods.
Thanks for the outline. I'll look in to it and see what I can do.
> Later, > > Clay > > [1] K. Steiglitz, Computer Aided Design of Recursive Digital Filters,
IEEE
> Trans. Audio Electroacoust., vol. AU-18 June 1970, pp. 123-129. > > > p.s. I know you like going and taking pictures of some of the local
fauna on
> your northern travels. There is a fellow countryman of yours who does
a lot
> with nature photography. A link to his site is: > http://www.naturfotograf.com/index2.html
Brilliant! These guys are *slightly* above my level as photographers, like 20 orders of magnitude... It is getting half exiting these days, what wildlife is concerned. When I was a kid, the first sign of the spring coming was to see the sun for the first time after the dark season, which happened around January 30th -- February 1st where I used to live. Here in the south (about 65 degree N) we see the sun all year round, so these days the first sign of spring is the arrival of the oystercatchers. The earliest date I have ever seen them, was March 13th two years ago. There is a rumor going that they one year were spotted as early as March 4th, so I tend to get by the beach every now and then to see if I can catch a glimpse of them. Thanks for the link! Rune
Rune Allnor wrote:
> Clay S. Turner wrote:
...
>>p.s. I know you like going and taking pictures of some of the local fauna on >>your northern travels. There is a fellow countryman of yours who does a lot >>with nature photography. A link to his site is: >>http://www.naturfotograf.com/index2.html > > > Brilliant! These guys are *slightly* above my level as photographers, > like 20 orders of magnitude... > > It is getting half exiting these days, what wildlife is concerned. > When I was a kid, the first sign of the spring coming was to see the > sun for the first time after the dark season, which happened around > January 30th -- February 1st where I used to live. Here in the south > (about 65 degree N) we see the sun all year round, so these days the > first sign of spring is the arrival of the oystercatchers. The earliest > date I have ever seen them, was March 13th two years ago. There is > a rumor going that they one year were spotted as early as March 4th, > so I tend to get by the beach every now and then to see if I can catch > a glimpse of them. > > Thanks for the link! > > Rune
Rune, you inspired me to use my pocket digital camera (Fuji Finepix A205) through a spotting scope. (I bought a scope for that and another purpose through eBay, then added a 2" eyepiece holder, total cost less than $100.) A home-brew fitting holds the camera by its lens barrel. It's usable, but not yet complete. http://users.erols.com/jyavins/woodpecker1.jpg is a downy woodpecker at my feeder taken from 30 feet away. I used a tripod (also home brew). The camera holder attaches to a 28mm eyepiece (adapted to 1.25" from a WWII artillery director) that also fits my 5" SCT, but I haven't tried that combination yet. 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 wrote:
> Rune, you inspired me to use my pocket digital camera (Fuji Finepix > A205) through a spotting scope. (I bought a scope for that and
another
> purpose through eBay, then added a 2" eyepiece holder, total cost
less
> than $100.) A home-brew fitting holds the camera by its lens barrel. > It's usable, but not yet complete. > > http://users.erols.com/jyavins/woodpecker1.jpg is a downy woodpecker
at
> my feeder taken from 30 feet away. I used a tripod (also home brew).
The
> camera holder attaches to a 28mm eyepiece (adapted to 1.25" from a
WWII
> artillery director) that also fits my 5" SCT, but I haven't tried
that
> combination yet.
That's a nice bird. And the technical quality of the image is way beyond anything I have achieved so far. Rune