Download as pdf or txt
Download as pdf or txt
You are on page 1of 86

Digital Signal Processing

YCJ
1
A Typical DSP System
Sampling
&
A/D
Analog
Pre-filter
H
PRE
(f)
x(t) x[n] x
a
(t)
Analog
in
DSP
Filter
H
DSP
(z)
Analog
out
Analog
Post-filter
H
POST
(f)
D/A
Converter
H
DAC
(f)
y
a
(t) y(t)
y[n]
Digital Signal Processing
YCJ
2
Analog Signal Processing
x
a
(t) : an analog signal
X
a
() = x
a
(t)e
-jt
dt is its Fourier transform
The inverse Fourier transform is
x
a
(t) = (1/2) X
a
() e
jt
d
Digital Signal Processing
YCJ
3
Analog Signal Processing
Analog
Filter
H
a
()
y
a
(t)
x
a
(t)
H
a
() is the Fourier transform of the
impulse response, h
a
(t), of the filter
y
a
(t) = h
a
(t-) x
a
() d
OR, equivalently, in frequency domain
Y
a
() = H
a
() X
a
()
Digital Signal Processing
YCJ
4
A Typical DSP System A Typical DSP System
Analog
Pre-filter
H
PRE
(f)
Sampling
&
A/D
DSP
Filter
H
DSP
(z)
D/A
Converter
H
DAC
(f)
Analog
Post-filter
H
POST
(f)
x
a
(t) x(t)
x[n]
y
a
(t)
y(t) y[n]
Digital Signal Processing
YCJ
5
A digital Spectral Analyzer
Analog
Pre-filter
H
PRE
(f)
Sampling
&
A/D
FFT
Processor
Display
the
Spectrum
x
a
(t) x(t)
Digital Signal Processing
YCJ
6
Linear Time-Invariant Systems
The delta function: (t)
Linearity
Time-invariant
The Impulse Response
The Convolution Integral
The Convolution Theorem
Digital Signal Processing
YCJ
7
Sinusoidal Response of LTI System
e
jt
H
a
() e
jt
H
a
()
H
a
() = |H
a
()| e
jARG{H
a
()}
H
a
(
1
) A
1
e
j
1
t
+ H
a
(
2
) A
2
e
j
2
t
A
1
e
j
1
t
+A
2
e
j
2
t
H
a
()
Digital Signal Processing
YCJ
8
Linear Filtering
X
a
()
=2f
Y
a
()
=2f
Digital Signal Processing
YCJ
9
Sampling a Signal
x[n] = x(nT)
x(t)
T = 1/f
s
T: sampling period, (second)
f
s
: sampling frequency (sample/second)
x(t) x[n]
t n
0 1 2 3 4
Digital Signal Processing
YCJ
10
Discrete-Time Fourier Tranform (DTFT)
X() =
n
x[n] e
-jn
X() is a continuous function of
X() is periodic on with the period 2
-4
-2 0 2 4
X()

Digital Signal Processing


YCJ
11
Fourier Transform and The DTFT
If X
a
() = x
a
(t)e
-jt
dt and x[n] = x
a
(nT)
Then X() = (1/T)
k
X
a
( - k2/T)
-4f
s
-2f
s
0 2f
s
4f
s
1/T
0
X
a
()

X()

Digital Signal Processing


YCJ
12
Aliasing

-4f
s
-2f
s
0 2f
s
4f
s
X()
0
-4f
s
-2f
s
2f
s
4f
s

Digital Signal Processing
YCJ
13
Aliasing
Cos( t) = (e
jt
+ e
-jt
)
-4f
s
-2f
s
0 2f
s
4f
s

-4f
s
-2f
s
0 2f
s
4f
s

