I am trying to design a second order digital IIR band stop (notch) filter with the following specs: 3dB cut off frequencies: 55Hz and 65Hz I want the notch at 60Hz with atleast 90dB attenuation at the 60Hz. Sampling frequency: 200hz I tried various filter configurations like a Butterworth or Chebyshev but could not get the attenuation higher than 70 dB.I want a second order filter to accomplish this i.e I do not want to go to a higher order filter. Can someone suggest any possible solutions to this problem. Many thanks

# IIR notch filter

Started by ●June 26, 2008

Posted by ●June 26, 2008

On Jun 26, 6:30 pm, "itsh11" <its...@yahoo.com> wrote:> I am trying to design a second order digital IIR band stop (notch) filter > with the following specs: > > 3dB cut off frequencies: 55Hz and 65Hz > I want the notch at 60Hz with atleast 90dB attenuation at the 60Hz. > Sampling frequency: 200hz > > I tried various filter configurations like a Butterworth or Chebyshev but > could not get the attenuation higher than 70 dB.I want a second order > filter to accomplish this i.e I do not want to go to a higher order > filter. > > Can someone suggest any possible solutions to this problem. Many thanksWith a 2nd-order bandstop filter, I'm not sure there's any difference between Chebyshev and Butterworth. You're pretty much limited to sticking your zeros on the unit circle at 60 Hz, and your poles close enough to meet the Q requirements. However, this kind of filter will be extremely sensitive to numerical effects (quantisation, noise shaping, etc.). -- Oli

Posted by ●June 26, 2008

On Thu, 26 Jun 2008 12:30:23 -0500, itsh11 wrote:> I am trying to design a second order digital IIR band stop (notch) > filter with the following specs: > > 3dB cut off frequencies: 55Hz and 65Hz I want the notch at 60Hz with > atleast 90dB attenuation at the 60Hz. Sampling frequency: 200hz > > I tried various filter configurations like a Butterworth or Chebyshev > but could not get the attenuation higher than 70 dB.I want a second > order filter to accomplish this i.e I do not want to go to a higher > order filter. > > Can someone suggest any possible solutions to this problem. Many thanksYour ultimate attenuation should be infinite, barring the numerical issues mentioned. I don't design these from a Butterworth, Chebychev, etc., point of view; I just make a plain ol' notch. For a transfer function given a notch frequency and bandwidth, look here: http://www.dsprelated.com/ showmessage/81610/1.php. A good book on DSP should show you how to calculate your numerical effects. -- Tim Wescott Control systems and communications consulting http://www.wescottdesign.com Need to learn how to apply control theory in your embedded system? "Applied Control Theory for Embedded Systems" by Tim Wescott Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html

Posted by ●June 26, 2008

"itsh11" <itsh11@yahoo.com> wrote in message news:brKdnUByb8CyT_7VnZ2dnUVZ_uLinZ2d@giganews.com...> I am trying to design a second order digital IIR band stop (notch) filter > with the following specs:Trying is good.> 3dB cut off frequencies: 55Hz and 65Hz > I want the notch at 60Hz with atleast 90dB attenuation at the 60Hz. > Sampling frequency: 200hzThis is not unreasonable. Will require a configuration with the non-recursive part after recursive; probably with 24 bit coefficients in numerator. For denominator, 16 bits should do.> I tried various filter configurations like a Butterworth or Chebyshev but > could not get the attenuation higher than 70 dB.I want a second order > filter to accomplish this i.e I do not want to go to a higher order > filter.Keep trying.> > Can someone suggest any possible solutions to this problem.Sure. Hire a consultant.> Many thanksHow many thanks? Vladimir Vassilevsky DSP and Mixed Signal Consultant www.abvolt.com

Posted by ●June 27, 2008

Tim Wescott wrote:> On Thu, 26 Jun 2008 12:30:23 -0500, itsh11 wrote: > >> I am trying to design a second order digital IIR band stop (notch) >> filter with the following specs: >> >> 3dB cut off frequencies: 55Hz and 65Hz I want the notch at 60Hz with >> atleast 90dB attenuation at the 60Hz. Sampling frequency: 200hz >> >> I tried various filter configurations like a Butterworth or Chebyshev >> but could not get the attenuation higher than 70 dB.I want a second >> order filter to accomplish this i.e I do not want to go to a higher >> order filter. >> >> Can someone suggest any possible solutions to this problem. Many thanks > > Your ultimate attenuation should be infinite, barring the numerical > issues mentioned. > > I don't design these from a Butterworth, Chebychev, etc., point of view; > I just make a plain ol' notch. For a transfer function given a notch > frequency and bandwidth, look here: http://www.dsprelated.com/ > showmessage/81610/1.php. > > A good book on DSP should show you how to calculate your numerical > effects.Tim, you need to figure out how to stop your newsreader from breaking URLs. http://www.dsprelated.com/showmessage/81610/1.php. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Posted by ●June 27, 2008

