You are on page 1of 22

International Islamic University Chittagong

Dept. of Electrical and Electronic Engineering

Segment-7
Introduction to digital Filter

EEE-3603 Digital Signal Processing

Prepared By
Mohammed Abdul kader
Assistant Professor, Dept. of EEE, IIUC
Contents
 Function of digital Filter
 Comparison of Analog and Digital Filter
 Filter kernel
 Types of filter
 Time domain and frequency domain parameters of filter.
 Design of all frequency selective filter from low pass filter kernel.

Reference Book:
The Scientist and Engineer's Guide to Digital Signal Processing, By Steven
W. Smith (2nd Edition)
Chapter-14 (Introduction to Digital Filters)
Digital Signal Processing: A practical approach, By Emmanuel C Ifeachor,
Barrie W Jervis
Chapter-5 (A framework for digital filter design)

2
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Functions of Digital Filter
 Filters have two uses: signal separation and signal restoration.
 Signal separation is needed when a signal has been contaminated with interference, noise,
or other signals. For example, imagine a device for measuring the electrical activity of a
baby's heart (EKG) while still in the womb. The raw signal will likely be corrupted by the
breathing and heartbeat of the mother. A filter might be used to separate these signals so that
they can be individually analyzed.
 Signal restoration is used when a signal has been distorted in some way. For example, an
audio recording made with poor equipment may be filtered to better represent the sound as
it actually occurred. Another example is the deblurring of an image acquired with an
improperly focused lens, or a shaky camera.

3 Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Comparison of Analog and Digital Filter
Advantages
 Digital filters can have characteristics which are not possible with analogue filters, such as a
truly linear phase response.
 Unlike analogue filters, the performance of digital filters does not vary with environment
changes, for example thermal variations. This eliminates the need to calibrate periodically.
 The frequency response of digital filter can be automatically adjusted if it is implemented
using a programmable processor, that is why they are widely used in adaptive filters.
 Several input signals or channels can be filtered by one digital filter without the need to
replicate the hardware.
 Both filtered and unfiltered data can be saved for further use.
 Advantage can be readily taken of the tremendous advantages in VLSI technology to fabricate
digital filters and to make them small in size, to consume low power, and to keep the cost
down.
4 Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Comparison of Analog and Digital Filter
 In practice, the precision achieved with analog filters is restricted; for example, typically a
maximum of only about 60 to 70 dB stop band attenuation is possible with active filters designed
with off-the-shelf components. With digital filters the precision is limited only by the word
length used.
 Digital filters, in comparison, are vastly superior in the sharp frequency response that can be
achieved. For example, a low-pass digital filter has a gain of 1 +/- 0.0002 from DC to 1000
hertz, and a gain of less than 0.0002 for frequencies above 1001 hertz. The entire transition
occurs within only 1 hertz. But we can’t except this from an analog filter, due to limitations of
the electronics, such as the accuracy and stability of the resistors and capacitors. Digital filters
can achieve thousands of times better performance than analog filters.
 Digital filter can be used at very low frequencies, found in many biomedical applications for
example, where the use of analog filters are impractical. Also, digital filters can be made to work
over a wide range of frequencies by a mere change to the sampling frequency.

5
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Comparison of Analog and Digital Filter
Disadvantages
Speed Limitation: The maximum bandwidth of signals that digital filters can handle, in real time, is
much lower than analogue filters. In real time situations, the analog-digital-analog conversion
processes introduce a speed constraint on the digital filter performance. The conversion time of the
ADC and the settling time of the DAC limit the highest frequency that can be processed. Further, the
speed of operation of a digital filter depends on the speed of digital processor used and on the number
of arithmetic operations that must be performed for the filtering algorithm, which increases as the
filter response is made tighter.
Finite word length effects: Digital filters are subject to ADC noise resulting from quantizing a
continuous signal, and to roundoff noise incurred during computation. With higher order recursive
filters, the accumulation of roundoff noise could lead to instability.
Long Design and Development Times: The design and development times for digital filters,
especially hardware development, can be much longer than analog filters.

6
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Filter Response and Filter Kernel
 Every linear filter has an impulse response, a step response and a frequency response. Each
of these responses contains complete information about the filter, but in a different form. If
one of the three is specified, the other two are fixed and can be directly calculated. All three
of these representations are important, because they describe how the filter will react under
different circumstances.
 The most straightforward way to implement a digital filter is by convolving the input signal
with the digital filter's impulse response. All possible linear filters can be made in this
manner. When the impulse response is used in this way, filter designers give it a special
name: the filter kernel.

7 Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
The step response, (b), can be found by discrete integration of the impulse response, (a). The
frequency response can be found from the impulse response by using the Fast Fourier Transform
(FFT), and can be displayed either on a linear scale, (c), or in decibels, (d).
8
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Types of Filter
Digital filters are broadly divided into two classes, namely infinite impulse response (IIR) and
finite impulse response (FIR) filters. Either type of filter in its basic form, can be represented by
its impulse response sequence h(k). The input and output signals to the filter are related by the
convolution sum, which are given below
IIR:

FIR:

It is evident from these equations that, for IIR filters, the impulse response is of infinite duration
whereas for FIR it is of finite duration, since h(k) for the FIR has only N values. In practice it is not
feasible to compute the output of the IIR filter using above equation because the length of its impulse
response is too long (infinite in theory). Instead the IIR filtering equation is expressed in a recursive
form (that’s why IIIR filter is also called recursive filter):

