Greer wrote:> Hi, > > I am trying to obtain a FIR notch filter which is very narrow. For > example, a 50 Hz notch filter to remove mains noise from a 1250Hz signal > say. > > Doing this with an IIR filter was easy, I could specify my "notch region" > as small as [49 51]Hz. > > I am now trying to do the same with a FIR filter. I am using Intel > Peformance Primative functions to generate the taps. These use the > windowing method (I think). > > This does not seem to be feasible, as the attenuation at the notch > frequency is pitiful if you define the notch region as [49 51]. > > What I would like to know is: > > (1) Does this sound correct to you (I may have made an error somewhere) > > (2) I know there are other methods for coefficient generation > (Parks-McClellan etc). Will these allow me to define a very narrow FIR > notch filter with a reasonable number of coefficients? > > Many thanks, > Greer > > > > > > > > This message was sent using the Comp.DSP web interface on > www.DSPRelated.comA solution is to use a Multirate design. Essentially you would form a band pass version of the signal you are tryiing to filter out, and subtract it from the original signal. The steps would be: 1) Shift 50 Hz down to 0 Hz 2) Decimate - do this is steps if necessary 3) Final Filter to get the proper band edges you desire 4) Interpolate back to original sampling frequency 5) shift 0Hz back to 50 Hz 6) Subtract the resulting signal from the original. Of course you must take care to handle the group delays properly, and you want to design the filters so the overall group delay is an integer number of samples - so you can delay the original signal by an integer number. Using this method you can achieve very narrow notch filters, even more than IIR. The main problem with this design is the overall group delay is fairly large. This is mainly due to the decimation steps. It is complicated, but it gets you where you want to go. This method is briefly talked about Crochiere and Rabiners book on Multirate. Cheers, David

# FIR notch filters using the Windowing method

Started by ●April 13, 2005

Reply by ●April 15, 20052005-04-15

Reply by ●April 15, 20052005-04-15

Bob Cain wrote:> > > Jerry Avins wrote: > >> I've long (a little longer than I've been hanging around here) taken >> it for granted that in order to affect a frequency significantly, a >> filter's significant impulse response needs to last in the order of >> that frequencies reciprocal. > > > How about h[0] = 1, h[1] = -1? That has rather profound effects at low > frequencies and is kinda short. :-)Is it linear? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������

Reply by ●April 15, 20052005-04-15

Jerry Avins wrote:> Bob Cain wrote: > >> >> >> Jerry Avins wrote: >> >>> I've long (a little longer than I've been hanging around here) taken >>> it for granted that in order to affect a frequency significantly, a >>> filter's significant impulse response needs to last in the order of >>> that frequencies reciprocal. >> >> >> >> How about h[0] = 1, h[1] = -1? That has rather profound effects at >> low frequencies and is kinda short. :-) > > > Is it linear?Is differentiation linear? Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein

Reply by ●April 15, 20052005-04-15

Bob Cain wrote:> > Jerry Avins wrote: > > Bob Cain wrote: > > > >> > >> > >> Jerry Avins wrote: > >> > >>> I've long (a little longer than I've been hanging around here) taken > >>> it for granted that in order to affect a frequency significantly, a > >>> filter's significant impulse response needs to last in the order of > >>> that frequencies reciprocal. > >> > >> > >> > >> How about h[0] = 1, h[1] = -1? That has rather profound effects at > >> low frequencies and is kinda short. :-) > > > > > > Is it linear? > > Is differentiation linear?You were doing well up to now. Your filter is not differentiation regardless of a popular belief that it is. A simple yes to the question would have been a better answer. Maybe "in order to affect a frequency significantly, a filter's significant impulse response needs to last in the order of that frequencies reciprocal" holds true ONLY for low pass filters. ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Reply by ●April 15, 20052005-04-15

