Topic 06 Digital Filters
Topic 06 Digital Filters
s e
ea
el
R
lic
ub
rP
Fo
Lectures Schedule
s e
Lecture Topics
ea
Topic 00 Course description, evaluation and regulations
Topic 01 Introduction to DSP
el
Topic 02 DSP scheme, sampling, signal reconstruction, anti-aliasing filter, quantization
Digital sequences, LTI systems, causal systems, difference equation and impulse
R
Topic 03
responses, BIBO stability, digital convolution
Fourier series & Fourier transform, Discrete Fourier transform, Fast Fourier transform
lic
Topic 04
(decimation in time and frequency methods)
Topic 05
equation using Z-transform
ub
Z-transform, properties, convolution, inverse Z-transform
Difference equations and digital filters, Z-plane pole-zero plot stability, digital filter
rP
Topic 06
frequency response, basic filtering and realization of digital filters
Finite impulse response (FIR) filter design, Fourier transform design, window method,
Fo
Topic 07
design for customer specifications
Infinite impulse response (IIR) filter design, Bilinear transformation (BLT) design method,
Topic 08
digital Butterworth and Chebyshev filter designs
ot
Topic 09 Realization of digital filters, FIR filter realization, IIR filter realization
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 2/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Outline of Topics
e
The Difference Equations and Digital Filters
s
ea
Solution of Difference Equations Using the Z -Transform
el
Difference Equation and Transfer Function
R
System Response, Impulse Response, and Step Response
lic
2 The Z -Plane Pole-Zero Plot and Stability
3 Digital Filter Frequency Response
ub
rP
4 Filtering
Fo
IIR Filters
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 3/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
Current Section
e
The Difference Equations and Digital Filters
s
ea
Solution of Difference Equations Using the Z -Transform
el
Difference Equation and Transfer Function
R
System Response, Impulse Response, and Step Response
lic
2 The Z -Plane Pole-Zero Plot and Stability
3 Digital Filter Frequency Response
ub
rP
4 Filtering
Fo
IIR Filters
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 4/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
The Difference Equation and Digital Filter
s e
ea
The relationship between the input and the output of a DSP
el
system can be expressed by the following difference equation:
R
lic
y (n) =b0 x(n) + b1 x(n − 1) + · · · + bM x(n − M)
ub
− a1 y (n − 1) − · · · − aN y (n − N)
rP
where bi , 0 ≤ i ≤ M, and aj , 1 ≤ j ≤ N, represent the
coefficients of the system and n is the time index
Fo
M
X N
X
ot
→ y (n) = bi x(n − i) − aj y (n − j)
N
i=0 j=1
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 5/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
Example 1
s e
ea
Given the following system difference equation:
el
R
y (n) = 0.5y (n − 2) + x(n − 1)
lic
compute the first four samples using:
ub
initial conditions: y (−2) = 1, y (−1) = 0, x(−1) = −1
rP
input x(n) = (0.5)n u(n)
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 6/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
Solution of Difference Equations Using the Z -Transform
To solve a DE with initial conditions, we have to deal with
e
time-shifted sequences y (n − 1), y (n − 2) · · · y (n − m)
s
∞
ea
X
Z (y (n − 1)) = y (n − 1)z −n = y (−1) + z −1 Y (z)
el
n=0
R
∞
X
Z (y (n − 2)) = y (n − 2)z −n = y (−2) + y (−1)z −1 + z −2 Y (z)
lic
n=0
ub
Z (y (n − m)) = y (−m) + y (−m + 1)z −1 + · · · + y (−1)z −(m−1)
rP
+ z −m Y (z)
Fo
theorem
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 7/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
Solution of Difference Equations Using the Z -Transform
s e
ea
The procedure is as follows
el
1 Apply the Z -transform to the difference equation
R
2 Substitute the initial conditions
lic
3 Solve for the difference equation in the Z -transform domain
4
ub
Find the solution in the time domain by applying the inverse
rP
Z -transform
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 8/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
Examples
1 A digital signal processing (DSP) system is described by the
e
difference equation
s
ea
y (n) − 0.5y (n − 1) = 5(0.2)n u(n)
el
Determine the solution when the initial condition is given by
R
y (−1) = 1
lic
2 A relaxed (zero initial conditions) DSP system is described by
a difference equation: ub
y (n) + 0.1y (n − 1) − 0.2y (n − 2) = x(n) + x(n − 1)
rP
Fo
Difference Equation and Transfer Function
Taking again the basic system equation:
s e
y (n) =b0 x(n) + b1 x(n − 1) + · · · + bM x(n − M)
ea
− a1 y (n − 1) − · · · − aN y (n − N)
el
R
Assuming all initial conditions are zero:
lic
Y (z) =b0 X (z) + b1 X (z)z −1 + · · · + bM X (z)z −M
ub
− a1 Y (z)z −1 − · · · − aN Y (z)z −N
rP
Rearranging, we obtain:
Fo
Y (z) b0 + b1 z −1 + · · · + bM z −M B(z)
ot
H(z) = = −1 −N
=
X (z) 1 + a1 z + · · · + aN z A(z)
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 10/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
Difference Equation and Transfer Function
Hence, the Z -transfer function is defined as:
s e
Z -transform of the output
ea
ratio =
Z -transform of the input
el
R
lic
ub
The transfer function H(z) can be factored into pole-zero
rP
form:
b0 (z − z1 )(z − z2 ) · · · (z − zM )
Fo
H(z) =
(z − p1 )(z − p2 ) · · · (z − pN )
ot
Example 2
1 A DSP system is described by the following difference
e
equation
s
ea
y (n) = x(n) − x(n − 2) − 1.3y (n − 1) − 0.36y (n − 2)
el
Find the transfer function H(z), the denominator polynomial
R
A(z), and the numerator polynomial B(z) (zero initial cond.)
lic
2 Convert the following transfer function into its difference eq.:
ub z2 − 1
H(z) =
rP
z 2 + 1.3z + 0.36
Fo
1 − z −2
H(z) =
N
1 + 1.3z −1 + 0.36z −2
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 12/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
System Response, Impulse Response, and Step Response
e
1
s
obtained by using the z-transform of H(z) & X (z) to get the
ea
inverse z-transform of the output Y (z):
el
Y (z) = H(z)X (z)
R
→y (n) = Z −1 {Y (z)}
lic
2 ub
Impulse Response h(n) of the DSP system H(z):
obtained by solving its difference equation using a unit impulse
rP
input δ(n)
Fo
X (z) = Z {δ(n)} = 1
→h(n) = Z −1 {H(z)X (z)} = Z −1 {H(z)}
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 13/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
System Response, Impulse Response, and Step Response
s e
ea
3 Step Response y (n) of the DSP system H(z):
el
obtained by solving its difference equation using a step input,
R
assuming zero initial conditions
z
lic
X (z) = Z {u(n)} =
ub z − 1
z
→y (n) = Z −1 H(z)
rP
z −1
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 14/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
Example 3
s e
ea
Given the following transfer function of a DSP system,
el
determine:
z +1
R
H(z) =
z − 0.5
lic
1 the impulse response h(n) ub
the step response y (n)
rP
2
3 the system response y (n) if the input x(n) = (0.25)n u(n)
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 15/43
The Difference Equations and Digital Filters The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability Solution of Difference Equations Using the Z -Transform
Digital Filter Frequency Response Difference Equation and Transfer Function
Filtering System Response, Impulse Response, and Step Response
Example 3
s e
ea
el
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 16/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Current Section
e
The Difference Equations and Digital Filters
s
ea
Solution of Difference Equations Using the Z -Transform
el
Difference Equation and Transfer Function
R
System Response, Impulse Response, and Step Response
lic
2 The Z -Plane Pole-Zero Plot and Stability
3 Digital Filter Frequency Response
ub
rP
4 Filtering
Fo
IIR Filters
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 17/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
The z-Plane Pole-Zero Plot and Stability
A very useful tool to analyze digital systems is the z-plane
e
pole-zero plot, using the pole-zero form:
s
ea
b0 (z − z1 )(z − z2 ) · · · (z − zM )
H(z) =
el
(z − p1 )(z − p2 ) · · · (z − pN )
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 18/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
The z-Plane Pole-Zero Plot and Stability
The relationship of the sampled system in the Laplace domain
e
and its digital system in the Z -transform domain by the
s
following mapping:
ea
z = e sT
el
with s = −α ± jω and T is the sampling period
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 19/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
The Rules for determining the stability of a DSP system
1 If the outmost pole(s) of the Z -transfer function H(z)
e
describing the DSP system is (are) inside the unit circle on
s
the Z -plane pole-zero plot, then the system is stable
ea
2 If the outmost pole(s) of the Z -transfer function H(z) is (are)
el
outside the unit circle on the Z -plane pole-zero plot, the
R
system is unstable
lic
3 If the outmost pole(s) is (are) first-order pole(s) of the
ub
Z -transfer function H(z) and on the unit circle on the
rP
Z -plane pole-zero plot, then the system is marginally stable
If the outmost pole(s) is (are) multiple-order pole(s) of the
Fo
The z-Plane Pole-Zero Plot and Stability
s e
In a bounded-in/bounded-out (BIBO) system:
ea
1 If the input to the system is bounded, then the output of the
el
system will also be bounded, or the impulse response of the
R
system will go to zero in a finite number of steps
lic
2 An unstable system is one where the output of the system will
grow without bound due to any bounded input, initial
ub
condition, or noise, or the impulse response will grow without
rP
bound
3 The impulse response of a marginally stable system stays at a
Fo
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 21/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Stability Illustrations
s e
ea
el
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 22/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Stability Illustrations
s e
ea
el
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 23/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Example 4
s e
ea
z + 0.5
(a) H(z) =
(z − 5)(z 2 + z + 0.5)
el
z 2 + 0.25
R
(b) H(z) =
(z − 0.5)(z 2 + 3z + 2.5)
lic
z + 0.5
(c) H(z) =
(z − 0.5)(z 2 + 1.4141z + 1)
ub
rP
z 2 + z + 0.5
(d) H(z) =
Fo
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 24/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Current Section
e
The Difference Equations and Digital Filters
s
ea
Solution of Difference Equations Using the Z -Transform
el
Difference Equation and Transfer Function
R
System Response, Impulse Response, and Step Response
lic
2 The Z -Plane Pole-Zero Plot and Stability
3 Digital Filter Frequency Response
ub
rP
4 Filtering
Fo
IIR Filters
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 25/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Digital Filter Frequency Response
In Laplace:
s e
H(s)|s=jω = H(ω) = |H(jω)|∠H(jω)
ea
el
In DSP system:
R
1 This is done by substituting z = e sT |s=jΩ = e jΩT into the
z-transfer function H(z) to acquire the digital frequency
lic
response where Ω is the normalized frequency = ωT :
ub
H(e jΩ ) = H(z)|z=e jΩ = |H(e jΩ )|∠H(e jΩ )
rP
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 26/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Digital Filter Frequency Response
s e
ea
The frequency response has the following property
1 Periodicity
el
Frequency response: H(e jΩ ) = H(e j(Ω+k2π) ) with
R
k = 0, ±1, ±2, · · ·
lic
Magnitude frequency response: |H(e jΩ )| = |H(e j(Ω+k2π) )|
Phase response: ∠H(e jΩ ) = ∠H(e j(Ω+k2π) )
2 Symmetry:
ub
rP
Magnitude frequency response: |H(e −jΩ )| = |H(e jΩ )|
Phase response ∠H(e −jΩ ) = −∠H(e jΩ )
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 27/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Digital Filter Frequency Response
e
The maximum frequency in a DSP system is the folding
s
ea
frequency, fs /2, where fs = 1/T , and T designates the
el
sampling period
R
The corresponding maximum normalized frequency
lic
fs
Ω = ωT = 2π ub × T = π radians
2
rP
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 28/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Digital Filter Frequency Response
s e
Hence, H(e jΩ ) needs only to be evaluated for the positive
ea
normalized frequency range from Ω = 0, to Ω = π radians
el
The frequency in Hz can be determined by
R
Ω
lic
f = fs
ub 2π
The magnitude frequency response is often expressed in
rP
decibels:
Fo
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 29/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Example 5
s e
ea
el
Given the following digital system with a sampling rate of
R
8,000 Hz, determine the frequency response
lic
y (n) = 0.5x(n) + 0.5x(n − 1)
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 30/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Example 5
s e
ea
el
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 31/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Example 5
s e
ea
el
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 32/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Example 5
s e
ea
el
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 33/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Example 5
s e
We can verify the periodicity for |H(e jΩ )| and ∠H(e jΩ ) when
ea
Ω = 0.25 + 2π
el
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 34/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Example 5
s e
ea
We can also verify the symmetry property for Ω = −0.25π
el
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 35/43
The Difference Equations and Digital Filters
The Z -Plane Pole-Zero Plot and Stability
Digital Filter Frequency Response
Filtering
Example 5
Taking the frequency range from Ω = −2π to Ω = 4π
s e
ea
el
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 36/43
The Difference Equations and Digital Filters
Basic Types of Filtering
The Z -Plane Pole-Zero Plot and Stability
FIR Filters
Digital Filter Frequency Response
IIR Filters
Filtering
Current Section
e
The Difference Equations and Digital Filters
s
ea
Solution of Difference Equations Using the Z -Transform
el
Difference Equation and Transfer Function
R
System Response, Impulse Response, and Step Response
lic
2 The Z -Plane Pole-Zero Plot and Stability
3 Digital Filter Frequency Response
ub
rP
4 Filtering
Fo
IIR Filters
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 37/43
The Difference Equations and Digital Filters
Basic Types of Filtering
The Z -Plane Pole-Zero Plot and Stability
FIR Filters
Digital Filter Frequency Response
IIR Filters
Filtering
Basic Types of Filtering
s e
ea
el
R
lic
ub
rP
Fo
ot
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 38/43
The Difference Equations and Digital Filters
Basic Types of Filtering
The Z -Plane Pole-Zero Plot and Stability
FIR Filters
Digital Filter Frequency Response
IIR Filters
Filtering
Basic Types of Filtering
s e
ea
el
R
lic
ub
rP
Fo
ot
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 39/43
The Difference Equations and Digital Filters
Basic Types of Filtering
The Z -Plane Pole-Zero Plot and Stability
FIR Filters
Digital Filter Frequency Response
IIR Filters
Filtering
Basic Types of Filtering
s e
ea
el
R
lic
ub
rP
Fo
ot
N
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 40/43
The Difference Equations and Digital Filters
Basic Types of Filtering
The Z -Plane Pole-Zero Plot and Stability
FIR Filters
Digital Filter Frequency Response
IIR Filters
Filtering
Basic Types of Filtering
s e
ea
el
R
lic
ub
rP
Fo
ot
N
FIR Filters
M N
e
X X
y (n) = bi x(n − i) − aj y (n − j)
s
ea
i=0 j=1
el
1
R
M
X
→ y (n) = bi x(n − i)
lic
i=0
ub
= b0 x(n) + b1 x(n − 1) + · · · + bM x(n − M)
rP
systems, with:
N
IIR Filters
2 if not all ai are zeros, the impulse response h(n) would consist
e
of an infinite number of coefficients
s
ea
M
X N
X
y (n) = bi x(n − i) − aj y (n − j)
el
R
i=0 j=1
lic
− a1 y (n − 1) − · · · − aN y (n − N)
ub
rP
⇒ such systems are called infinite impulse response (IIR)
systems, with:
Fo
B(z)
ot
Dr. Hilal M. El Misilmani Topic 06: DSP Systems and Digital Filters 43/43