On Jun 26, 11:22 pm, Jerry Avins <j...@ieee.org> wrote:> Tim Wescott wrote: > > > I just make a plain ol' notch. For a transfer function given a notch > > frequency and bandwidth, look here:http://www.dsprelated.com/ > > showmessage/81610/1.php. > > > A good book on DSP should show you how to calculate your numerical > > effects. > > Tim, you need to figure out how to stop your newsreader from breaking > URLs.http://www.dsprelated.com/showmessage/81610/1.php.i always just put it on a separate line. and, to drive the point more deeply home. for a 2nd-order notch, there is no Butterworth vs. Tchebyshev. it's a mapping from a 1st- order LPF prototype with the substitution s <--- 1/(s^2 + w0^2) with a 4th-order notch (mapped as above from a 2nd-order LPF) then there's a difference. dunno why anyone would want it. r b-j

Posted by ●June 27, 2008

itsh11 wrote:> I am trying to design a second order digital IIR band stop (notch) filter > with the following specs: > > 3dB cut off frequencies: 55Hz and 65Hz > I want the notch at 60Hz with atleast 90dB attenuation at the 60Hz. > Sampling frequency: 200hz > > I tried various filter configurations like a Butterworth or Chebyshev but > could not get the attenuation higher than 70 dB.I want a second order > filter to accomplish this i.e I do not want to go to a higher order > filter. > > Can someone suggest any possible solutions to this problem. Many thanksYou may try these coefficients values. -- Juha A = [0.867000491171477 0.535833172388774 0.866992079277958]; B = [1.000000000000000 0.535833172388774 0.733992570449435]; freqz(A, B, 2^18, 200);

Posted by ●June 27, 2008

>Your ultimate attenuation should be infinite, barring the numerical >issues mentioned.I am using MATLAB to see how much attenuation I am getting at 60Hz. Here is what I see: for a 2nd order FIR filter with zero at 60Hz(on the unit circle): 85db attenuation for a 2nd order IIR filter with zero at 60Hz(on the unit circle) : 65dB attenuation for a 4th order IIR butterworth filter with two zeros at 60Hz(on the unit circle) : 130db attenuation I agree when you say if I have a zero on the unit circle at 60Hz, it should have infinite attenuation, barring the numerical issues. And I think that the finite value of attenuation MATLAB is showing, is because of this. But I don't understand why a 4th order filter shows a (much)higher attenuation at 60Hz than a 2nd order filter? Is this by chance or is there some reason to it, like having 2 zeros at the same location instead of 1? If this is the reason, why 2 zeros at the same point is better than 1 zero? What consequences I will face if I switch to a 4th order IIR notch from a 2nd order? The implementation is on a PC with sufficient computing power. Thanks.>On Thu, 26 Jun 2008 12:30:23 -0500, itsh11 wrote: > >> I am trying to design a second order digital IIR band stop (notch) >> filter with the following specs: >> >> 3dB cut off frequencies: 55Hz and 65Hz I want the notch at 60Hz with >> atleast 90dB attenuation at the 60Hz. Sampling frequency: 200hz >> >> I tried various filter configurations like a Butterworth or Chebyshev >> but could not get the attenuation higher than 70 dB.I want a second >> order filter to accomplish this i.e I do not want to go to a higher >> order filter. >> >> Can someone suggest any possible solutions to this problem. Manythanks> >Your ultimate attenuation should be infinite, barring the numerical >issues mentioned. > >I don't design these from a Butterworth, Chebychev, etc., point of view;>I just make a plain ol' notch. For a transfer function given a notch >frequency and bandwidth, look here: http://www.dsprelated.com/ >showmessage/81610/1.php. > >A good book on DSP should show you how to calculate your numerical >effects. > >-- >Tim Wescott >Control systems and communications consulting >http://www.wescottdesign.com > >Need to learn how to apply control theory in your embedded system? >"Applied Control Theory for Embedded Systems" by Tim Wescott >Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html >

Posted by ●June 27, 2008