"Jerry Avins" <jya@ieee.org> wrote in message news:k6ednR8gMo1AbcLfRVn-3w@rcn.net...> Bob Cain wrote: > > > > > > Jerry Avins wrote: > > > >> I've long (a little longer than I've been hanging around here) taken > >> it for granted that in order to affect a frequency significantly, a > >> filter's significant impulse response needs to last in the order of > >> that frequencies reciprocal. > > > > > > How about h[0] = 1, h[1] = -1? That has rather profound effects at low > > frequencies and is kinda short. :-) > > Is it linear?Yes. It's a simple HP filter with the 3dB point at half the sample rate and ~6dB of gain (and of course at null at DC). Changing it to h[0] = 0.5, h[1] = -0.5 yields a unity-gain version. Interesting counter-example.

Reply by ●April 15, 20052005-04-15

"David Kirkland" <spam@netscape.net> wrote in message news:OiQ7e.6369$MZ2.910097@news20.bellglobal.com...> > Fred, > If you look at the equations to predict the filter length for the PM > algorithm( there are a couple common forms), the length is based largely > on the percetage of the transition width to the sampling frequency. > The other driving factors are the attenuation and dB ripple > specifications. > > Another way of thinking about it, if you change the samping rate but keep > the same filter coefficients, the frequency response is exactly the same > but just dilated/scaled by the ratio of the sampling frequencies. > > Cheers, > DavidDavid, Yes, I understand. The issue I was addressing was the notion that "it gets more difficult if the frequency of the transition were to be low rather than high". So, when you say that length is based largely on "the percentage of the transition width to the sampling frequency" you are saying it is absolute transition width normalized to the sample rate. So, we agree. And, I didn't disagree with the other viewpoint after it was put in context of IIR filters, etc. Fred

Reply by ●April 15, 20052005-04-15

jim wrote:> You were doing well up to now. Your filter is not differentiation > regardless of a popular belief that it is. A simple yes to the question > would have been a better answer.Care to elaborate? Thanks, Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein

Reply by ●April 15, 20052005-04-15

Bob Cain wrote:> > > Jerry Avins wrote: > >> Bob Cain wrote: >> >>> >>> >>> Jerry Avins wrote: >>> >>>> I've long (a little longer than I've been hanging around here) taken >>>> it for granted that in order to affect a frequency significantly, a >>>> filter's significant impulse response needs to last in the order of >>>> that frequencies reciprocal. >>> >>> >>> >>> >>> How about h[0] = 1, h[1] = -1? That has rather profound effects at >>> low frequencies and is kinda short. :-) >> >> >> >> Is it linear? > > > Is differentiation linear?Now I understand your h[] notation. The response provided doesn't have any sharp edges or single out any particular low frequencies, so I don't think it illustrates or contradicts my rule of thumb. h[n] = 0 for all n has a drastic effect too. :-) Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������

Reply by ●April 15, 20052005-04-15

Bob Cain wrote:> > jim wrote: > > > You were doing well up to now. Your filter is not differentiation > > regardless of a popular belief that it is. A simple yes to the question > > would have been a better answer. > > Care to elaborate?Not really but here goes. The correct answer to the question is it linear was yes. It's an FIR filter why wouldn't it be linear. Whether differentiation is linear or not is irrelevant. -jim ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Reply by ●April 15, 20052005-04-15

Jerry Avins wrote:> > Bob Cain wrote: > > > > > > Jerry Avins wrote: > > > >> Bob Cain wrote: > >> > >>> > >>> > >>> Jerry Avins wrote: > >>> > >>>> I've long (a little longer than I've been hanging around here) taken > >>>> it for granted that in order to affect a frequency significantly, a > >>>> filter's significant impulse response needs to last in the order of > >>>> that frequencies reciprocal. > >>> > >>> > >>> > >>> > >>> How about h[0] = 1, h[1] = -1? That has rather profound effects at > >>> low frequencies and is kinda short. :-) > >> > >> > >> > >> Is it linear? > > > > > > Is differentiation linear? > > Now I understand your h[] notation. The response provided doesn't have > any sharp edges or single out any particular low frequencies, so I don't > think it illustrates or contradicts my rule of thumb. h[n] = 0 for all n > has a drastic effect too. :-)I think you just smashed another barrel. The filter [1,-1]/2 does the exact opposite of what your rule of thumb predicts. -jim ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----