Lab.4&5. FIR Filters
Lab.4&5. FIR Filters
Lab.4&5. FIR Filters
4.1. Definition
In signal processing, a finite impulse response (FIR) filter is a filter whose impulse response
(or response to any finite length input) is of finite duration, because it settles to zero in finite
time. This is in contrast to infinite impulse response (IIR) filters, which may have internal
feedback and may continue to respond indefinitely (usually decaying).
The impulse response of an Nth-order discrete-time FIR filter (i.e., with a Kronecker delta
impulse input) lasts for N + 1 samples, and then settles to zero.
A discrete-time FIR filter of order N. The top part is an N-stage delay line with N + 1
taps. Each unit delay is a z−1 operator in the Z-transform notation. The output y of a linear
time invariant system is determined by convolving its input signal x with its impulse response
b. For a discrete-time FIR filter, the output is a weighted sum of the current and a finite number
of previous values of the input. The operation is described by the following equation, which
defines the output sequence y[n] in terms of its input sequence x[n]:
where:
are the filter coefficients, also known as tap weights, that make up the impulse
response,
is the filter order; an th-order filter has terms on the right-hand side. The
in these terms are commonly referred to as taps, based on the structure of a
tapped delay line that in many implementations or block diagrams provides the delayed
inputs to the multiplication operations. One may speak of a 5th order/6-tap filter, for
instance.
An FIR filter has a number of useful properties which sometimes make it preferable to an
infinite impulse response (IIR) filter. FIR filters:
Require no feedback. This means that any rounding errors are not compounded by
summed iterations. The same relative error occurs in each calculation. This also makes
implementation simpler.
Inherent stability. This is due to the fact that, because there is no required feedback, all
the poles are located at the origin and thus are located within the unit circle (the
required condition for stability in a Z transformed system).
Phase Issue: can easily be designed to be linear phase by making the coefficient
sequence symmetric; linear phase, or phase change proportional to frequency,
corresponds to equal delay at all frequencies. This property is sometimes desired for
phase-sensitive applications, for example data communications, crossover filters, and
mastering.
The main disadvantage of FIR filters is that considerably more computation power in a
general purpose processor is required compared to an IIR filter with similar sharpness or
selectivity, especially when low frequency (relative to the sample rate) cutoffs are needed.
However many digital signal processors provide specialized hardware features to make FIR
filters approximately as efficient as IIR for many applications.
The Z-transform of the impulse response yields the transfer function of the FIR filter
FIR filters are clearly bounded-input bounded-output (BIBO) stable, since the output is a sum
of a finite number of finite multiples of the input values, so can be no greater than
times the largest value appearing in the input.
To design a filter means to select the coefficients such that the system has specific
characteristics. The required characteristics are stated in filter specifications. Most of the time
filter specifications refer to the frequency response of the filter. There are different methods to
find the coefficients from frequency specifications:
5. Equiripple FIR filters can be designed using the FFT algorithms as well[2]. The
algorithm is iterative in nature. You simply compute the DFT of an initial filter design
that you have using the FFT algorithm (if you don't have an initial estimate you can
start with h[n]=delta[n]). In the Fourier domain or FFT domain you correct the
frequency response according to your desired specs and compute the inverse FFT. In
time-domain you retain only N of the coefficients (force the other coefficients to zero).
Compute the FFT once again. Correct the frequency response according to specs.
Software packages like MATLAB, GNU Octave, Scilab, and SciPy provide convenient
ways to apply these different methods.
Some filter specifications refer to the time-domain shape of the input signal the filter is
expected to "recognize". The optimum matched filter for separating any waveform from white
noise is obtained by sampling that shape and using those samples in reverse order as the
coefficients of the filter — giving the filter an impulse response that is the time-reverse of the
expected input signal.
A moving average filter is a very simple FIR filter. It is sometimes called a boxcar filter,
especially when followed by decimation. The filter coefficients, , are found via
the following equation:
To provide a more specific example, we select the filter order . The impulse response
of the resulting filter is:
In Fig. above, the block diagram of a 2nd-order moving-average filter is shown. The
Fig. below shows the pole-zero diagram of the filter. Zero frequency (DC) corresponds to
(1,0), positive frequencies advancing counterclockwise around the circle to (-1,0) at half the
sample frequency. Two poles are located at the origin, and two zeros are located at:
and . The frequency response, for frequency ω in radians
per sample, is:
Notch?!! N=??
In Fig. above, the magnitude and phase plots of the frequency response are depicted. Clearly,
the moving-average filter passes low frequencies with a gain near 1, and attenuates high
frequencies. This is a typical low-pass filter characteristic. Frequencies above π are aliases of
the frequencies below π, and are generally ignored or filtered out if reconstructing a
continuous-time signal. The following figure shows the phase response. Since the phase always
follows a straight line except where it has been reduced modulo π radians (should be 2π), the
linear phase property is demonstrated.
1- Direct method: use a signal generator and an oscilloscope or spectrum analyzer to measure
its gain at different individual frequencies. By using this method, it is straightforward to
identify the distinct notches in the magnitude frequency response. Then, construct a table to
assess the magnitude frequency response of the filter
The scrambling method used is commonly referred to as frequency inversion. It takes an audio
range, in this case 300 Hz to 3 kHz, and “ folds ” it about a 3.3 – kHz carrier signal. The frequency
inversion is achieved by multiplying (modulating) the audio input by a carrier signal, causing a
shift in the frequency spectrum with upper and lower sidebands. In the lower sideband that
represents the audible speech range, the low tones are high tones, and vice versa. Fig. below
demonstrates the block diagram of the scrambling scheme. At point A we have an input signal,
band limited to 3 kHz. At point B we have a double - sideband signal with suppressed carrier. At
point C the upper sideband and the section of the lower sideband between 3 and 3.3 kHz are
filtered out.