>Your ultimate attenuation should be infinite, barring the numerical >issues mentioned.I am using MATLAB to see how much attenuation I am getting at 60Hz. Here is what I see: for a 2nd order FIR filter with zero at 60Hz(on the unit circle): 85db attenuation for a 2nd order IIR filter with zero at 60Hz(on the unit circle) : 65dB attenuation for a 4th order IIR butterworth filter with two zeros at 60Hz(on the unit circle) : 130db attenuation I agree when you say if I have a zero on the unit circle at 60Hz, it should have infinite attenuation, barring the numerical issues. And I think that the finite value of attenuation MATLAB is showing, is because of this. But I don't understand why a 4th order filter shows a (much)higher attenuation at 60Hz than a 2nd order filter? Is this by chance or is there some reason to it, like having 2 zeros at the same location instead of 1? If this is the reason, why 2 zeros at the same point is better than 1 zero? What consequences I will face if I switch to a 4th order IIR notch from a 2nd order? The implementation is on a PC with sufficient computing power. Thanks.>On Thu, 26 Jun 2008 12:30:23 -0500, itsh11 wrote: > >> I am trying to design a second order digital IIR band stop (notch) >> filter with the following specs: >> >> 3dB cut off frequencies: 55Hz and 65Hz I want the notch at 60Hz with >> atleast 90dB attenuation at the 60Hz. Sampling frequency: 200hz >> >> I tried various filter configurations like a Butterworth or Chebyshev >> but could not get the attenuation higher than 70 dB.I want a second >> order filter to accomplish this i.e I do not want to go to a higher >> order filter. >> >> Can someone suggest any possible solutions to this problem. Manythanks> >Your ultimate attenuation should be infinite, barring the numerical >issues mentioned. > >I don't design these from a Butterworth, Chebychev, etc., point of view;>I just make a plain ol' notch. For a transfer function given a notch >frequency and bandwidth, look here: http://www.dsprelated.com/ >showmessage/81610/1.php. > >A good book on DSP should show you how to calculate your numerical >effects. > >-- >Tim Wescott >Control systems and communications consulting >http://www.wescottdesign.com > >Need to learn how to apply control theory in your embedded system? >"Applied Control Theory for Embedded Systems" by Tim Wescott >Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html >

Posted by ●June 27, 2008

itsh11 wrote:> I am using MATLAB to see how much attenuation I am getting at 60Hz. Here > is what I see:My dear friend, MATLAB is only a tool. Despite of the popular belief, it can't replace the common sense, the knowledge and the experience. No matter how many magic spells like "Chebyshev Butterworth Zero Unit Circle" do you cast; you can't just take a function and use it without understanding how it works and what is inside. You should have already realized by now that the things don't work that way. On another note, the problem starts with the definition. Why exactly do you need this filter? Where do the requirements to the passband/stopband come from? The problem as stated is rather trivial. Get a book on filter design, such as: Dietrich Schlichtharle. Digital Filters: Basics and Design. Springer ISBN 3-540-66841-1 Then design and implement the filter yourself. Avoid the unnecessary clutter offered by MatLab and don't use any words or methods if you don't understand what do they mean and imply. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com> > for a 2nd order FIR filter with zero at 60Hz(on the unit circle): 85db > attenuation > > for a 2nd order IIR filter with zero at 60Hz(on the unit circle) : 65dB > attenuation > > for a 4th order IIR butterworth filter with two zeros at 60Hz(on the unit > circle) : 130db attenuation > > I agree when you say if I have a zero on the unit circle at 60Hz, it > should have infinite attenuation, barring the numerical issues. And I think > that the finite value of attenuation MATLAB is showing, is because of this. > But I don't understand why a 4th order filter shows a (much)higher > attenuation at 60Hz than a 2nd order filter? Is this by chance or is there > some reason to it, like having 2 zeros at the same location instead of 1? > If this is the reason, why 2 zeros at the same point is better than 1 zero? > > > What consequences I will face if I switch to a 4th order IIR notch from a > 2nd order? The implementation is on a PC with sufficient computing power. > > Thanks. > > >>On Thu, 26 Jun 2008 12:30:23 -0500, itsh11 wrote: >> >> >>>I am trying to design a second order digital IIR band stop (notch) >>>filter with the following specs: >>> >>>3dB cut off frequencies: 55Hz and 65Hz I want the notch at 60Hz with >>>atleast 90dB attenuation at the 60Hz. Sampling frequency: 200hz >>> >>>I tried various filter configurations like a Butterworth or Chebyshev >>>but could not get the attenuation higher than 70 dB.I want a second >>>order filter to accomplish this i.e I do not want to go to a higher >>>order filter. >>> >>>Can someone suggest any possible solutions to this problem. Many > > thanks > >>Your ultimate attenuation should be infinite, barring the numerical >>issues mentioned. >> >>I don't design these from a Butterworth, Chebychev, etc., point of view; > > >>I just make a plain ol' notch. For a transfer function given a notch >>frequency and bandwidth, look here: http://www.dsprelated.com/ >>showmessage/81610/1.php. >> >>A good book on DSP should show you how to calculate your numerical >>effects. >> >>-- >>Tim Wescott >>Control systems and communications consulting >>http://www.wescottdesign.com >> >>Need to learn how to apply control theory in your embedded system? >>"Applied Control Theory for Embedded Systems" by Tim Wescott >>Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html >>