DSPRelated.com
Forums

how to get rid of ringing with IIR notch filters?

Started by Unknown December 22, 2003
"Matt Timmermans" <mt0000@sympatico.nospam-remove.ca> wrote:

>Hi Robert,
Hi again Matt,
> >I would really like to know a rigorous way to design FIR filters according >to ringing constraints, in addition to other criteria.... but I don't.
Assume you meant IIR.
> >The length of the impulse response, i.e., the amount of ringing, is the >bandwidth of the frequency response. Use a higher order filter as Clay
Not quite sure what you mean here.
>suggests, and use those extra poles and zeros to smooth the frequency >response as much as possible. And as Fred says, let your transition regions
My initial attempt at a higher order filter didn't help much. But I'll re-visit that, and see some sort of different pole/zero placement can help.
>be as wide as possible.
Somehow before asking this question on comp.dsp, I had gotten the impression that a steeper transition would provide less ringing. But could have just been a wrong impression.
> >By the DSP uncertainty principle, it's clear that a very narrow notch has to >have a very ringy impulse response. It would seem that the frequency
Not sure what you're saying here either. Sorry. I understand your basic point ( narrow notch = lots of ringing ), but not sure how you came to it.
>response you want to approximate to get the most compact impulse response is >1-some_gaussian, like the picture on your web site. You might try using
The filter on my website was FIR, via Remez.
>yulewalk to approximate this sort of response directly, or maybe just use a >Bessel bandstop.
I'll look into yulewalk But, as originally mentioned, Bessel did not help on the ringing. Thanks! Robert www.gldsp.com ( modify address for return email ) www.numbersusa.com www.americanpatrol.com
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote:

> > >Well, I don't agree with this exactly. Although there can be cases like >this. >The ringing has to do with the transition widths more than anything. >Increasing the order of the filter can make that worse unless there is some >deliberate shaping going on. > >Take a lowpass filter as an example. The sharper the cutoff, the higher the >ringing amplitude - the more the ringing approximates what would result from >an ideal lowpass = the integral of a sinc. >Ringing amplitude and ringing duration are two different things of course.
I had noticed a somewhat inverse relationship, i.e. a filter intentionally designed with low ringing amplitude has longer ringing duration, and vice versa. Regards, Robert www.gldsp.com ( modify address for return email ) www.numbersusa.com www.americanpatrol.com
robert bristow-johnson <rbj@surfglobal.net> wrote:

>In article 407duvga6086tosc3tbf17nnpegf3ibqru@4ax.com, >r_obert@REMOVE_THIS.hotmail.com at r_obert@REMOVE_THIS.hotmail.com wrote on >12/22/2003 02:28: > >> I have an IIR notch filter ( i.e. bandstop ), that rings like crazy >> whenever a transient signal comes through ... which is very unwanted >> for my application. Anybody have any ideas how to get around this? I >> have to stick with IIR form filters. I've tried all the various >> standard design flavors, i.e. Butterworth, Bessel, Elliptic, etc ... >> but they all seem to ring unacceptably about the same. > >hmmm. this must be more than a 2nd order IIR notch, because there wouldn't >be any differentiation between Butterworth, Bessel, etc. do you need a
Yah, 2 order biquads ... but I've typically been using 3 in series, i.e. 6th order overall.
>broad stopband? because if you don't, i think a 2nd order would do fine for >just eliminating a single frequency.
I cannot have the transition regions too long, else they cut into desired frequency content. But I will look into cutting back on the order, to see if it helps.
> >anyway, since you can model any notch as a straight wire and a BPF >subtracted from it, if the notch is narrow (usually the desired property), >then the BPF passband is narrow also, and then, because of the preservation >of the time-bandwidth product, there is nothing that i can imagine that you
Robert, can you give a little more explanation/spell out the time-bandwidth thing? I'm sure I've studied/worked with it a bit, but it escapes me now ( and it seems like a piece of fundamental info that should be known ).
>can do to reduce the ringing except for widening the notch.
Ok. Guess that might be the bottom line. If so, I'll have to think of more creative ways to get around this problem, either by using a different type of filter structure, or some other modification of my processing scheme.
> >rots o' ruck.
T'anks, Robert www.gldsp.com ( modify address for return email ) www.numbersusa.com www.americanpatrol.com
<r_obert@REMOVE_THIS.hotmail.com> wrote in message
news:t63huvc1mchh90t0e4vi9a0m72rajk5bjb@4ax.com...
> Assume you meant IIR.
Yes.
> >The length of the impulse response, i.e., the amount of ringing, is the > >bandwidth of the frequency response. Use a higher order filter as Clay > > Not quite sure what you mean here.
You really want to be able to see this in your head. The frequency response is the Fourier transform of the impulse response, so the impulse response is the inverse Fourier transform of the frequency response. The inverse Fourier transform is just the complex conjugate of the Fourier transform. So if you want an impulse response that is concentrated around zero, it's the same as wanting a frequency response curve that is "smooth", i.e., you want the Fourier transform of the frequency response curve to contain mostly low "frequencies".
> Somehow before asking this question on comp.dsp, I had gotten the > impression that a steeper transition would provide less ringing. But > could have just been a wrong impression.
When you have a good picture of the above, you can see that rapid changes in the frequency response mean a less concentrated impulse response.
> Not sure what you're saying here either. Sorry. I understand your > basic point ( narrow notch = lots of ringing ), but not sure how you > came to it.
There is a limit to how concentrated a signal can be in both time and frequency. In quantum mechanics, this implies Heisenberg's uncertainty principle, which is such a catchy name that a lot of people apply it to this time-frequency compactness limit in all circumstances.
In article fn3huv8ol9ai1a93mo06uk3mndr49hn4im@4ax.com,
r_obert@REMOVE_THIS.hotmail.com at r_obert@REMOVE_THIS.hotmail.com wrote on
12/23/2003 11:57:

> robert bristow-johnson <rbj@surfglobal.net> wrote: > >> In article 407duvga6086tosc3tbf17nnpegf3ibqru@4ax.com, >> r_obert@REMOVE_THIS.hotmail.com at r_obert@REMOVE_THIS.hotmail.com wrote on >> 12/22/2003 02:28: >> >>> I have an IIR notch filter ( i.e. bandstop ), that rings like crazy >>> whenever a transient signal comes through ... which is very unwanted >>> for my application. Anybody have any ideas how to get around this? I >>> have to stick with IIR form filters. I've tried all the various >>> standard design flavors, i.e. Butterworth, Bessel, Elliptic, etc ... >>> but they all seem to ring unacceptably about the same. >> >> hmmm. this must be more than a 2nd order IIR notch, because there wouldn't >> be any differentiation between Butterworth, Bessel, etc. do you need a > > Yah, 2 order biquads ... but I've typically been using 3 in series, > i.e. 6th order overall. > >> broad stopband? because if you don't, i think a 2nd order would do fine for >> just eliminating a single frequency. > > I cannot have the transition regions too long, else they cut into > desired frequency content. But I will look into cutting back on the > order, to see if it helps.
dunno if it will help your ringing problem to do that. but i can now see how you can have a "butterworth notch" vs. a "bessel notch". there is a classical way to map a Nth order LPF to a (2N)th order BPF or notch, so your 6th order notch can be mapped to a 3rd order LPF prototype. and a 3rd order LPF *does* have a differentiation between butterworth, chebyshev, bessel, elliptical types of responses. essentially, your stopband can be a little broad (so it kills a range of frequencies instead of just one), but still have a steep transistion. a 2nd order notch can have very steep transition regions (crank up the Q), but it can only absolutely kill a single frequency and it will ring like crazy.
>> anyway, since you can model any notch as a straight wire and a BPF >> subtracted from it, if the notch is narrow (usually the desired property), >> then the BPF passband is narrow also, and then, because of the preservation >> of the time-bandwidth product, there is nothing that i can imagine that you > > Robert, can you give a little more explanation/spell out the > time-bandwidth thing? I'm sure I've studied/worked with it a bit, but > it escapes me now ( and it seems like a piece of fundamental info that > should be known ).
it *is* kinda fundamental and it isn't conceptually real complicated. it is simply a direct consequence of the Fourier time scaling property. assuming a>0, if FT{ x(t) } = X(f) then FT{ x(a*t) } = (1/a) * X(f/a) now if x(t) is a pulse-like function and you have some metric or definition on how you define its "pulse-width", then, if you maintain the same definition, that pulse-width has to be proportional to 1/a. i.e. if a is 2, you make the function x(t) "go twice as fast" and its width in time is half as long. now apply the same thinking to the FT of x(t) which is X(f). create some definition of how you will measure the bandwidth of of X(f), and if you keep using the same definition, then since the scaler on f is 1/a, it should be clear that the bandwidth of X(f/a) is proportional to a. so pulse-width is proportional to 1/a, bandwidth is proportional to a, the product of pulse-width and bandwidth is proportional to 1/a * a = 1 which means that the product of pulse-width and bandwidth is constant even as "a" changes. all's this means is that you have to expect that a narrow BPF or a narrow notch is going to have to have a wide impulse response.
>> can do to reduce the ringing except for widening the notch. > > Ok. Guess that might be the bottom line. If so, I'll have to think > of more creative ways to get around this problem, either by using a > different type of filter structure, or some other modification of my > processing scheme.
i don't see how a different filter structure will change things if the transfer function (or frequency response) is the same. and you can change the transfer function (like widening the notch) without changing the structure. "some other modification" might do it but that opens up the problem to a whole different thing.
>> rots o' ruck. > > T'anks,
folks might notice that's what i say when i am not very hopeful for a solution to their stated problem, at least as i understand it. (sorry, r_obert.) r b-j
Matt Timmermans wrote:

> <r_obert@REMOVE_THIS.hotmail.com> wrote in message > news:t63huvc1mchh90t0e4vi9a0m72rajk5bjb@4ax.com... > >>Assume you meant IIR. > > > Yes. > > >>>The length of the impulse response, i.e., the amount of ringing, is the >>>bandwidth of the frequency response. Use a higher order filter as Clay >> >>Not quite sure what you mean here. > > > You really want to be able to see this in your head. The frequency response > is the Fourier transform of the impulse response, so the impulse response is > the inverse Fourier transform of the frequency response. The inverse > Fourier transform is just the complex conjugate of the Fourier transform. > > So if you want an impulse response that is concentrated around zero, it's > the same as wanting a frequency response curve that is "smooth", i.e., you > want the Fourier transform of the frequency response curve to contain mostly > low "frequencies". > > >>Somehow before asking this question on comp.dsp, I had gotten the >>impression that a steeper transition would provide less ringing. But >>could have just been a wrong impression. > > > When you have a good picture of the above, you can see that rapid changes in > the frequency response mean a less concentrated impulse response. > > >>Not sure what you're saying here either. Sorry. I understand your >>basic point ( narrow notch = lots of ringing ), but not sure how you >>came to it. > > > There is a limit to how concentrated a signal can be in both time and > frequency. In quantum mechanics, this implies Heisenberg's uncertainty > principle, which is such a catchy name that a lot of people apply it to this > time-frequency compactness limit in all circumstances.
I'll try to come at this point another way. As R.B-J. pointed out, a narrow notch can be made by subtracting a sharp peak from the original signal ("short wire"). It doesn't matter how the notch is made; it behaves like what it is. When an impulse excites a sharp peak, all the energy comes out, but only at the peak's frequency. It follows that it comes out over an extended period. Think about the impulse of a hammer on a sharply tuned structure (say, a bell or a piano string) as you think about what "ringing" means. Sharp resonances -- high Qs -- have steep sides. Low Q resonances have broader bases for the same height. When the slope is low enough to approximate critical damping, there's no ringing at all. 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;
<r_obert@REMOVE_THIS.hotmail.com> wrote in message
news:ei3huvk3fektui43cli21h2rnvv85jqhte@4ax.com...
> "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote: > > > > > > >Well, I don't agree with this exactly. Although there can be cases like > >this. > >The ringing has to do with the transition widths more than anything. > >Increasing the order of the filter can make that worse unless there is
some
> >deliberate shaping going on. > > > >Take a lowpass filter as an example. The sharper the cutoff, the higher
the
> >ringing amplitude - the more the ringing approximates what would result
from
> >an ideal lowpass = the integral of a sinc. > >Ringing amplitude and ringing duration are two different things of
course.
> > I had noticed a somewhat inverse relationship, i.e. a filter > intentionally designed with low ringing amplitude has longer ringing > duration, and vice versa.
Well, it's possible but not axiomatic. What's important is the shape. Very short filters can have low ringing amplitude. In fact, it's more likely because short FIR filters can't have sharp cutoff - which is associated with ringing. Fred
"Matt Timmermans" <mt0000@sympatico.nospam-remove.ca> wrote:

> ><r_obert@REMOVE_THIS.hotmail.com> wrote in message >news:t63huvc1mchh90t0e4vi9a0m72rajk5bjb@4ax.com... >> Assume you meant IIR. > >Yes. > >> >The length of the impulse response, i.e., the amount of ringing, is the >> >bandwidth of the frequency response. Use a higher order filter as Clay >> >> Not quite sure what you mean here. > >You really want to be able to see this in your head.
Yup Matt, that's why I asked ( as opposed to seeing it in my shorts, or something? Haha ).
>The frequency response >is the Fourier transform of the impulse response, so the impulse response is >the inverse Fourier transform of the frequency response. The inverse >Fourier transform is just the complex conjugate of the Fourier transform.
Yes, I know those things ... or have been reminded. Hehe.
> >So if you want an impulse response that is concentrated around zero, it's >the same as wanting a frequency response curve that is "smooth", i.e., you >want the Fourier transform of the frequency response curve to contain mostly >low "frequencies".
Gotcha. As close as possible to a straight line, DC frequency response.
> >> Somehow before asking this question on comp.dsp, I had gotten the >> impression that a steeper transition would provide less ringing. But >> could have just been a wrong impression. > >When you have a good picture of the above, you can see that rapid changes in >the frequency response mean a less concentrated impulse response.
Yes, that helps.
> >> Not sure what you're saying here either. Sorry. I understand your >> basic point ( narrow notch = lots of ringing ), but not sure how you >> came to it. > >There is a limit to how concentrated a signal can be in both time and >frequency. In quantum mechanics, this implies Heisenberg's uncertainty >principle, which is such a catchy name that a lot of people apply it to this >time-frequency compactness limit in all circumstances.
A few more words, but maybe still not clear reasons how you concluded "By the DSP uncertainty principle, it's clear that a very narrow notch has to have a very ringy impulse response". But that's ok, you've been helpful. I've run across the uncertainty principle at one point or another, via school, etc. But it's been a while since I've dealt with it. Thanks, Robert www.gldsp.com ( modify address for return email ) www.numbersusa.com www.americanpatrol.com
Jerry Avins wrote:

R.B-J. wrote "straight wire", not "short wire".

Unfortunately, critically damped peaks have broader tops as well as less
steep sides.

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;

robert bristow-johnson <rbj@surfglobal.net> wrote:

