FIR Filters

From AstroBaki
Jump to navigationJump to search

Short Topical Videos[edit]

Reference Material[edit]

1 Finite Impulse Response (FIR) filters

FIR filter.png
Schematic diagram of an FIR filter where sample delays (), coefficient multiplication (), and summation are used to convolve the input waveform is by the coefficients . This convolution in time corresponds to a multiplication in frequency, making the output samples, , reflect a frequency-filtered version of .

FIR filters are digital circuits that are used to filter an input signal in frequency. As shown above, samples of a signal, , propagate through the chain of delays along the top of the diagram as the circuit is clocked. At each clock, the set of samples of (where is called the number of “taps" in the FIR filter) held in this chain of delays is multiplied by coefficients, , and then summed. While the coefficients remain constant — each associated with one tap — the input samples continue to shift through the circuit. In effect, this results in the input waveform being convolved by the coefficients , as in the equation:

When , , and are discretely sampled, this convolution becomes

which is precisely the arithmetic that the FIR filter circuit implements. In particular, note how the samples of (which increase left-to-right in the figure above), are multiplied by samples of that are in the opposite order. For example, in a 4-tap FIR filter, 4 samples of are multiplied by 4 samples of in reversed order before the products are all summed together to produce . Note that the output sample for is labeled , but because the logical steps of multiplication and summation, the first valid sample of the convolved signal may appear several clock cycles after the input signal is multiplied. This delay in the output (called the “latency”) is a common artifact of digital signal processing circuits, and is usually not a problem.

1.1 Coefficient Selection

FIR filters implement different filtering shapes, depending on the values chosen for . By the convolution theorem, represents the Fourier transform of the frequency filter that is applied. Usually, the amplitude of this filter as a function of frequency is the most important feature; the (complex) phase of the output is of less importance. This, combined with the fact that windowing functions may be desired to reduce spectral leakage and to optimize filter flatness, roll-off, or stop-band rejection, can complicate the choice of FIR coefficients. Many design tools exist for optimizing FIR filter coefficients.

1.2 Optimizations

One common optimization in FIR filters is to use only real-valued coefficients for . While the resulting filter must necessarily be symmetric between positive and negative frequency components, this constrain is often worth the factor of 2 reduction in the computational complexity of the FIR filtering operation. (Real-valued multiplies require approximately half the operations complex multiplies require). Another common optimization in FIR filters is to implement half-band, quarter-band, etc. filters, where a large number of the FIR coefficients end up being 0. Since such coefficients can be implemented by stripping out the multiplier circuit and omitting the tap from the summation, this optimization can similarly save a significant fraction of resources.

1.3 Number of Taps

Finally, the number of taps in an FIR filter affects the sharpness of the filter. This can be easily understood by recognizing that the number of taps determines the length of time over which the filter operates, and sharp features in frequency require longer time intervals to represent. In fact, for those who are familiar with “poles" in analog filters (1 pole = -6dB; people talk about, e.g., a 6-pole Butterworth filter), each tap in an FIR filter is equal to 1 pole.