9
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Time Domain Parameters of Filter
The step response is used to measure how well a filter performs in the time domain. Three parameters
are important: (1) transition speed (risetime), shown in (a) and (b),
(2) overshoot, shown in (c) and (d), and
(3) phase linearity (symmetry between the top and bottom halves of the step), shown in (e) and (f).

10
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Time Domain Parameters of Filter (Cont.)

11 Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Frequency Domain Parameters of Filter
Figure shows the four basic frequency responses. The purpose of these filters is to allow some
frequencies to pass unaltered, while completely blocking other frequencies.
Pass band and Stop Band: The passband refers to those frequencies that are passed, while the
stopband contains those frequencies that are blocked. The transition band is between. A fast roll-off
means that the transition band is very narrow.
Cutoff Frequency: The division between
the passband and transition band is called the
cutoff frequency. In analog filter design, the
cutoff frequency is usually defined to be
where the amplitude is reduced to 0.707
(i.e., -3dB). Digital filters are less
standardized, and it is common to see 99%,
90%, 70.7%, and 50% amplitude levels
defined to be the cutoff frequency.
12
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Frequency Domain Parameters of Filter (Cont.)
Parameters for evaluating frequency domain performance. The frequency responses shown are for low-
pass filters. Three parameters are important:
(1) roll-off sharpness, shown in (a) and (b),
(2) passband ripple, shown in (c) and (d), and
(3) stopband attenuation, shown in (e) and (f).

13 Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Frequency Domain Parameters of Filter (Cont.)

14
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Other filter kernel from low pass filter kernel
High-pass, band-pass and band-reject filters are designed by starting with a low-pass filter, and then
converting it into the desired response. For this reason, most discussions on filter design only give
examples of low-pass filters.
There are two methods for the low-pass to high-pass conversion:
a) spectral inversion and b) spectral reversal.
Both are equally useful.
Bandpass and bandstop filters can be obtained from lowapass and highpass filter.
Low pass filter kernel

15
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Low pass to high pass conversion: spectral inversion

In (a), the input signal, x[n] , is applied to two systems in parallel. One of these systems is a low-pass
filter, with an impulse response given by h[n] . The other system does nothing to the signal (pass all
frequency), and therefore has an impulse response that is a delta function, 𝛿[n] . The overall output,
y[n] , is equal to the output of the all-pass system minus the output of the low-pass system. Since the
low frequency components are subtracted from the original signal, only the high frequency
components appear in the output. Thus, a high-pass filter is formed.
16 Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Low pass to high pass conversion: spectral inversion (cont.)
From the discussion of previous slide we can say-
Two things must be done to change the low-pass filter kernel into a high-pass filter kernel.
First, change the sign of each sample in the filter kernel.
Second, add one to the sample at the center of symmetry. 𝜹 𝒏 −𝒉 𝒏
This results in the high-pass filter kernel shown in (c), with the frequency response shown in (d) [see
the fig in next slide].
Spectral inversion flips the frequency response top-for-bottom, changing the passbands into stopbands,
and the stopbands into passbands. In other words, it changes a filter from low-pass to high-pass, high-
pass to low-pass, band-pass to band-reject, or band-reject to band-pass.
For this technique to work, the low-frequency components exiting the low-pass filter must have the
same phase as the low-frequency components exiting the all-pass system. This places two restrictions
on the method: (1) the original filter kernel must have left-right symmetry (i.e., a zero or linear
phase), and (2) the impulse must be added at the center of symmetry.

17 Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Low pass to high pass conversion: spectral inversion (Cont.)

18
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Low pass to high pass conversion: spectral reversal
The second method for low-pass to high-pass conversion, spectral reversal, is illustrated in Fig.
(next slide).
The high-pass filter kernel, is formed by changing the sign of every other sample in
low pass filter kernel.
Just as before, the low-pass filter kernel in (a) corresponds to the frequency response in (b). The high-
pass filter kernel, (c), is formed by changing the sign of every other sample in (a). As shown in (d),
this flips the frequency domain left-for-right: 0 becomes 0.5 and 0.5 becomes 0. The cutoff frequency
of the example low-pass filter is 0.15, resulting in the cutoff frequency of the high-pass filter being
0.35.
Changing the sign of every other sample is equivalent to multiplying the filter kernel by a sinusoid
with a frequency of 0.5. This has the effect of shifting the frequency domain by 0.5. Look at (b) and
imagine the negative frequencies between -0.5 and 0 that are of mirror image of the frequencies
between 0 and 0.5. The frequencies that appear in (d) are the negative frequencies from (b) shifted by
0.5.
19
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Low pass to high pass conversion: spectral reversal (Cont.)

20
Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Band-pass filter from low and high pass filter kernel

Method 1: cascading of low and


high pass filter kernel
As shown in (a), a band-pass filter can
be formed by cascading a low-pass
filter and a high-pass filter.

Method 2: Convolution of low


and high pass filter kernel
This can be reduced to a single stage,
shown in (b). The filter kernel of the
single stage is equal to the convolution
of the low-pass and high pass filter
kernels.

21 Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC
Band-reject filter from low and high pass filter kernel

Method 1: Parallel Combination of


low and high pass filter kernel
As shown in (a), a band-reject filter is
formed by the parallel combination of a
low-pass filter and a high-pass filter with
their outputs added.

Method 2: Addition of low and high


pass filter kernel
Figure (b) shows this reduced to a single
stage, with the filter kernel found by adding
the low-pass and high-pass filter kernels.

22 Lecture materials on "Introduction to Digital Filter" By- Mohammed abdul kader, Assistant Professor, EEE, IIUC

You might also like