# FIR Filters

### From AstroBaki

### [edit] Short Topical Videos

### [edit] Reference Material

## Contents |

## 1 Finite Impulse Response (FIR) filters

*Schematic diagram of an FIR filter where sample delays (*

*Z*), coefficient multiplication (*b*), and summation are used to convolve the input waveform*x*is by the coefficients*b*. This convolution in time corresponds to a multiplication in frequency, making the output samples,*y*_{i}, reflect a frequency-filtered version of*x*_{i}.FIR filters are digital circuits that are used to filter an input signal in frequency. As shown above, samples of a signal, *x*_{i}, propagate through the chain of delays along the top of the diagram as the circuit is clocked. At each clock, the set of *N* samples of *x* (where *N* is called the number of “taps" in the FIR filter) held in this chain of delays is multiplied by *N* 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 *x* being convolved by the coefficients *b*, as in the equation:

When *x*, *b*, and *y* are discretely sampled, this convolution becomes

which is precisely the arithmetic that the FIR filter circuit implements. In particular, note how the samples of *b* (which increase left-to-right in the figure above), are multiplied by samples of *x* that are in the opposite order. For example, in a 4-tap FIR filter, 4 samples of are multiplied by 4 samples of *x* in reversed order [*x*(*t*_{3}),*x*(*t*_{2}),*x*(*t*_{1}),*x*(*t*_{0})] before the products are all summed together to produce *y*(*t*_{0}) = *b*(*t*_{0})*x*(*t*_{3}) + *b*(*t*_{1})*x*(*t*_{2}) + *b*(*t*_{2})*x*(*t*_{1}) + *b*(*t*_{3})*x*(*t*_{0}). Note that the output sample for *y* is labeled *t*_{0}, 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 *b*. By the convolution theorem, *b*(*t*) 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 *b*. 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.