CHAPTER 4 Design of Digital Filters
Out line
4.1Introduction
4.2 Characteristics of Frequency Selective Filters.
4.3 Review of Analog Filter Approximations .
4.4 Design of FIR Filters .
4.5 Design of Linear-phase FIR Filters Using Windows .
4.6 Design of Linear Phase FIR Filters by using Frequency –
Sampling Method .
4.7 Design of Optimum Equiripple Linear- Phase FIR Filters
4.8 Design of IIR Filters .
4.8.1 IIR Filter Design by Impulse Invariance.
4.8.2 IIR Filter Design by the Bilinear.
4.10 Transformation Frequency Transformations in Digital
Domain.
4. 11 Digital Filter Realizations.
5/4/2023 CH 4 DSP @WSU 1
Design of Digital Filters
Introduction
❖ A digital filter is in fact a linear causal DSP system
with impulse response h(n) and frequency response
Where the shape of gives
the type of the filter (lowpass, high
pass,…..)(amplitude characteristics), and
gives its phase characteristics .
❖ Depending on the type of h(n), these filters are also
classified into FIR and IIR.
❖ The properties and design procedures for these two
classes are different.
5/4/2023 CH 4 DSP @WSU 2
4.2 Characteristics of Frequency Selective Filters.
Applications
Low-pass filters
❖ pass low frequencies and stop high frequencies
❖ to extract short-term average or to eliminate high-frequency fluctuations (eg. noise
filtering, demodulation, etc.)
High-pass filters:
❖ pass high frequencies and stop low frequencies
to follow small-amplitude high-frequency perturbations in presence of much larger
slowly-varying component (e.g. recording the electrocardiogram in the presence of a
strong breathing signal)
Band-pass filters:
❖ pass a range of frequencies between two ranges of stopped frequencies
❖ to select a required modulated carrier frequency out of many (e.g. radio)
Band-stop filters :
❖ stop a range of frequencies between two ranges of passed frequencies
❖ to eliminate single-frequency (e.g. mains) interference (also known as notch
filtering)
5/4/2023 CH 4 DSP @WSU 3
Co………..
5/4/2023 CH 4 DSP @WSU 4
why Filter Specifications?
5/4/2023 CH 4 DSP @WSU 5
4.3 overview Analog Filter Approximations
Analog Filter Approximations will be presented such
as
5/4/2023 CH 4 DSP @WSU 6
4.4 Design of FIR Filters .
FIR Digital Filter Design
Three commonly used approaches to FIR filter design
-
(1) Windowed Fourier series approach
(2) Frequency sampling approach
(3) Computer-based optimization methods
5/4/2023 CH 4 DSP @WSU 7
4.4.1. properties of FIR filters:
❖They are always stable --the system function contains
no poles. This is particularly useful for adaptive filters.
❖ They can have an exactly linear phase response. The
result is no frequency dispersion, which is good for
pulse and data transmission.
❖Finite length register effects are simpler to analyse and
of less consequence than for IIR filters.
❖ They are very simple to implement, and all DSP
processors have architectures that are suited to FIR
filtering.
❖For large N (many filter taps), the FFT can be used to
improve
5/4/2023 performance CH 4 DSP @WSU 8
5/4/2023 CH 4 DSP @WSU 9
Design of FIR Filters ……
The transfer function is given by
N −1
−n
H ( z ) = h(n).z
n =0
The length of Impulse Response is N
All poles are at z = 0 .
Zeros can be placed anywhere on the z-plane
5/4/2023 CH 4 DSP @WSU 10
FIR: Linear phase
Linear Phase: The impulse response is required to be
h( n) = h( N − 1 − n)
so that for N even:
N −1
2 N −1
−n −n
H ( z ) = h(n).z h(n).z
n =0 n= N
2
since h(n)=h(N-1-n), then:
N −1 N −1
2 2
= h(n).z −n h( N − 1 − n).z −( N −1−n )
n =0 n =0
N −1
5/4/2023
2
= h( n) z
n =0
−n
z
CH 4 DSP @WSU
−m
m = N − 111− n
FIR: Linear phase….
for N odd:
N −1
−1 N −1
H ( z) =
2
n =0
h( n). z − n z − m
+ h
N − 1 −
2
z
2
I) On C : z = 1 we have for N even, and +ve sign
N −1 N −1
− jT N − 1
j T
2
H (e )=e 2
. 2h(n). cos T n −
n =0 2
5/4/2023 CH 4 DSP @WSU 12
FIR: Linear phase….
III) For N odd with +ve sign
N −1
− jT N − 1
j T 2
H (e )=e h
N −3
2
2 N − 1
+ 2h(n). cos T n −
n =0 2
IV) While with a –ve sign
N −3
N −1
− j T N − 1
2
2
H ( e j T ) = e 2 j.h( n).sin T n −
n =0 2
[Notice that for the antisymmetric case to have linear phase
N − 1
we require h
= 0.
2
5/4/2023 The phase discontinuity
CH 4 DSP is as for N even]
@WSU 13
………………
The cases most commonly used in filter design are (I)
and (III), for which the amplitude characteristic can be
written as a polynomial in T
cos
2
For phase linearity the FIR transfer function
must have zeros outside the unit circle
5/4/2023 CH 4 DSP @WSU 14
Advantages in using an FIR filter -
(1) Can be designed with exact linear phase
(2) Filter structure always stable with quantised
coefficients
Disadvantages in using an FIR filter
- Order of an FIR filter is considerably higher than
that of an equivalent IIR filter meeting the same
specifications; this leads to higher computational
complexity for FIR.
5/4/2023 CH 4 DSP @WSU 15
4.5 Design of Linear-phase FIR Filters Using Windows .
❖ To reduce these sidelobes in stopband, we use what is called
windows .
❖ Several types of windows are used, but the most commonly used are
listed below:
5/4/2023 CH 4 DSP @WSU 16
Design of Linear-phase FIR Filters Using Windows .
Commonly used windows
2n N −1
Rectangular 1−
N
n
2
2n
Bartlett 1 + cos
N
Hann
Hamming 2n
0.54 + 0.46 cos
N
Blackman 2n 4n
0.42 + 0.5 cos + 0.08 cos
N N
2n
2
Kaiser J 0 1 − J 0 ( )
N − 1
5/4/2023 CH 4 DSP @WSU 17
5/4/2023 CH 4 DSP @WSU 18
5/4/2023 CH 4 DSP @WSU 19
Design of Linear-phase FIR Filters Using Windows .
find the overall impulse response h(n) with windowing
❖ h(n) = hd(n) w(n) where hd(n) depends on filter type
(LFP,HPF,BPF,BSF..)
❖ w(n) is usually chosen according to the required sidelobe level
(SLL)at stopband .
To find hd(n), then:
5/4/2023 CH 4 DSP @WSU 20
Design of Linear-phase FIR Filters Using Windows .
5/4/2023 CH 4 DSP @WSU 21
Design of Linear-phase FIR Filters Using Windows .
5/4/2023 CH 4 DSP @WSU 22
Design of Linear-phase FIR Filters Using Windows .
find N:
usually, N gives filter roll of ( how fast is the transition
from passband to stopband or how is the obtained
response is closed to ideal response).
In general: greatest odd integer
where k1 and k2 are gain values at and and k1 is
the -3dB level and k2 is usually taken as the maximum
SLL.
5/4/2023 CH 4 DSP @WSU 23
Example
Design and realize a linear phase digital lowpass filter
(LPF) having 3dB cutoff frequency of 7.5KHz. and
stopband attenuation of at least 40dB at 35KHz. Find
the difference equation and the frequency response of
this filter. Use fs = 100KHz.
Solution:
This is FIR filter since linear phase is required. Since
k2= -40dB, this gives maxi SLL from which type of
window is chosen according to previous window-type
table where Hanning window is chosen since its max.
SLL is -44dB,
Next we find N:
5/4/2023 CH 4 DSP @WSU 24
5/4/2023 CH 4 DSP @WSU 25
5/4/2023 CH 4 DSP @WSU 26
5/4/2023 CH 4 DSP @WSU 27
Example: 2
Find the impulse response of a digital linear phase bandstop
filter (BSF) having: 1- 3dB cutoff at 20Hz 1400Hz. 2-
stopband attenuation of at least 40dB at 660Hz and 750Hz.
Use fs=3KHz.
Solution
since linear phase, then this is FIR filter. For 40dB SLL, we
use Hanning window,
5/4/2023 CH 4 DSP @WSU 28
When we design a filter with two section we usually use:
5/4/2023 CH 4 DSP @WSU 29
Design of Linear Phase FIR Filters by using
Frequency –Sampling Method .
the desired frequency response is sampled at
equally-spaced points, and the result is inverse discrete
Fourier transformed.
5/4/2023 CH 4 DSP @WSU 30
❖ filter will have a frequency response that is exactly
the same as the original response at the sampling
instants.
❖ Note that it is also necessary to specify the phase
of the desired response and it is usually
chosen to be a linear function of frequency to
ensure a linear phase filter.
❖ The actual frequency response of the filter
h[n] still has to be determined.
5/4/2023 CH 4 DSP @WSU 31
Cont….
The z-transform of the impulse response is
5/4/2023 CH 4 DSP @WSU 32
Cont….
❖ This expression can be used to find the actual frequency response of
the filter obtained, which can be compared with the desired response.
❖ The method described only guarantees correct frequency response
values at the points that were sampled.
❖ This sometimes leads to excessive ripple at intermediate points.
5/4/2023 CH 4 DSP @WSU 33
Cont….
5/4/2023 CH 4 DSP @WSU 34
Cont….
5/4/2023 CH 4 DSP @WSU 35
4.7 Design of Optimum Equiripple Linear-
Phase FIR Filters
❖ This method of filter design attempts to find the
filter of length N that optimises a given design
objective.
❖ In this case the objective is chosen to be the
minimisation of
The minimisation is performed over the filter coefficients h[n]
5/4/2023 CH 4 DSP @WSU 36
Cont….
smallest possible N.
❖ The optimal (or minimax) design method therefore
yields the shortest filter that meets a required frequency
response over the entire frequency range.
❖ It is widely used in practice. Solutions to this
optimisation problem have been explored in the
literature, and many implementations of the method are
available. It turns out that when max is
minimised, the resulting filter response will have
equiripple passband and stopband, with the ripple
alternating
5/4/2023
in sign between two equal amplitude levels:
CH 4 DSP @WSU 37
Cont….
The maxima and minima are known as extrema.
For linear phase lowpass filters, for example, there are
either r + 1 or r + 2 extrema,
where r =(N + 1)/2 (for type 1 filters) or
r =N/2 (for type 2 filters).
5/4/2023 CH 4 DSP @WSU 38
Advantages & Disadvantages of FIR
Advantages in using an FIR filter -
(1) Can be designed with exact linear phase,
(2) Filter structure always stable with quantised
coefficients.
Disadvantages in using an FIR filter –
• Order of an FIR filter, in most cases, is
considerably higher than the order of an equivalent
IIR filter meeting the same specifications, and FIR
filter has thus higher computational complexity
5/4/2023 CH 4 DSP @WSU 39
4.8 Design of IIR Filters(R. A)
A digital filter can be designed by first
transforming it into a prototype analog filter and
then design this analog filter using a standard
procedure.
Once the analog filter is properly designed, it is then
mapped back to the discrete-time domain to obtain a
digital filter that meets the specifications.
5/4/2023 CH 4 DSP @WSU 40
Cont….
The commonly used analog filters are
1. Butterworth filters – no ripples at all,
2. Chebychev filters - ripples in the passband OR in
the stopband, and
3. Elliptical filters - ripples in BOTH the pass and stop
bands. The design of these filters are well documented
in the literature.
A disadvantage of IIR filters is that they usually have
nonlinear phase.
Some minor signal distortion is a result.
5/4/2023 CH 4 DSP @WSU 41
Cont….
There are two main techniques used to design IIR filters:
4.8.1. The Impulse Invariant method, and
4.8.2. The Bilinear transformation method.
5/4/2023 CH 4 DSP @WSU 42
Cont….
The Impulse Invariant Method
5/4/2023 CH 4 DSP @WSU 43
End of CHAPTER Four
IF you any suggestion?
IF you any Question?
Welcome
5/4/2023 CH 4 DSP @WSU 44