Digital Signal Processing
YCJ
14
Aliasing
0 10 20 30 40 50 60 70 80 90 100
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Digital Signal Processing
YCJ
15
Anti-Aliasing Filter
A(f)
f
f
pass
f
s
/2 f
stop
Attenuation A(f) = -20 log {|H(f)/H(0)|}
dB per Octave or dB per Decade
A single-pole filter has 6 dB/Oct. or 20 dB/Dec.
Digital Signal Processing
YCJ
16
DAC & Analog Reconstruction
D/A
Converter
H
DAC
(f)
y[n] y
a
(t)
y
a
(t) =
n
y[n] h
DAC
(t-nT)
Y
a
() = Y() |
=
H
DAC
()
Digital Signal Processing
YCJ
17
Staircase Reconstructor
-100 -80 -60 -40 -20 0 20 40 60 80 100
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
h(t)
1
T/2 -T/2
f = 1/T = f
s
1, -T/2 t T/2
0, otherwise
h(t) = u(t) - u(t-T) = {
H(f) = (T/j) [Sin(fT)/(fT)]
t
f
Digital Signal Processing
YCJ
18
Staircase Reconstructor
-100 -80 -60 -40 -20 0 20 40 60 80 100
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
f
s
-f
s
Digital Signal Processing
YCJ
19
Anti-Image Post Filter
-100 -80 -60 -40 -20 0 20 40 60 80 100
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
f
s
/2
f
-f
s
/2
Removing high frequency images
Equalizing D/A converters in-band distortion
(may be done digitally)
-20 log[H(f
s
/2)/H(0)] ~ 3.9 dB
Digital Signal Processing
YCJ
20
Ideal Reconstructor
T
H(f)
f
-f
s
/2 f
s
/2
-100 -80 -60 -40 -20 0 20 40 60 80 100
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
h(t) = Sin(t/T)/(t/T)
t
T 2T
Digital Signal Processing
YCJ
21
A/D Converter & Quantization
R
:

f
u
l
l

s
c
a
l
e
R/2
3Q
2Q
Q
0
-Q
-2Q
-3Q
-R/2
R/Q = 2
B
Q: step size
Digital Signal Processing
YCJ
22
Quantization Noise Power
P(e)
1/Q
e
-Q/2 Q/2
E(e
2
) = (1/Q) e
2
de = Q
2
/12
or
e
rms
= Q/12
1/2
Digital Signal Processing
YCJ
23
Signal to Noise Ratio: SNR
Noise Power = Q
2
/12
Signal Power = ?
Assuming Sine Wave -> Signal Power = A
2
/2
Assuming Full Scale -> A = R/2 -> Signal Power = R
2
/8
Assuming B bits -> Q = R/2
B
Signal to Noise Power Ration = (R
2
/8) / (Q
2
/12)
SNR (dB) = 10 log(2
2B
) + 10log(12/8)
= 6.02*B + 1.76 dB
Digital Signal Processing
YCJ
24
Discrete Time Systems
{x[0], x[1], x[2], } {y[0], y[1], y[2], }
H
Example: y[n] = 2x[n] + 3x[n-1] + 4x[n-2]
Sample by Sample Processing
Block Processing
Digital Signal Processing
YCJ
25
Sample by Sample Processing
y[n] = 2x[n] + 3x[n-1] + 4x[n-2]
y[n] = 2x[n] + 3w
1
[n] + 4w
2
[n]
w
2
[n+1] = w
1
[n]
w
1
[n+1] = x[n]
For each new input x
DO y = 2x + 3w
1
+ 4w
2
w
2
= w
1
w
1
= x
CONTINUE
Digital Signal Processing
YCJ
26
Block Processing
y[n] = 2x[n] + 3x[n-1] + 4x[n-2]
y[0] 2 0 0 0 0
y[1] 3 2 0 0 0 x[0]
y[2] 4 3 2 0 0 x[1]
y[3] = 0 4 3 2 0 x[2]
y[4] 0 0 4 3 2 x[3]
y[5] 0 0 0 4 3 x[4]
y[6] 0 0 0 0 4
Digital Signal Processing
YCJ
27
Overlap and Add
0, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19,
Digital Signal Processing
YCJ
28
FIR and IIR Systems
FIR: Finite Impulse Response -- non-recursive
y[n] = 2x[n] + 3x[n-1] + 4x[n-2]
IIR: Infinite Impulse Response -- recursive
y[n] = 0.5y[n-1] + 2x[n] + 3x[n-1]
Digital Signal Processing
YCJ
29
Sample by Sample Processing
y[n] = 0.5y[n-1] + 2x[n] + 3x[n-1]
y[n] = 0.5w[n] + 3x[n] + 4v[n]
w[n+1] = y[n]
v[n+1] = x[n]
For each new input x
DO y = 0.5w + 2x + 3v
w= y
v = x
CONTINUE
Digital Signal Processing
YCJ
30
Linearity
a
1
y[n] = a
1
y
1
[n]+ a
2
y
2
[n]
+
a
2
x
1
[n]
x[n]
x
2
[n]
y[n]
H
a
1
+
a
2
x
1
[n]
x
2
[n]
H
y
1
[n]
a
1
y
1
[n]+ a
2
y
2
[n]
H
y
2
[n]
Digital Signal Processing
YCJ
31
Time-Invariance
x[n] y[n]
y
D
[n] = y[n-D]
H D y[n-D]
x[n]
D
x
D
[n]
H y
D
[n]
x[n-D]
Digital Signal Processing
YCJ
32
Impulse Response of an LTI System
[n] = 1, for n=0, and 0, otherwise
h[n]
[n]
H
n
n
For any input x[n], the output y[n] is given by
y[n] =
m
x[m]h[n-m]
=
m
h[m]x[n-m] (direct form)
Digital Signal Processing
YCJ
33
Convolution
h[n]
[n]
H
n
n
h[n-1]
[n-1]
H
n
n
h[n-2]
[n-2]
H
n
n
x[n] = x[0][n] + x[1][n-1] + x[2][n-2] +
y[n] = x[0]h[n] + x[1]h[n-1] + x[2]h[n-2] +
Digital Signal Processing
YCJ
34
FIR and IIR Filters
An FIR filter has impulse response, h[n], that extends only over a
finite time interval, say 0 n M, and is identically zero beyond that:
{h[0], h[1], h[2], h[M], 0,0,0,0,0,0..}
M is the filter order, and the length of the filter impulse response is M+1.
An IIR filter, on the other hand, has impulse response, h[n], of infinite
duration, 0 n , and is identically zero beyond that:
{h[0], h[1], h[2], h[M], h[M+1], ..}
The convolution sum is not computationally feasible, hence it is normally
represented by a constant-coefficient linear difference equation.
Digital Signal Processing
YCJ
35
I/O Difference Equation
Impulse Response: h[n]
FIR filter: convolution sum
IIR Filter: difference equation
y[n] = ay[n-1] + x[n]
h[n] = a
n
u[n]
Digital Signal Processing
YCJ
36
Causality and Stability
A causal sequence is a right-sided sequence, and an anti-causal
sequence is a left-sided sequence. A two-sided sequence is mixed.
An LTI system is causal if its impulse response, h[n], is causal.
An LTI system is stable if for any bounded input sequence,
the output sequence is also bounded.
An LTI system is stable if and only if its impulse response
is absolutely summable, i.e.,

n
|h[n]| <
Digital Signal Processing
YCJ
37
Linear Convolution: Flip & Slide
y[n] =
m
x[m]h[n-m]
If h is of order M, i.e., h = {h[0], h[1], , h[M]} is of length M+1
and x = {x[0], x[1], ,x[L-1]} is of length L, then
y[n] =
m=max(0,n-M)
min(n,L-1)
x[m]h[n-m]
and y = {y[0], y[1], ,y[L+M]} is of length (L+M)
Digital Signal Processing
YCJ
38
Linear Convolution: Flip & Slide
h
3
h
2
h
1
h
0
h
3
h
2
h
1
h
0
h
3
h
2
h
1
h
0
0 0 0 x
0
x
1
x
2
x
3
x
n-3
x
n-2
x
n-1
x
n
x
L-1
0 0 0
y
0
y
n
y
L-1+M
h = M+1
x = L
y = h*x = L M
Digital Signal Processing
YCJ
39
Transient & Steady State
y[n] =
m=0
n
h[m]x[n-m] if 0 n < M
y[n] =
m=0
M
h[m]x[n-m] if M n L-1
y[n] =
m=n-L+1
M
h[m]x[n-m] if L n < L+M
output y[n]
n
0 M L-1 L-1+M
Digital Signal Processing
YCJ
40
Convolution of Infinite Sequence
y[n] =
m=max(0,nL+1)
min(n,M)
h[m]x[n-m]
Infinite filter, finite input: M = , L <
y[n] =
m=max(0,nL+1)
n
h[m]x[n-m]
Finite filter, infinite input: M < , L =
y[n] =
m=0
min(n,M)
h[m]x[n-m]
Infinite filter, infinite input: M = , L =
y[n] =
m=0
n
h[m]x[n-m]
Digital Signal Processing
YCJ
41
Finite filter, Infinite input
Block Processing
y
0
= h*x
0
, y
1
= h*x
1
, y
2
= h*x
2
,
y
0
= L M
x = block x
0
block x
1
block x
2
y
1
= L M
y
2
= L M
Digital Signal Processing
YCJ
42
Finite filter, Infinite input
Sample Processing
y[n] =
m=max(0,nL+1)
n
h[m]x[n-m]
= h[0]x[n] + h[1]x[n-1] + . h[M]x[n-M]
FOR each input x DO
w
0
= x
y = h
0
w
0
+ h
1
w
1
+ h
2
w
2
+.. h
M
w
M
w
M
= w
M-1
w
M-1
= w
M-2
|
|
w
1
= w
0
Digital Signal Processing
YCJ
43
Circular Buffers
y
x h
0
h
1
w
0
w
1
h
2
h
3
w
2
w
3
X
MAC: Multiply & Accumulate

Digital Signal Processing


YCJ
44
Z-Transform
{x[n], n = -, }
X(z) =
n=-

x[n]z
-n
= +x[-2]z
2
+x[-1]z
1
+x[0] +x[1]z
-1
+x[2]z
-2
+
Z-transform of the impulse response h[n]
H(z) =
n=-

h[n]z
-n
is called the Transfer function of the LTI system.
Digital Signal Processing
YCJ
45
Basic Properties of Z-transform
Linearity:
Z
a
1
x
1
[n] + a
2
x
2
[n] a
1
X
1
(z) + a
2
X
2
(z)
Delay:
Z
x[n-D] z
-D
X(z)
Convolution:
Z
y[n] = h[n]*x[n] Y(z) = H(z) X(z)
Digital Signal Processing
YCJ
46
Z-transform Examples
[n]
Z
1
[n-M]
Z
z
-M
u[n]
Z
1/(1- z
-1
)
for |z|> 1
a
n
u[n]
Z
1/(1- a z
-1
)
for |z|>|a|
Digital Signal Processing
YCJ
47
ROC: Region of Convergence
ROC: Region of z C (complex plane) where X(z)
Examples:
(0.5)
n
u[n] X(z) = 1/(1-0.5z
-1
) if |z| > 0.5
-(0.5)
n
u[-n-1] X(z) = 1/(1-0.5z
-1
) if |z| < 0.5
In general
a
n
u[n] X(z) = 1/(1-a z
-1
) if |z| > |a|
-a
n
u[-n-1] X(z) = 1/(1-a z
-1
) if |z| < |a|
Digital Signal Processing
YCJ
48
Region of Convergence: Example
X(z) = 1/(1-0.8z
-1
) + 1/(1-1.25z
-1
) = (2-2.05z
-1
)/(1-2.05z
-1
+ z
-2
)
Z-plane
0.8 1.25
I
II
III
Digital Signal Processing
YCJ
49
Causal Sequence & ROC: Poles
X(z) = A
1
/(1-p
1
z
-1
) + A
2
/(1-p
2
z
-1
) + .. A
k
/(1-p
k
z
-1
) +
Z-plane
Causal ROC
ROC:
z > max|p
k
|
causal sequence = right-sided sequence = ROC is outside of a circle
Digital Signal Processing
YCJ
50
Anti-Causal Sequence & ROC
X(z) = A
1
/(1-p
1
z
-1
) + A
2
/(1-p
2
z
-1
) + .. A
k
/(1-p
k
z
-1
) +
Z-plane
Anti-Causal ROC
ROC:
z < min|p
k
|
Anti-causal sequence = left-sided sequence = ROC is inside of a circle
Digital Signal Processing
YCJ
51
Two-sided Sequence & ROC
X(z) = A
1
/(1-p
1
z
-1
) + A
2
/(1-p
2
z
-1
) + .. A
k
/(1-p
k
z
-1
) +
Z-plane
Mixed ROC
mixed sequence two-sided sequence = ROC is inside of a ring
Digital Signal Processing
YCJ
52
Stability of a Sequence and ROC
Stable Sequence = ROC contains the UNIT CIRCLE
If H is stable , i.e.,
n=-

|h[n]| <
Then on the unit circle, i.e., |z| =1
|H(z)| = |
n=-

h[n]z
-n
|
n=-

|h[n]z
-n
| =
n=-

|h[n]|<
Therefore, its ROC contain the unit circle.
If H(z)s ROC contains the unit circle
Then
n=-

h[n]z
-n
|
|z|=1
=
n=-

|h[n]| <
Therefore, H is stable.
Digital Signal Processing
YCJ
53
Stable and Causal Sequence
Stable and Causal: All poles are inside the unit circle
Z-plane
Causal ROC
unit circle
Digital Signal Processing
YCJ
54
Stable and Anti-Causal Sequence
Stable and Anti-Causal: All poles are outside the unit circle
Z-plane
Anti-Causal ROC
unit circle
Digital Signal Processing
YCJ
55
Stable and Two-sided Sequence
Stable and Two-sided:Some poles are outside the unit circle
Some poles are inside the unit circle
Z-plane
Mixed ROC
unit circle
Digital Signal Processing
YCJ
56
Stable System
An LTI system is stable if and only if
H(z)s ROC contains the unit circle.
Digital Signal Processing
YCJ
57
Inverse Z-transform
By inspection:
First order sequence/system
X(z) = 1/(1-a z
-1
) if |z| > |a| x[n] = a
n
u[n]
X(z) = 1/(1-a z
-1
) if |z| < |a| x[n] = -a
n
u[-n-1]
Second order sequence/system
X(z) =A
1
/(1-p
1
z
-1
) + A
1
*
/(1-p
1
*
z
-1
) if |z| > |p
1
|
where A
1
= B
1
e
j
1
and p
1
= R
1
e
j
1
x[n] = 2B
1
R
1
n
cos(n
1
+
1
)u[n]
X(z) = [2B
1
cos(
1
)-2B
1
R
1
cos(
1
-
1
) z
-1
]/[1-2R
1
cos(
1
) z
-1
+R
1
2
z
-2
]
Digital Signal Processing
YCJ
58
Inverse Z-transform
Partial Fraction Expansion:
X(z) = N(z)/D(z)
N(z) is of degree N & D(z) is of degree M, M<N, Real Roots
= N(z)/(1-p
1
z
-1
)(1-p
2
z
-1
).. /(1-p
M
z
-1
)
= A
1
/(1-p
1
z
-1
)+ A
2
/(1-p
2
z
-1
)+. A
M
/(1-p
M
z
-1
)
A
k
= (1-p
k
z
-1
)X(z)|
z=p
k
N(z) is of degree N & D(z) is of degree M, M<N, Complex Roots
X(z) =
k
[A
k
/(1-p
k
z
-1
) + A
k
*
/(1-p
k
*
z
-1
)]
N(z) is of degree N & D(z) is of degree M, M<N, Multiple Roots
N(z) is of degree N & D(z) is of degree M, MN, Complex Roots
Digital Signal Processing
YCJ
59
Frequency Response & Z-Transform
The DTFT (Discrete-Time Fourier Transform)
X() =
n=-

x[n]e
-jn
X(z) =
n=-

x[n]z
-n
X() = X(z)|
z=e
j
The Inverse DTFT
x[n] = (1/2)

X()e
jn
d
The Frequency Response of the LTI System
H() =
n=-

h[n]e
-jn
Y()= H()X()
Digital Signal Processing
YCJ
60
Parseval Theorem

n=-

|x[n]|
2
= (1/2)

|X()|
2
d
Digital measurement of energy of an analog signal

n=-

|x[n]|
2
= (1/2)

|X()|
2
d
= (1/2)(1/T)

|X()|
2
d
=(1/T)

|x(t)|
2
dt
Total energy = (T)
n=-

|x[n]|
2
Digital Signal Processing
YCJ
61
Frequency Response & Pole/Zero Locations
X(z) = (1-z
1
z
-1
)/(1-p
1
z
-1
)
X() = (e
j
-z
1
)/(e
j
-p
1
)
|X()| = |(e
j
-z
1
)|/|(e
j
-p
1
)|
p
1
=|p
1
|e
j
z
1
=|z
1
|e
j
|X()|
e
j
z
1


p
1
Digital Signal Processing
YCJ
62
Transfer Function of an LTI System
Block Processing
Impulse
Response h[n]
I/O Convolution
Equation
Transfer
Function H(z)
Pole/zero
Pattern
I/O Difference
Equation
Frequency
Response
Specification
Filter
Design
Block Diagram
Realization
Sample Processing
Digital Signal Processing
YCJ
63
An Example
Transfer Function: H(z) = (5+2z
-1
)/(1-0.8z
-1
)
Impulse Response: H(z) = -2.5 + 7.5/(1-0.8z
-1
)
h[n] = -2.5[n] + 7.5(0.8)
n
u[n]
Difference Equation: H(z) = (5+2z
-1
)/(1-0.8z
-1
) = Y(z)/X(z)
Y(z) 0.8z
-1
Y(z) = 5X(z) +2z
-1
X(z)
y[n] = 0.8y[n-1] + 5x[n] + 2x[n-1]
Block Diagram: Y(z)/X(z) = (5+2z
-1
)/(1-0.8z
-1
)
Digital Signal Processing
YCJ
64
An Example - Continued
Block Diagram: Y(z)/X(z) = (5+2z
-1
)/(1-0.8z
-1
)
5
x[n]
0.8
z
-1
z
-1
+
y[n]
y[n-1]
x[n-1]
2
Digital Signal Processing
YCJ
65
An Example - Continued
Frequency Response: H(z) = (5+2z
-1
)/(1-0.8z
-1
)
=5(1+0.4z
-1
)/(1-0.8z
-1
)
H() =5 (1+0.4e
-j
)/(1-0.8e
-j
)
Using the identity: |1-ae
-j
| = [1-2a cos()+a
2
]
1/2
|H()| = 5 [1-0.8 cos()+0.16]
1/2
/[1-1.6 cos()+0.64]
1/2
|H()|
-0.4 0.8
35
5/3

Digital Signal Processing


YCJ
66
Direct & Canonical Forms
H(z) = N(z)/D(z)
= (b
0
+ b
1
z
-1+
b
2
z
-2
++ b
L
z
-L
)/(1+ a
1
z
-1+
a
2
z
-2
++ a
M
z
-M
)
Y(z)/X(z) = (b
0
+ b
1
z
-1+
b
2
z
-2
++ b
L
z
-L
)/(1+ a
1
z
-1+
a
2
z
-2
++ a
M
z
-M
)
Y(z)= X(z)(b
0
+ b
1
z
-1+
b
2
z
-2
++ b
L
z
-L
)/(1+ a
1
z
-1+
a
2
z
-2
++ a
M
z
-M
)
= X(z)(b
0
+ b
1
z
-1+
b
2
z
-2
++ b
L
z
-L
)
[1/(1+ a
1
z
-1+
a
2
z
-2
++ a
M
z
-M
)] Direct Form
= X(z)/(1+ a
1
z
-1+
a
2
z
-2
++ a
M
z
-M
)
[(b
0
+ b
1
z
-1+
b
2
z
-2
++ b
L
z
-L
)] Canonical Form
Digital Signal Processing
YCJ
67
Direct Form
Y(z)= X(z)(b
0
+ b
1
z
-1+
b
2
z
-2
++ b
L
z
-L
) [1/(1+ a
1
z
-1+
a
2
z
-2
++ a
M
z
-M
)]
b
0
b
1
b
2
b
L
y[n]
y[n-1] x[n-1]
x[n]
-a
1
-a
2
-a
M
y[n-2]
x[n-2]
y[n-M]
x[n-L]
z
-1
z
-1
+
z
-1
z
-1
z
-1
z
-1
Digital Signal Processing
YCJ
68
Canonical Form
Y(z)= X(z)/(1+ a
1
z
-1+
a
2
z
-2
++ a
M
z
-M
) [(b
0
+ b
1
z
-1+
b
2
z
-2
++ b
L
z
-L
)]
b
0
-a
1 b
1
b
2
-a
2
-a
M
w[n-1]
w[n]
x[n]
+ +
y[n]
z
-1
z
-1
b
L
z
-1
Digital Signal Processing
YCJ
69
Examples
Example 6.2.1: Impulse response: h = {1, 6, 11, 6}
Difference equation: y[n] = x[n] + 6x[n-1] +11x[n-2] +6x[n-3]
Transfer Function: H(z) = 1+ 6z
-1
+11z
-2
+ 6z
-3
Pole/Zeros: H(z) = (1+z
-1
)(1+2z
-1
)(1+3z
-1
)
Frequency Response, Block Diagrams
Example 6.2.3:
(a) Difference equation: y[n] = 0.25 y[n-2] + x[n]
(b) Difference equation: y[n] = -0.25 y[n-2] + x[n]
Digital Signal Processing
YCJ
70
Sinusoidal Steady State Response
x[n] = e
j
o
n
DTFT: X() = 2 (

) + replicas
Y() = H()X() = H(

)2 (

) + replicas
y[n] = H(

) e
j
o
n
i.e., e
j
o
n

H
H(

) e
j
o
n
= |H(

)| e
j(
o
n+Arg[H(
o
)])
cos(n

)
H
|H(

)| cos(n

+ Arg[H(
o
)] )
sin(n

)
H
|H(

)| sin(n

+ Arg[H(
o
)] )
Linearity
Ae
j
1
n
+Be
j
2
n

H
A H(
1
) e
j
1
n
+B H(
2
) e
j
2
n
Digital Signal Processing
YCJ
71
Sinusoidal Transient Response
Input: x[n] = e
j
o
n
u[n] : X(z) = 1/(1- e
j
o
z
-1
)
LTI system: H(z) = N(z)/D(z) (assuming real poles)
= N(z)/(1-p
1
z
-1
)(1-p
2
z
-1
)..(1-p
M
z
-1
)
all |p
k
| < 1, k = 1, 2, ., M
Output: Y(z) = X(z)H(z) = N(z)/(1- e
j
o
z
-1
)(1-p
1
z
-1
)(1-p
2
z
-1
)..(1-p
M
z
-1
)
= H(

) /(1- e
j
o
z
-1
) + A
1
/(1-p
1
z
-1
) + A
2
/(1-p
2
z
-1
) + .. A
M
/(1-p
M
z
-1
)
y[n] = {H(

) e
j
o
n
+ A
1
p
1
n
+ A
2
p
2
n
+ .. A
M
p
M
n
}u[n]
as n y[n] H(

) e
j
o
n
Digital Signal Processing
YCJ
72
Sinusoidal Transient Response
Example: H(z) = (5+2z
-1
)/(1-0.8z
-1
)
Y(z) = (5+2z
-1
)/(1- e
j
o
z
-1
)(1-0.8z
-1
)
Observation:
1. Stability of the Filter
2. Effective Time Constant: n
eff
= max
k
|p
k
|,
n
eff
=
n
eff
= ln( )/ln()
Example 6.3.2
Digital Signal Processing
YCJ
73
Unit Step Response
Input: x[n] = e
j
o
n
u[n],

= 0 : X(z) = 1/(1- z
-1
)
LTI system: H(z) = N(z)/D(z) (assuming real poles)
= N(z)/(1-p
1
z
-1
)(1-p
2
z
-1
).. /(1-p
M
z
-1
)
all |p
k
| < 1, k = 1, 2, ., M
Output: Y(z) = X(z)H(z) = N(z)/(1-z
-1
)(1-p
1
z
-1
)(1-p
2
z
-1
)..(1-p
M
z
-1
)
= H(1) /(1- z
-1
) + A
1
/(1-p
1
z
-1
) + A
2
/(1-p
2
z
-1
) + .. A
M
/(1-p
M
z
-1
)
y[n] = {H(1) + A
1
p
1
n
+ A
2
p
2
n
+ .. A
M
p
M
n
}u[n]
as n y[n] H(1)u[n]
H(1) =
n=0

h[n] is the DC gain


Digital Signal Processing
YCJ
74
Pole/Zero Designs
First Order Filter
H(z) = G(1+bz
-1
)/(1-az
-1
)
H(0), H(), and speed of response n
eff
H(0) =G(1+b)/(1-a), H() = G(1-b)/(1+a)
H() / H(0) = (1-b)(1-a)/(1+b)(1+a)
a =
1/n
eff
Example
H(z) = (5+2z
-1
)/(1-0.8z
-1
)
= 5(1+0.4z
-1
)/(1-0.8z
-1
)
Digital Signal Processing
YCJ
75
Second-Order Filter & Resonator
Re
j
o

o
Re
-j
o
Z-Plane
Unit circle
H(z) = G/(1- Re
j
o
z
-1
)(1- Re
-j
o
z
-1
)
= G/(1-2Rcos(
o
)z
-1
+ R
2
z
-2
)
H() = G/(1- Re
j
o
e
-j
)(1- Re
-j
o
e
-j
)
G: normalize H(
o
) = 1
Digital Signal Processing
YCJ
76
Second-Order Filter & Resonator
|H()|
2
= G/(1- 2Rcos(
o
) + R
2
)(1- 2Rcos(+
o
) + R
2
)
|H()|
2
2(1-R)
(3 dB bandwidth)
1
1/2

o

Digital Signal Processing
YCJ
77
Second-Order Filter & Resonator
Transfer Function: H(z) = G/(1- 2Rcos(
o
) z
-1
+ R
2
z
-2
)
Impulse Response: h[n] = [G/sin(
o
)] R
n
sin(n
o
)
Difference Equation: y[n] = 2Rcos(
o
)y[n-1] - R
2
y[n-2] Gx[n]
G
-a
1
-a
2
y[n]
x[n]
z
-1
+
y[n-1]
z
-1
a
1
= -2Rcos(
o
)
a
2
= R
2
y[n-2]
Digital Signal Processing
YCJ
78
Second-Order Filter & Resonator
Example:
Design a 2-pole resonator filter with peak frequency
f
o
= 500 Hz, and 3-dB bandwidth f = 32 Hz.
The sampling frequency is f
s
= 10KHz.
R = 0.99, G = 0.0062,
a
1
= -1.8831 and a
2
= 0.9801
H(z) = 0.0062/(1 - 1.8831 z
-1
+ 0.9801 z
-2
)
Digital Signal Processing
YCJ
79
Parametric Equalizer
Re
j
o

o
Re
-j
o
Z-Plane
Unit circle
p
1
=R e
j
o
p
1
*
=R e
-j
o
z
1
=r e
j
o
z
1
*
=r e
-j
o
H(z) = (1- re
j
o
z
-1
)(1- re
-j
o
z
-1
) /(1- Re
j
o
z
-1
)(1- Re
-j
o
z
-1
)
= (1 + b
1
z
-1
+ b
2
z
-2
)/(1 + a
1
z
-1
+ a
2
z
-2
)
a
1
= -2Rcos(
o
), a
2
= R
2
b
1
= -2rcos(
o
), b
2
= r
2
H(z) = (1 + b
1
z
-1
+ b
2
z
-2
)/(1 + (R/r)b
1
z
-1
+ (R/r)
2
b
2
z
-2
)
Digital Signal Processing
YCJ
80
Parametric Equalizer
H(z) = (1 + b
1
z
-1
+ b
2
z
-2
)/(1 + (R/r)b
1
z
-1
+ (R/r)
2
b
2
z
-2
)
b
1
= -2rcos(
o
), b
2
= r
2
|H()|
2
= (1- 2rcos(
o
) + r
2
)(1- 2rcos(+
o
) + r
2
)
/(1- 2Rcos(
o
) + R
2
)(1- 2Rcos(+
o
) + R
2
)
|H()|
2


o
Digital Signal Processing
YCJ
81
Notch Filter
Re
j
o

o
Re
-j
o
Z-Plane
Unit circle
Notch Filter:
Zeros on the unit circle
r = 1
H(z) = (1 + b
1
z
-1
+ z
-2
)/(1 + (R)b
1
z
-1
+ R
2
z
-2
)
b
1
= -2cos(
o
),
Digital Signal Processing
YCJ
82
Notch Filter
Notch polynomial N(z) =
k
(1-e
j
k
z
-1
)
Real Coefficient N(z) =
k
(1-2cos
k
z
-1
+z
-2
)
Notch Filter = N(z)/N(
-1
z)
= (1 + b
1
z
-1
+ b
2
z
-2
++ b
2
z
-(M-1)
+ b
1
z
-M
)/
(1 + b
1
z
-1
+
2
b
2
z
-2
++
-(M-1)
b
2
z
-(M-1)
+
M
b
1
z
-M
)
Examples 6.4.3, 6.4.4
Digital Signal Processing
YCJ
83
Comb Filter
From notch filter moves the zeros inside the poles
H(z) = (1 + rb
1
z
-1
+ r
2
b
2
z
-2
++ r
-(M-1)
b
2
z
-(M-1)
+ r
M
b
1
z
-M
)/
(1 + b
1
z
-1
+
2
b
2
z
-2
++
-(M-1)
b
2
z
-(M-1)
+
M
b
1
z
-M
)
r and r <
Digital Signal Processing
YCJ
84
DTFT, DFT, and FFT
Fourier Transform X
a
() = x
c
(t)e
-jt
dt
Discrete Time Fourier Transform X() =
n
x[n] e
-jn
x[n] = x
c
(nT) X( T) =(1/T)X
a
()
Discrete Fourier Transform X [k] =
n=0
(N-1)
x[n] e
-jnk2/
If only N points X[k] = X()|
=k2/N
Fast Fourier Transform
Digital Signal Processing
YCJ
85
Digital Spectral Analysis
Frequency Resolution
Mainlobe
Sidelobe
Windowing
Physical Resolution
Computational Resolution
Digital Signal Processing
YCJ
86
The Fast Fourier Transform
Decimation in Time (DIT) Algorithm
DIT Butterfly
Decimation in Frequency (DIF) Algorithm
DIF Butterfly
N log(N) Algorithm
Bits Reversal Indexing

You might also like