Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!vsi1!teda!netcom!mcmahan From: mcmahan@netcom.UUCP (Dave Mc Mahan) Newsgroups: comp.dsp Subject: Re: Digital Filters Message-ID: <16919@netcom.UUCP> Date: 16 Nov 90 05:42:51 GMT References: <1990Nov15.121559.11290@watserv1.waterloo.edu> Distribution: na Organization: Dave McMahan @ NetCom Services Lines: 49 In a previous article, optadm7@watserv1.waterloo.edu (J.Cassidy - Optometry) writes: >I have a really interesting application for digital filtering >using a DSP chip, but I am having some difficulty understanding >the derrivations for a filter's tap coefficients. > >I understand that the expression of a FIR filter is: > >b0*a[n] + b1*a[n-1] + b2*a[n-2] + etc... > >where b[0] to b[n] are the tap coefficients and assume they >are what determine the performance of the filter. But how >to I generate b[n], given that I have the filter parameters >such as filter type (butterworth/bandpass), lowpass cutoff >frequency, highpass cutoff frequency, etc. > >I have been searching for this algorithm/program for a while >now. Most application notes that I see show the filter >algorithm and the values of b[n], but never show how they >derrived the values of b[n], given the filter's parameters. You can simulate a butterworth filter design with an FIR filter, but it is really an IIR filter type and is best suited for that type of filter. To get the desired filter shape, I use MatLab. I wrote a simple function that does a inverse-DFT because MatLab didn't have one and the inverse-FFT it comes with produces complex components that I would have to process anyway. I then decide about how many taps I think it should take to do the filter I want and make an amplitude response for that filter. Since all the filters I design need to have constant group delay (linear phase response) I don't need to worry about taking the phase into account. The IDFT routine I wrote just assumes that I want linear phase. I then make a vector with the desired amplitude of the frequency spectrum I want, usually using a value of 1 for passband frequencies and 0 for stop band frequencies. I then use the IDFT function to convert the frequency domain response to the time domain impulse response that are the filter tap weights. Do to the way the IDFT function works, I have to swap the left half and right halves of the resulting time domain response to obtain the tap weights in proper order. It's not the totally optimal design package and method, but it works for me! >Jim C. >Jim Cassidy optadm7@watserv1.waterloo.{edu,cdn} -dave -- Dave McMahan mcmahan@netcom.uucp {apple,amdahl,claris}!netcom!mcmahan