DSPRelated.com
Forums

IIR design methods

Started by Rune Allnor September 17, 2004
Hi all. 

I have come across this arcane problem where I need to filter some 
data, and where tests in matlab indicate that it is curcial to use
a filter with no ripple in the pass band. I know of two types of 
digital filters that can be constructed with no ripple in the pass 
band, the Butterworth and Chebychev II.

Now, using analog templates for designing discrete time low pass
filters, is described in Proakis & Manolakis (3rd ed., 1996) section 8.3.
The theory behind converting a LP prototype to a highpass or bandpass 
filter is described in section 8.4.

My question is, how is such a conversion implemented in software? I have 
seen somewhere (don't remember exactly where, it could have been 
L.B. Jackson "Digital filters and signal processing", 1989) that the 
bilinear transform is implemented by finding poles and zeros in s domain 
and transforming each one to z domain individually. 

How is the frequency transform (LP -> HP, BP) in z domain implemented?

Rune
Rune Allnor wrote:
> > Hi all. > > I have come across this arcane problem where I need to filter some > data, and where tests in matlab indicate that it is curcial to use > a filter with no ripple in the pass band. I know of two types of > digital filters that can be constructed with no ripple in the pass > band, the Butterworth and Chebychev II. > > Now, using analog templates for designing discrete time low pass > filters, is described in Proakis & Manolakis (3rd ed., 1996) section 8.3. > The theory behind converting a LP prototype to a highpass or bandpass > filter is described in section 8.4.
I haven't looked, but I suspect that those conversions are from LP analogue prototype to LP, HP and BP analogue filters.
> My question is, how is such a conversion implemented in software?
There is source code somewhere on the web (www.cam.ac.uk?) called mkfilter or something similar.
> I have > seen somewhere (don't remember exactly where, it could have been > L.B. Jackson "Digital filters and signal processing", 1989) that the > bilinear transform is implemented by finding poles and zeros in s domain > and transforming each one to z domain individually. > > How is the frequency transform (LP -> HP, BP) in z domain implemented?
Normally you would avoid doing LP -> HP/BP in the z domain. Instead, you define separate operations for: - s plane LP prototype -> HP z domain filter - s plane LP prototype -> BP z domain filter and so on. The reason for this is that the prewarping needed for the bilinear transform is different depending on whether the desitination is LP, or HP. For BP, one usually applies the HP prewarping to the HP poles/zeros and LP prewarping to the LP poles/zeros. HTH, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man." -- George Bernard Shaw (1856-1950)
Rune Allnor wrote:

> Hi all. > > ... tests in matlab indicate that it is crucial to use > a filter with no ripple in the pass band. ...
Every request for absolute accuracy -- zero tolerance -- makes my nose itch. Would .01 dB of passband ripple bother you? .001? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
"Jerry Avins" <jya@ieee.org> wrote in message
news:414af1d6$0$2677$61fed72c@news.rcn.com...
> Rune Allnor wrote: > > > Hi all. > > > > ... tests in matlab indicate that it is crucial to use > > a filter with no ripple in the pass band. ... > > Every request for absolute accuracy -- zero tolerance -- makes my nose > itch. Would .01 dB of passband ripple bother you? .001?
Jerry, An excerpted and slightly out-of-context quote from an honored colleague (Lyons): "Bessel and Butterworth derived filters have no ripple in their passband responses" I believe that a filter with ripple in the passband typically refers to one that has zero derivatives at distinct points in the magnitude response - not just at f=0 for a lowpass, band center for a bandpass or at fs/2 for a highpass. Otherwise, there's "no ripple" while there *is* a variation in gain or attenuation. Maybe "monotonic" is a good term for response with "no ripple". Maximally flat filters are a good example. Fred
Fred Marshall wrote:

> "Jerry Avins" <jya@ieee.org> wrote in message > news:414af1d6$0$2677$61fed72c@news.rcn.com... > >>Rune Allnor wrote: >> >> >>>Hi all. >>> >>>... tests in matlab indicate that it is crucial to use >>>a filter with no ripple in the pass band. ... >> >>Every request for absolute accuracy -- zero tolerance -- makes my nose >>itch. Would .01 dB of passband ripple bother you? .001? > > > Jerry, > > An excerpted and slightly out-of-context quote from an honored colleague > (Lyons): > > "Bessel and Butterworth derived filters have no ripple in their passband > responses" > > I believe that a filter with ripple in the passband typically refers to one > that has zero derivatives at distinct points in the magnitude response - not > just at f=0 for a lowpass, band center for a bandpass or at fs/2 for a > highpass. Otherwise, there's "no ripple" while there *is* a variation in > gain or attenuation. Maybe "monotonic" is a good term for response with "no > ripple". Maximally flat filters are a good example. > > Fred
Fred, Yes to all. My point is that "none at all" is usually a bad spec. I probably related before about the fellow who wanted a hole dead center in a "disc" of aluminum[1]; no room for any error at all. I regretted that I could measure a centration error of a tenth of a mil[2] , but couldn't promise a better result than a half mil[3]. He needed to be able to put those numbers in perspective, so I pointed out that a piece of newsprint is 3 mils[4] thick. He considered 3 mils no error at all. A low-pass Butterworth filter has as many derivatives set to zero at f=0 as the available degrees of freedom allow. As designed, it can have no ripple. As built, it inevitably does. Neither analog components nor digital coefficients are precise enough to embody the design exactly. Whatever the object of a spec, I like to be told how much is too much. Jerry ______________________________________________ 1. Many aluminum alloys warp vigorously after being machined. For accurate objects, one machines almost down to size, waits -- temperature cycling shortens the wait -- cuts some more, and typically again. After the third removal of about .01 inch, it's pretty stable. His piece had been cut to size in one pass and never examined again before it came to me. A straight edge showed that it was no longer flat. Vernier calipers showed that it was no longer round. It had no exact center. 2. .0001 inch 3. .0005 inch 4. .003 inch -- 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;
"Rune Allnor" <allnor@tele.ntnu.no> wrote in message
news:f56893ae.0409162218.1781ec4d@posting.google.com...
> Hi all. > > How is the frequency transform (LP -> HP, BP) in z domain implemented?
A few simple examples: ftp://ftp.deltacompsys.com/public/mcd/Butterworth.htm Peter Nachtwey
Jerry Avins <jya@ieee.org> wrote in message news:<414b22f7$0$2659$61fed72c@news.rcn.com>...
> Fred Marshall wrote: > > > "Jerry Avins" <jya@ieee.org> wrote in message > > news:414af1d6$0$2677$61fed72c@news.rcn.com... > > > >>Rune Allnor wrote: > >> > >> > >>>Hi all. > >>> > >>>... tests in matlab indicate that it is crucial to use > >>>a filter with no ripple in the pass band. ... > >> > >>Every request for absolute accuracy -- zero tolerance -- makes my nose > >>itch. Would .01 dB of passband ripple bother you? .001? > > > > > > Jerry, > > > > An excerpted and slightly out-of-context quote from an honored colleague > > (Lyons): > > > > "Bessel and Butterworth derived filters have no ripple in their passband > > responses"
That's the way I've seen the term "ripple" used. I am pretty sure this is how the term is used in most textbooks.
> > I believe that a filter with ripple in the passband typically refers to one > > that has zero derivatives at distinct points in the magnitude response - not > > just at f=0 for a lowpass, band center for a bandpass or at fs/2 for a > > highpass.
That's my understanding too. To me, "ripple" is the "waves" in gain one sees in the passband of the Chebychev I filter. "No ripple" is almost synonymous to "maximally flat". "No ripple" applies to the pass-band, while (I think) "maximally flat" applies to the whole frequency band.
> > Otherwise, there's "no ripple" while there *is* a variation in > > gain or attenuation. Maybe "monotonic" is a good term for response with "no > > ripple". Maximally flat filters are a good example. > > > > Fred > > Fred, > > Yes to all. My point is that "none at all" is usually a bad spec.
Agreed. But I did not ask for "constant gain". I asked for "no ripple" which is a weaker constraint.
> I > probably related before about the fellow who wanted a hole dead center > in a "disc" of aluminum[1]; no room for any error at all. I regretted > that I could measure a centration error of a tenth of a mil[2] , but > couldn't promise a better result than a half mil[3]. He needed to be > able to put those numbers in perspective, so I pointed out that a piece > of newsprint is 3 mils[4] thick. He considered 3 mils no error at all. > > A low-pass Butterworth filter has as many derivatives set to zero at f=0 > as the available degrees of freedom allow. As designed, it can have no > ripple. As built, it inevitably does. Neither analog components nor > digital coefficients are precise enough to embody the design exactly.
Apart from the hair-splitting of terminology ("no ripple" vs "constant gain"), I agree. We did try the low-pass butterworth as it pops out of some matlab function, and it worked. The artifact we saw in the data, that we suspected was due to the pass-band ripple in the first filter we tried, disappeared.
> Whatever the object of a spec, I like to be told how much is too much.
Again, I agree. Rune
> Jerry > ______________________________________________ > 1. Many aluminum alloys warp vigorously after being machined. For > accurate objects, one machines almost down to size, waits -- temperature > cycling shortens the wait -- cuts some more, and typically again. After > the third removal of about .01 inch, it's pretty stable. His piece had > been cut to size in one pass and never examined again before it came to > me. A straight edge showed that it was no longer flat. Vernier calipers > showed that it was no longer round. It had no exact center. > > 2. .0001 inch > > 3. .0005 inch > > 4. .003 inch
hi rune,

http://www.winfilter.20m.com is a digital filter design freeware.
Maybe, it could help you.

Adrian

Rune Allnor wrote:
> Hi all. > > I have come across this arcane problem where I need to filter some > data, and where tests in matlab indicate that it is curcial to use > a filter with no ripple in the pass band. I know of two types of > digital filters that can be constructed with no ripple in the pass > band, the Butterworth and Chebychev II. > > Now, using analog templates for designing discrete time low pass > filters, is described in Proakis & Manolakis (3rd ed., 1996) section 8.3. > The theory behind converting a LP prototype to a highpass or bandpass > filter is described in section 8.4. > > My question is, how is such a conversion implemented in software? I have > seen somewhere (don't remember exactly where, it could have been > L.B. Jackson "Digital filters and signal processing", 1989) that the > bilinear transform is implemented by finding poles and zeros in s domain > and transforming each one to z domain individually. > > How is the frequency transform (LP -> HP, BP) in z domain implemented? > > Rune
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Adrian <adrian@nospam.com> wrote in message news:<41511998$1_7@corp.newsgroups.com>...
> hi rune, > > http://www.winfilter.20m.com is a digital filter design freeware. > Maybe, it could help you. > > Adrian
Thanks for the link, Adrian. It's an interesting link. You wouldn't by any chance be the same Adrian who signed the page? Anyway, the person who signed the page says he created the page because he "wanted to increase [his] digital signal processing knowledge." Which is exactly why I have been askind these questions about filters recently. On a couple of occations I have seen that my craftmanship, when filters were involved, was not quite up to the standards I would like it to be. Which is why I'd like an efficient tool that does not require matrlab at the base. And I just got hold of Qt, this Windows/Linux/Mac GUI programming library (everything necessary to learn the software comes on a CD with the book "C++ GUI Programming with Qt 3" found here, http://www.trolltech.com/developer/books.html) so I wanted to learn how to use that library and also make something that could be useful to me, later on. Rune
> Rune Allnor wrote: > > Hi all. > > > > I have come across this arcane problem where I need to filter some > > data, and where tests in matlab indicate that it is curcial to use > > a filter with no ripple in the pass band. I know of two types of > > digital filters that can be constructed with no ripple in the pass > > band, the Butterworth and Chebychev II. > > > > Now, using analog templates for designing discrete time low pass > > filters, is described in Proakis & Manolakis (3rd ed., 1996) section 8.3. > > The theory behind converting a LP prototype to a highpass or bandpass > > filter is described in section 8.4. > > > > My question is, how is such a conversion implemented in software? I have > > seen somewhere (don't remember exactly where, it could have been > > L.B. Jackson "Digital filters and signal processing", 1989) that the > > bilinear transform is implemented by finding poles and zeros in s domain > > and transforming each one to z domain individually. > > > > How is the frequency transform (LP -> HP, BP) in z domain implemented? > > > > Rune > > > > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- > http://www.newsfeeds.com - The #1 Newsgroup Service in the World! > -----== Over 100,000 Newsgroups - 19 Different Servers! =-----