digital filters (1)
digital filters (1)
as
Frequency-Selective Filters
Filter Design Flow
The issue of which type of filter to design, FIR or IIR, depends on the
nature of the problem and on the specifications of the desired frequency
response.
• In general, a linear time-invariant system modifies the input signal
spectrum X(ω) according to its frequency response H(ω) to yield an
output signal with spectrum
Y(ω) = H(ω)X(ω)
• H(ω) act as a spectral shaping function to the different frequency
components in the input signal
• Any linear time-invariant system can be considered to be a frequency-
shaping filter
• Consequently , the terms “ linear time-invariant system ” and “filter”
are synonymous and are often used interchangeably
The term filter is used to describe a linear time-invariant system that
perform spectral shaping or frequency-selective filtering
• Filtering is used in digital signal processing in a variety of ways,
➢removal of undesirable noise from desired signals,
➢spectral shaping such as equalization of communication channels,
➢signal detection in radar, sonar, and communications,
➢spectral analysis of signals
• Filters are usually classified according to their frequency-domain
characteristics as
➢Low pass
➢Highpass
➢Bandpass
➢Band stop or band -elimination filters.
Ideal filters have a constant-gain (usually taken as unity-gain) passband
characteristic and zero gain in their stopband.
The ideal magnitude response characteristics of these types of filters are
illustrated in Fig
• Ideal filters have
➢a constant-gain passband characteristic
➢zero gain in their stopband
Ideal filters have a constant-gain (usually taken as
unity-gain) passband characteristic and zero gain in
their stopband.
Another characteristic of an ideal filter
is a linear phase response
Assume that a signal sequence x(n) with frequency components confined to the frequency
range ω1 < ω < ω2 is passed through a filter with frequency response, where C and α are
constants
14
𝐻(𝑒 𝑗ω ) 𝑖𝑠 𝑡ℎ𝑒 𝑚𝑎𝑔𝑛𝑖𝑡𝑢𝑑𝑒 𝑟𝑒𝑠𝑝𝑜𝑛𝑠𝑒 𝑜𝑓 𝑡ℎ𝑒 𝑓𝑖𝑙𝑡𝑒𝑟 𝑎𝑛𝑑 Θ(ω) is phase response
15
Separating the real and imaginary part and taking the ratio is given below,
16
Solving the above equation gives,
17
eg. For N =7 (odd) and N = 6 (even)
FIR filter has linear phase if its unit impulse response satisfies the condition
h(n) = ±ℎ(𝑁 − 1 − 𝑛)
18
Frequency response of Linear phase FIR filters
19
For symmetrical impulse response, h(n) = h(N-1-n), Substituting this relation to the above equation, 20
21
Generalized frequency response Expression for N odd and N even
(Symmetric impulse response)
22
Design of FIR filters using Windows
23
Filter Design by Windowing
• Simplest way of designing FIR filters
• Start with ideal frequency response
( ) h ne
Hd e j =
d
− jn hd n =
1
2 −
Hd( )
e j
e jn
d
n = −
24
• Possible way to obtain a causal FIR filter from ideal is
hd n 0 n N
hn =
0 else
25
• After multiplying with the window function, we get a finite duration
sequence h(n)
26
Fourier transform of window function W(ω) (Rectangular window)
27
Fourier transform of w[n], W(ω)
28
29
The width of the main lobe is 4π/N
(𝐶ℎ𝑎𝑟𝑎𝑐𝑡𝑒𝑟𝑖𝑠𝑡𝑖𝑐𝑠 𝑜𝑓 𝑠𝑦𝑛𝑐 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 (W(ω))
• Specifically, the convolution of Hd(ω) with W(ω) has the effect of smoothing
• On the other hand, the large sidelobes of W(ω) result in some undesirable ringing effects in the FIR filter
frequency response H(ω) and also in relatively larger sidelobes in H(ω)
N=M
30
Rectangular window spectrum for N=25 samples
31
Frequency response of Low pass filter at N=25
32
Rectangular window spectrum for N=51 samples
33
Undesirable ringing effect in FIR filter frequency response – Rectangular
window, How it is overcome?
34
Triangular Window
Triangular window : frequency domain
35
Frequency response of Low pass filter using triangular window at N=25
36
Frequency response of Low pass filter using triangular window at N = 51
37
Hanning Window
Hanning window - time
domain
Hanning window -
frequency domain - N=25
38
Hanning window -
frequency domain – N=51
39
Hamming window
40
Hamming window: Frequency domain
41
Frequency response of LPF using Hamming window
42
Other window functions
43
Exercise
44
45
46
Other window functions
(Mathematical expressions)
47
48
• The above filter designed has to be linear phase also.
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Assignment
• Digital Differentiator
• Hilbert Transformer
• Real life applications of Signal Processing (Minimum 2 Scenarios)
69
IIR Filter Design
• In the design of frequency-selective filters, the desired filter
characteristics are specified in the frequency domain in terms of the
desired magnitude and phase response of the filter.
• In the filter design process, we determine the coefficients of a causal
FIR or IIR filter that closely approximates the desired frequency
response specifications.
• The issue of which type of filter to design, FIR or IIR, depends on
the nature of the problem and on the specifications of the desired
frequency response.
70
• In practice, FIR filters are employed in filtering problems where there is a
requirement for a linear-phase characteristic within the passband of the filter.
• If there is no requirement for a linear-phase characteristic, either an IIR or an FIR
filter may be employed. However, as a general rule, an IIR filter has lower
sidelobes in the stopband than an FIR filter having the same number of
parameters.
71
• Digital IIR filter design - based on converting an analog filter into a
digital filter
• Analog filter design is a mature and well developed field
• Begin the design of a digital filter in the analog domain and then
convert the design into the digital domain.
72
• An analog filter can be described by its system function.
73
• Analog linear time invariant system is stable if all its poles lie in the
left half of s plane
74
Keywords:
ROC -
Region of Convergence
Re(s) = σ
Im(s) = Ω
75
76
77
Keywords:
ROC -
Region of Convergence,
Unit Circle
78
79
80
81
Design of Digital filters from Analog filters
• For the given specifications of a digital filter,
➢Map the desired digital filter specifications into those for an analog
filter
➢Derive the analog transfer function for the analog protype
➢Transform the transfer function of the analog prototype into an
equivalent digital filter transfer function
➢ Transformation methods:
• Bilinear transformation
• Impulse Invariant Transformation
82
Magnitude response of LPF: Digital filter
83
Analog Lowpass filter design
An analog filter can be described by its system function
For a stable analog filter, the poles of H(s) lie in the left half of s- plane
Two types of Analog filter design:
Butterworth filter
Chebyshev filter
84
• Butterworth filter • N is the order of the filter
• is the cut off frequency
• Maximum response at frequency = 0
• Ideal response shown in dash line
• Magnitude response approaches ideal
as N increases
• For frequency less than cut off
frequency, magnitude approximately
equal to 1
• At frequency = cut off frequency, the
curve passes 0.707 or -3dB
85
Low pass Butterworth magnitude response
86
• Magnitude squared function of Normalized Butterworth filter (Cutoff
frequency = 1 rad/sec)
87
Implications
• Poles lies in both left half and right half of s plane (H(s) & H(-s))
• If H(s) has roots in one half implies H(-s) in other half of s plane
• Obtain the roots by equating the denominator to zero
• N odd,
• the roots as shown
• N even,
• the roots as shown
88
• N =3, implies
Pole locations in the s plane To ensure stability, only left half poles is
considered.
89
• N=3;
• To ensure stability, only left half poles is considered.
• So, the transfer function of third order Butterworth filter for unity cut
off frequency 1 rad/sec is ,
• i.e.,
90
List of Butterworth polynomials
91
• How to determine the order, given the filter specifcations
92
• Similarly, considering stopband attenuation,
After simplification,
93
• Order of filter
Where
94
• Cut off frequency
Eqn. (1)
Eqn. (2)
96
therefore, N = 4
=
99
Impulse Invariant Transformation
• IIR digital filter is designed such that unit impulse response h(n) of
digital filter is the sampled version of analog filter.
• Let H (s) is the system function (Transfer function) of analog filter.
100
Sample this analog signal at t = nT, where T is the sampling perio
101
Steps to design a filter using Impulse
Invariant method
102
Impulse Invariant
Transformation
103
Impulse Invariant Transformation (Underlying
mapping function)
• The mapping is characterized by
• Implies, and
104
Pole on jΩ axis (σ= 0)
105
Pole in the left half of s-plane (σ <0)
106
Pole in the right half of s-plane (σ >0)
107
Disadvantages of Impulse Invariant
108
S1 pole
109
Transform H(s) to H(z) To remember
110
Bi-Linear Transformation
111
112
113
114
Relation between analog and discrete frequency in Bi-linear Transformation
115
For low frequencies, relationship between analog and discrete
frequencies are linear
For high frequencies, relationship between analog and discrete
frequencies become non linear, due to this distortion is
introduced in the frequency scale of digital filter – WARPING 116
EFFECT
The warping effect can be eliminated by pre-warping the analog filter
-
117
Steps to design using Bilinear transformation
• From the given specifications, find the prewarped frequencies
• Using the analog frequencies, find H(s) of the analog filter
• Select the sampling rate T
• Substitute,
118
Design a digital Butterworth filter with T = 1 sec
(sampling period) using Bilinear transformation
119
120
121