FIR Filters FlyFIR Filters Fly

DN Staff

May 14, 2007

3 Min Read
FIR Filters Fly

The previous "Tips" column introduced the Quickfilter QF4A512 IC that includes a 512-tap finite-impulse-response (FIR) filter for each channel. That type of filter might sound intimidating if you have built active filters with op amps and passive components. A FIR filter works much like a moving average that smoothes stock-market prices over x days. But, unlike an average that simply adds x prices and divides by x, an FIR filter first applies a coefficient to each data point.

The figure below shows how raw data, say from an analog-to-digital converter, flows through an FIR filter that multiplies each value by a coefficient and then sums the results to produce a new value. Thus, each x value shifted in produces a new filtered output value, y. If you put in a finite number of non-zero values, you get a finite number of non-zero values at the filter's output, thus the name, finite impulse response. Engineers like FIR filters because they produce time-invariant linear response. "Time invariant" means these filters respond the same way to a signal, no matter when the signal arrives. And "linear" means the filter always responds the same way to a frequency component, no matter what other frequencies exist within a signal. Keep in mind an FIR filter operates on discrete-time samples, not on continuous analog signals.

Most FIR filters exist as software routines that manage a buffer of input values, perform math operations and put out a result. Some digital signal-processor (DSP) chips provide architectures optimized for these operations, so coding takes little effort and not much memory. You also can program FIR routines in C, BASIC or another language and run them on a PC.

The trick to applying an FIR filter lies in knowing how to specify filter characteristics and then calculating the proper coefficients. Thankfully, people have developed software that takes filter characteristics and computes coefficients. Most designers start with the Parks-McClellan algorithm that operates within many FIR-filter design programs.

If you want to learn more about FIR filter response, I recommend the ScopeFIR software from Iowegian International. You can buy the software ($199) or download a free 60-day trial version. After you choose a filter type and set filter characteristics, the program produces a frequency-response plot, an impulse plot and a list of coefficients. You can save coefficients and import coefficients. The two books I recommend cover FIR filters in detail and explain how to evaluate an FIR filter for use in a real-world application. If you plan to implement a filter, you might need to balance the number of coefficients in your filter algorithm with the math capabilities of your software or processor. Don't let the 18-digit coefficients from the ScopeFIR program concern you. I rounded the 21 coefficients for a notch filter to three significant digits and got the same filter response.

Sign up for Design News newsletters

You May Also Like