Digital Signal Processing Unit II: Digital Filters: Design and Structures
Digital Signal Processing Unit II: Digital Filters: Design and Structures
Unit II:
Digital Filters: Design and Structures
3
Module I:
DT LTI Systems as Frequency
Selective Circuits:
Digital Filters
4
Ideal Digital Filters:
An Ideal Digital Filter is a LTI system; which has frequency response
function that provides H ( ) 1 within certain band of frequencies
(pass band) and H ( ) 0 at other frequencies (stop band). Ideally
phase response is zero.
Frequency Response of Ideal Low-pass Filter:
Repeats periodically with period 2πr outside the plotted
interval
7
Concept of Filtering:
8
Solution:
11
Summary of ideal impulse response of
standard frequency selective filters
Low Pass
High Pass
Band Pass
Band Stop
15
MATLAB Prog Results: Magnitude Responses
for several M are shown in figure.
Designed for cut-off frequency: pi/4
rad/sample.
Length of unit impulse response: 2M+1
Phase response is non-zero (not shown).
16
Important implications in the design of
practical digital filters:
The frequency response cannot be zero over any finite frequency
band, except at a finite set of points in frequency.
The magnitude response cannot be constant in any finite range of
frequencies.
The transition from pass band to stop band cannot be infinitely
sharp There is always a transition band between pass band and
stop band.
Oscillatory behaviour (Ripples) in Practical frequency responses in
pass band and stop band (around cut off) is called Gibbs
Phenomenon.
The phase response is not zero. The magnitude and phase response
can’t be independently specified.
Practically we can design a filter with finite length of unit impulse
response: Finite Impulse Response (FIR) filter: Length of unit
impulse response is finite. Always have Ripples.
Practically it is also possible to design Infinite Impulse Response
(IIR) filter using feedback (recursion) to avoid ripples; but in that
case the unit impulse response will not follow the infinitely delayed
sinc function but some other practical function.
17
Paley Wiener Theorem:
19
FIR Filters:
The unit impulse response of an FIR filter has finite duration and
corresponds to having no denominator in the rational function
H(z):
There is no inherent feedback in the difference Equation
representation. This results in the reduced form:
M
y (n) bk x(n k )
k 0
Unit impulse response of causal FIR filter is given by:
h(n) bn ,0 n M M 1 taps
h(n) 0, otherwise
The FIR systems are always stable. S h n
n
2
0
Example of FIR filter: M-tap Moving
Average Filter
Causal M-tap Moving Average filter is given by difference
equation: 1
y ( n) ( x(n) x(n 1) ..... x(n ( M 1)))
M
1 M 1
M k 0
x(n k )
1
h( n) ;0 n M 1
M
1
H ( z) (1 z 1 z 2 ...... z ( M 1) )
M
H(z) contains only numerator polynomial of –ve power of z.
Have zeros located anywhere in z-plane and poles only at
origin only, no non-zero poles Always stable.
It can be implemented recursively or non-recursively.
Recursive implementation reduces hardware/ computation
required.
21
Non-Recursive implementation:
Const. Multiplier
M-1 -adders 1/
x(n) M
y(n)
Recursive implementation:
1
y (n) y (n 1) ( x(n) x(n M ))
M
2 -adders y(n)
1/
x(n) M
Const. Multiplier
-1 Z-1
Z-M
1 – M Unit delay element 22
Frequency Response of the Moving-
Average System
𝑀−1 −𝑗𝜔𝑛1
𝐻 𝜔 = 𝑒
𝑀 𝑛=0
MATLAB Plot for M=2, M=3 and M=20:
Basically a LPF; Magnitude response is not flat and contain sidelobes
that increase with M, Linear Phase response in pass band.
As M increases: BW reduces; more precise in detecting average.
magnitude plot
1 magnitude plot
1
|H(w)|
|H(w)|
0.5
0.5
0
-4 -3 -2 -1 0 1 2 3 4 0
w in radians/sample -4 -3 -2 -1 0 1 2 3 4
phase plot w in radians/sample
2 phase plot
4
<H(w)
<H(w)
1 2
0 0
-1 -2
-2 -4
-4 -3 -2 -1 0 1 2 3 4 -4 -3 -2 -1 0 1 2 3 4
w in radians/sample w in radians/sample
23
Infinite-duration impulse response (IIR)
Filter:
N M
y (n) ak y (n k ) bk x(n k )
k 1 k 0
M
Y ( z) k
b z k
H ( z) k 0
N
1 ak z k
X ( z)
k 1
x(n) y(n)
3/4 Z-1
-1/8
Z-1
Obtain governing difference equation, system transfer function, pole-zeros, stability, unit
impulse response and frequency response functions.
3 1
𝑦 𝑛 =𝑥 𝑛 + 𝑦 𝑛−1 − 𝑦(𝑛 − 2)
4 8
1 𝑧2 𝑧2
𝐻 𝑧 = 3 1 = 3 1 = 1 1
1− 𝑧 −1 + 𝑧 −2 𝑧2− 𝑧 + (𝑧− )(𝑧− )
2 4
4 8 4 8
Stable as poles inside unit circle in z-plane.
1 1
ℎ 𝑛 = (2( )𝑛 − ( )𝑛 )𝑢(𝑛) IIR
2 4
1
𝐻 𝜔 = 3 1
1− 𝑒 −𝑗𝜔 + 𝑒 −2𝑗𝜔
4 8
25
MATLAB Plot of unit impulse response
and frequency response:
26
Comparison of FIR and IIR filters:
Parameter FIR Filter IIR Filter
Length of h(n) Finite Infinite
Stability Always Stable Stable or Unstable,
Stability needs to be
investigated
Pole-zero Contains zeros located Contains zeros and poles
anywhere in z-plane, poles located anywhere in z-
only at origin plane
Implementation Recursive or Non-recursive Recursive only
Feedback Not inherent Inherent
Magnitude Contains ripples in passband Possible to have ripple
Response and stopband less passband and
stopband
Phase response Possible to have linear phase Non linear phase
response response only
Order of the filter More Less
and components
reqd. for same
27
specifications