Hi, I have the following problem: need to make a low-pass filter, which cuts everything above 2000Hz and the transition should be from 1500 till 2000Hz. I know that at 2000Hz I need to have -50dB, and for everything between 0 and 1500Hz it should be 0dB. I want to use a FIR filter, but how can I determine how many inputs (taps I think is the word) I need to take. For example if I have 10 it will be much better than 2, but how to determine it for the given problem? Please help, and sorry, I know I am a noob :)

# Determine taps for low-pass FIR filter?

Started by ●August 19, 2008

Reply by ●August 19, 20082008-08-19

>Hi, I have the following problem: need to make a low-pass filter, which >cuts everything above 2000Hz and the transition should be from 1500 till >2000Hz. I know that at 2000Hz I need to have -50dB, and for everything >between 0 and 1500Hz it should be 0dB. >I want to use a FIR filter, but how can I determine how many inputs(taps>I think is the word) I need to take. For example if I have 10 it will be >much better than 2, but how to determine it for the given problem?Please>help, and sorry, I know I am a noob :)If you have access to Matlab's Filter Design Toolbox, read the documentation. You can design the filter you need using this toolbox. You can never achieve a gain of exactly 1 in the passband of a lowpass filter. You might have some tolerance (i.e. +-0.5 dB) around your desired gain for passband. Then you can find the minimum order filter that meets them... or if you have a certain budget for the number of taps, you can find the best approximation with that length. Emre

Reply by ●August 20, 20082008-08-20

On 20 Aug, 02:51, "fittipaldi" <em.fittipa...@abv.bg> wrote:> Hi, I have the following problem: need to make a low-pass filter, which > cuts everything above 2000Hz and the transition should be from 1500 till > 2000Hz. I know that at 2000Hz I need to have -50dB, and for everything > between 0 and 1500Hz it should be 0dB. > I want to use a FIR filter, but how can I determine how many inputs (taps > I think is the word) I need to take. For example if I have 10 it will be > much better than 2, but how to determine it for the given problem?If you have access to a filter design package it might compute at least an initial 'guesstimate' from the specification you set up. For most window filters you can find tabulated values that help you get close. These tables (e.g. table 8.2 in Proakis and Manolakis' "Digital Signal Processing", 3rd ed.) give a rule of thumb estimate for *normalized* transition bandwidth as function of filter length. In order to use these tables you will have to normalize the physical corner frequencies with respect to the sampling frequency. Just keep in mind that you can't adjust stop-band attenuation with most FIR filters designed by the window method (the Kaiser filter being one of very few exceptions). Also, don't be surprised if you have to do a little bit of trial and error to find the exact filter order. Rune

Reply by ●August 20, 20082008-08-20

you can use bellangers equation to determine the number of taps. Nc = ceil((-2/3)*log10(20*d1*d2)*Fs/abs(fs-fp)); fp : passband freq fs : stopband freq d1 : passband tol d2 : stopband tol Fs : sampling freq. Regards Bharat Pathak Arithos Designs www.Arithos.com DSP Design consultancy and Corporate/Students Training Company.

Reply by ●August 20, 20082008-08-20

fittipaldi wrote:> Hi, I have the following problem: need to make a low-pass filter, which > cuts everything above 2000Hz and the transition should be from 1500 till > 2000Hz. I know that at 2000Hz I need to have -50dB, and for everything > between 0 and 1500Hz it should be 0dB. > I want to use a FIR filter, but how can I determine how many inputs (taps > I think is the word) I need to take. For example if I have 10 it will be > much better than 2, but how to determine it for the given problem? Please > help, and sorry, I know I am a noob :)Get a free trial version of ScopeFIR from http://www.iowegian.com/ Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������

Reply by ●August 22, 20082008-08-22

On Wed, 20 Aug 2008 12:49:07 -0400, Jerry Avins <jya@ieee.org> wrote:>fittipaldi wrote: >> Hi, I have the following problem: need to make a low-pass filter, which >> cuts everything above 2000Hz and the transition should be from 1500 till >> 2000Hz. I know that at 2000Hz I need to have -50dB, and for everything >> between 0 and 1500Hz it should be 0dB. >> I want to use a FIR filter, but how can I determine how many inputs (taps >> I think is the word) I need to take. For example if I have 10 it will be >> much better than 2, but how to determine it for the given problem? Please >> help, and sorry, I know I am a noob :) > >Get a free trial version of ScopeFIR from http://www.iowegian.com/ > >JerryHi Jer, Good suggestion. If fittipaldi wants a quick estimate of the number of taps, he can use a simple expression provided to us by fred harris. It's Atten Num Taps = ------------------- 22*(Fstop - Fpass) where "Atten" is the desired stopband attenuation in dB (50), "Fstop" is 2000/Fs, and "Fpass" is 1500/Fs. (fittipaldi hasn't told us what is his "Fs" sample rate.) The above expression is fairly accurate under the assumption that the passband peak-peak ripple is roughly 0.1 dB. See Ya', [-Rick-]

Reply by ●August 22, 20082008-08-22

On Aug 22, 3:49�am, Rick Lyons <R.Lyons@_BOGUS_ieee.org> wrote:> On Wed, 20 Aug 2008 12:49:07 -0400, Jerry Avins <j...@ieee.org> wrote: > >fittipaldi wrote: > >> Hi, I have the following problem: need to make a low-pass filter, which > >> cuts everything above 2000Hz and the transition should be from 1500 till > >> 2000Hz. I know that at 2000Hz I need to have -50dB, and for everything > >> between 0 and 1500Hz it should be 0dB. > >> I want to use a FIR filter, but how can I determine how many inputs (taps > >> I think is the word) I need to take. For example if I have 10 it will be > >> much better than 2, but how to determine it for the given problem? Please > >> help, and sorry, I know I am a noob :) > > >Get a free trial version of ScopeFIR fromhttp://www.iowegian.com/ > > >Jerry > > Hi Jer, > � Good suggestion. > > If fittipaldi wants a quick estimate of the > number of taps, he can use a simple expression > provided to us by fred harris. �It's > > � � � � � � � � � � Atten > � �Num Taps = ------------------- > � � � � � � � �22*(Fstop - Fpass) > > where "Atten" is the desired stopband attenuation in > dB (50), "Fstop" is 2000/Fs, and "Fpass" is 1500/Fs. > > (fittipaldi hasn't told us what is his "Fs" sample rate.) > > The above expression is fairly accurate under the assumption > that the passband peak-peak ripple is roughly 0.1 dB. > > See Ya', > [-Rick-]In this day and age of fast computers, why not really measure what you need instead of estimate? I know the estimate is reasonable, but with FIR design software, the real answer can be found very quickly (plus you will have the actual filter). Besides Grant's code, mine is also available for free (right price) at www.claysturner.com/dsp And it is set up to easily step the number of taps up or down once a specification has been entered. Clay