>In article fn3huv8ol9ai1a93mo06uk3mndr49hn4im@4ax.com, >r_obert@REMOVE_THIS.hotmail.com at r_obert@REMOVE_THIS.hotmail.com wrote on >12/23/2003 11:57: > >> robert bristow-johnson <rbj@surfglobal.net> wrote: >> >>> In article 407duvga6086tosc3tbf17nnpegf3ibqru@4ax.com, >>> r_obert@REMOVE_THIS.hotmail.com at r_obert@REMOVE_THIS.hotmail.com wrote on >>> 12/22/2003 02:28: >>> >>>> I have an IIR notch filter ( i.e. bandstop ), that rings like crazy >>>> whenever a transient signal comes through ... which is very unwanted >>>> for my application. Anybody have any ideas how to get around this? I >>>> have to stick with IIR form filters. I've tried all the various >>>> standard design flavors, i.e. Butterworth, Bessel, Elliptic, etc ... >>>> but they all seem to ring unacceptably about the same. >>> >>> hmmm. this must be more than a 2nd order IIR notch, because there wouldn't >>> be any differentiation between Butterworth, Bessel, etc. do you need a >> >> Yah, 2 order biquads ... but I've typically been using 3 in series, >> i.e. 6th order overall. >> >>> broad stopband? because if you don't, i think a 2nd order would do fine for >>> just eliminating a single frequency. >> >> I cannot have the transition regions too long, else they cut into >> desired frequency content. But I will look into cutting back on the >> order, to see if it helps. > >dunno if it will help your ringing problem to do that. but i can now see >how you can have a "butterworth notch" vs. a "bessel notch". there is a >classical way to map a Nth order LPF to a (2N)th order BPF or notch, so your >6th order notch can be mapped to a 3rd order LPF prototype. and a 3rd order >LPF *does* have a differentiation between butterworth, chebyshev, bessel, >elliptical types of responses. essentially, your stopband can be a little
For the notch filter, I have not seen much differentiation in the amount of ringing. However, in the lowpass case, there is. For instance, the Bessel has ringing characteristics more to my liking then the Butterworth ( i.e. less of it ), etc And you appear to be confirming this, and suggesting the mapping to get the LPF benefits. Of course, I'll have to shed my deeply ingrained biquad ways then. Haha. But anything for a viable solution. I'll need to look into how to map the 6th notch to a 3rd order LPF.
>broad (so it kills a range of frequencies instead of just one), but still >have a steep transistion. a 2nd order notch can have very steep transition
A bit confused here. The frequency I'm trying to be rid of is close to other frequencies of interest. So killing a range of frequencies instead of just the one would be a bad thing. You may have been suggesting that mapping to a LPF would result in that.
>regions (crank up the Q), but it can only absolutely kill a single frequency >and it will ring like crazy.
Killing a single frequency, with steep transition is the desired effect, but obviously without the ringing.
>> >> Robert, can you give a little more explanation/spell out the >> time-bandwidth thing? I'm sure I've studied/worked with it a bit, but >> it escapes me now ( and it seems like a piece of fundamental info that >> should be known ). > >it *is* kinda fundamental and it isn't conceptually real complicated. it is >simply a direct consequence of the Fourier time scaling property. > >assuming a>0, if > > FT{ x(t) } = X(f) > >then > > FT{ x(a*t) } = (1/a) * X(f/a) > >now if x(t) is a pulse-like function and you have some metric or definition >on how you define its "pulse-width", then, if you maintain the same >definition, that pulse-width has to be proportional to 1/a. i.e. if a is 2, >you make the function x(t) "go twice as fast" and its width in time is half >as long.
Yah, the time/frequency inverse thing.
> >now apply the same thinking to the FT of x(t) which is X(f). create some >definition of how you will measure the bandwidth of of X(f), and if you keep >using the same definition, then since the scaler on f is 1/a, it should be >clear that the bandwidth of X(f/a) is proportional to a. > >so pulse-width is proportional to 1/a, bandwidth is proportional to a, the >product of pulse-width and bandwidth is proportional to 1/a * a = 1 which >means that the product of pulse-width and bandwidth is constant even as "a" >changes. > >all's this means is that you have to expect that a narrow BPF or a narrow >notch is going to have to have a wide impulse response.
Got it.
> >>> can do to reduce the ringing except for widening the notch. >> >> Ok. Guess that might be the bottom line. If so, I'll have to think >> of more creative ways to get around this problem, either by using a >> different type of filter structure, or some other modification of my >> processing scheme. > >i don't see how a different filter structure will change things if the >transfer function (or frequency response) is the same. and you can change >the transfer function (like widening the notch) without changing the >structure. "some other modification" might do it but that opens up the >problem to a whole different thing.
Yah.
> >>> rots o' ruck. >> >> T'anks, > >folks might notice that's what i say when i am not very hopeful for a >solution to their stated problem, at least as i understand it. (sorry, >r_obert.)
That's the way it goes sometimes. Haha. We'll see. You did mention one possible option, though, via the map to LPF. Thanks, Robert ( modify address for return email ) www.numbersusa.com www.americanpatrol.com