Post on 03-Jun-2018
transcript
8/11/2019 Typical Real Time DSP System
1/86
Digital Signal Processing
YCJ
1
A Typical DSP System
Sampling&
A/D
AnalogPre-filter
HPRE(f)
x(t) x[n]xa(t)
Analog
inDSPFilter
HDSP(z)
Analog
out
AnalogPost-filter
HPOST(f)
D/AConverter
HDAC(f)
ya(t) y(t) y[n]
8/11/2019 Typical Real Time DSP System
2/86
Digital Signal Processing
YCJ
2
Analog Signal Processing
xa(t) : an analog signal
Xa() =xa(t)e-jtdt is its Fourier transform
The inverse Fourier transform is
xa(t) = (1/2)Xa() ejtd
8/11/2019 Typical Real Time DSP System
3/86
Digital Signal Processing
YCJ
3
Analog Signal ProcessingAnalog
FilterHa()
ya(t)xa(t)
Ha() is the Fourier transform of theimpulse response, ha(t), of the filter
ya(t) =ha(t-) xa() d
OR, equivalently, in frequency domain
Ya() = Ha() Xa()
8/11/2019 Typical Real Time DSP System
4/86
Digital Signal Processing
YCJ
4
A Typical DSP SystemA Typical DSP System
AnalogPre-filter
HPRE(f)
Sampling&
A/D
DSPFilter
HDSP(z)
D/AConverter
HDAC(f)
AnalogPost-filter
HPOST(f)
xa(t) x(t) x[n]
ya(t) y(t) y[n]
8/11/2019 Typical Real Time DSP System
5/86
Digital Signal Processing
YCJ
5
A digital Spectral Analyzer
AnalogPre-filter
HPRE(f)
Sampling&
A/D
FFT
Processor
Displaythe
Spectrum
xa(t) x(t)
8/11/2019 Typical Real Time DSP System
6/86
Digital Signal Processing
YCJ
6
Linear Time-Invariant SystemsThe delta function: (t)
Linearity
Time-invariant
The Impulse Response
The Convolution Integral
The Convolution Theorem
8/11/2019 Typical Real Time DSP System
7/86
Digital Signal Processing
YCJ
7
Sinusoidal Response of LTI System
ejt Ha() ejtHa()
Ha() = |Ha()| e jARG{Ha()}
Ha(1) A1ej1t+ Ha(2) A2ej2t
A1ej1t
+A2ej2t
Ha()
8/11/2019 Typical Real Time DSP System
8/86
Digital Signal Processing
YCJ
8
Linear FilteringXa()
=2f
Ya()
=2f
8/11/2019 Typical Real Time DSP System
9/86
Digital Signal Processing
YCJ
9
Sampling a Signal
x[n] = x(nT)x(t)
T = 1/fs
T: sampling period, (second)
fs: sampling frequency (sample/second)
x(t) x[n]
t n0 1 2 3 4
8/11/2019 Typical Real Time DSP System
10/86
Digital Signal Processing
YCJ
10
Discrete-Time Fourier Tranform (DTFT)
X() = nx[n] e-jn
X() is a continuous function of
X() is periodic on with the period 2
-4 -2 0 2 4
X()
8/11/2019 Typical Real Time DSP System
11/86
Digital Signal Processing
YCJ
11
Fourier Transform and The DTFTIf Xa() =xa(t)e-jtdt and x[n] = xa(nT)
Then X( ) = (1/T) kXa( - k2/T)
-4fs-2f
s0 2f
s4f
s
1/T
0
Xa()
X()
8/11/2019 Typical Real Time DSP System
12/86
Digital Signal Processing
YCJ
12
Aliasing
-4fs -2fs 0 2fs 4fs
X()
0-4fs -2fs 2fs 4fs
8/11/2019 Typical Real Time DSP System
13/86
Digital Signal Processing
YCJ
13
AliasingCos( t) = (ejt+ e-jt)
-4fs -2fs 0 2fs 4fs
-4fs -2fs
0 2fs
4fs
8/11/2019 Typical Real Time DSP System
14/86
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
8/11/2019 Typical Real Time DSP System
15/86
Digital Signal Processing
YCJ
15
Anti-Aliasing Filter
A(f)
ffpass fs/2 fstop
Attenuation A(f) = -20 log {|H(f)/H(0)|}
dB per Octave or dB perDecade
A single-pole filter has 6 dB/Oct. or 20 dB/Dec.
16
8/11/2019 Typical Real Time DSP System
16/86
Digital Signal Processing
YCJ
16
DAC & Analog Reconstruction
D/AConverter
HDAC(f)
y[n] ya(t)
ya(t) = ny[n] hDAC(t-nT)
Ya() = Y() |=HDAC()
17
8/11/2019 Typical Real Time DSP System
17/86
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 = fs
1, -T/2 t T/2
0, otherwiseh(t) = u(t) - u(t-T) = {
H(f) = (T/j) [Sin(fT)/(fT)]t
f
18
8/11/2019 Typical Real Time DSP System
18/86
Digital Signal Processing
YCJ
18
Staircase Reconstructor
-100 -80 -60 -40 -20 0 20 40 60 80 1000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
fs-fs
19
8/11/2019 Typical Real Time DSP System
19/86
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
fs/2
f-fs/2
Removing high frequency imagesEqualizing D/A converters in-band distortion
(may be done digitally)
-20 log[H(fs/2)/H(0)] ~ 3.9 dB
20
8/11/2019 Typical Real Time DSP System
20/86
Digital Signal Processing
YCJ
20
Ideal Reconstructor
TH(f)
f-fs/2 fs/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)
tT 2T
21
8/11/2019 Typical Real Time DSP System
21/86
Digital Signal Processing
YCJ
21
A/D Converter & Quantization
R:fullsc
ale
R/2
3Q
2Q
Q
0-Q
-2Q
-3Q-R/2
R/Q = 2BQ: step size
22
8/11/2019 Typical Real Time DSP System
22/86
Digital Signal Processing
YCJ
22
Quantization Noise PowerP(e)
1/Q
e-Q/2 Q/2
E(e2) = (1/Q)e2 de = Q2/12
or
erms = Q/121/2
23
8/11/2019 Typical Real Time DSP System
23/86
Digital Signal Processing
YCJ
Signal to Noise Ratio: SNR
Noise Power = Q2
/12Signal Power = ?
Assuming Sine Wave -> Signal Power = A2/2
Assuming Full Scale -> A = R/2 -> Signal Power = R2/8
Assuming B bits -> Q = R/2B
Signal to Noise Power Ration = (R2/8) / (Q2/12)
SNR (dB) = 10 log(22B) + 10log(12/8)= 6.02*B + 1.76 dB
24
8/11/2019 Typical Real Time DSP System
24/86
Digital Signal Processing
YCJ
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
25
8/11/2019 Typical Real Time DSP System
25/86
Digital Signal Processing
YCJ
Sample by Sample Processingy[n] = 2x[n] + 3x[n-1] + 4x[n-2]
y[n] = 2x[n] + 3w1[n] + 4w2[n]
w2[n+1] = w1[n]
w1[n+1] = x[n]
For each new input x
DO y = 2x + 3w1 + 4w2w2 = w1w1 = x
CONTINUE
26
8/11/2019 Typical Real Time DSP System
26/86
Digital Signal Processing
YCJ
Block Processingy[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
27
8/11/2019 Typical Real Time DSP System
27/86
Digital Signal Processing
YCJ
Overlap and Add
0, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19,
28
8/11/2019 Typical Real Time DSP System
28/86
Digital Signal Processing
YCJ
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]
29
8/11/2019 Typical Real Time DSP System
29/86
Digital Signal Processing
YCJ
Sample by Sample Processingy[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 + 3vw = y
v = x
CONTINUE
30
8/11/2019 Typical Real Time DSP System
30/86
Digital Signal Processing
YCJ
Linearitya1
y[n] = a1y1[n]+ a2y2[n]
+
a2
x1[n]
x[n]x2[n]
y[n]H
a1
+
a2
x1[n]
x2[n]
Hy1[n]
a1y1[n]+ a2y2[n]
Hy2[n]
31
8/11/2019 Typical Real Time DSP System
31/86
Digital Signal Processing
YCJ
Time-Invariance
x[n] y[n]
yD[n] = y[n-D]
H D y[n-D]
x[n]D
xD[n]H yD[n]
x[n-D]
32
8/11/2019 Typical Real Time DSP System
32/86
Digital Signal Processing
YCJ
Impulse Response of an LTI System
[n] = 1, for n=0, and 0, otherwiseh[n]
[n]
H nn
For any input x[n], the output y[n] is given by
y[n] = mx[m]h[n-m]= m h[m]x[n-m] (direct form)
33
8/11/2019 Typical Real Time DSP System
33/86
Digital Signal Processing
YCJ
Convolutionh[n][n]H n
nh[n-1]
[n-1]
Hnn
h[n-2][n-2]
H nn
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] +
34
8/11/2019 Typical Real Time DSP System
34/86
Digital Signal Processing
YCJ
FIR and IIR FiltersAn FIR filterhas 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 thefilter order, and the length of the filter impulse response is M+1.
AnIIR 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.
35
8/11/2019 Typical Real Time DSP System
35/86
Digital Signal Processing
YCJ
I/O Difference EquationImpulse Response: h[n]
FIR filter: convolution sum
IIR Filter: difference equation
y[n] = ay[n-1] + x[n]
h[n] = anu[n]
36
8/11/2019 Typical Real Time DSP System
36/86
Digital Signal Processing
YCJ
Causality and StabilityA 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 responseis absolutely summable, i.e.,
n |h[n]| <
37
8/11/2019 Typical Real Time DSP System
37/86
Digital Signal Processing
YCJ
Linear Convolution: Flip & Slide
y[n] = mx[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)
38
8/11/2019 Typical Real Time DSP System
38/86
Digital Signal Processing
YCJ
Linear Convolution: Flip & Slide
h3
h2
h1
h0
h3
h2
h1
h0
h3
h2
h1
h0
0 0 0 x0 x1x2x3 xn-3xn-2xn-1xn xL-1 0 0 0
y0 yn yL-1+M
h = M+1
x = L
y = h*x = L M
39
8/11/2019 Typical Real Time DSP System
39/86
Digital Signal Processing
YCJ
Transient & Steady State
y[n] = m=0n
h[m]x[n-m] if 0 n < M
y[n] = m=0M
h[m]x[n-m] if M n L-1
y[n] = m=n-L+1M
h[m]x[n-m] if L n < L+M
output y[n]
n
0 M L-1 L-1+M
40
8/11/2019 Typical Real Time DSP System
40/86
Digital Signal Processing
YCJ
Convolution of Infinite Sequencey[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=0min(n,M)
h[m]x[n-m]
Infinite filter, infinite input: M = , L =
y[n] = m=0n
h[m]x[n-m]
41
Fi i fil I fi i i
8/11/2019 Typical Real Time DSP System
41/86
Digital Signal Processing
YCJ
Finite filter, Infinite inputBlock Processing
y0 = h*x0, y1 = h*x1, y2 = h*x2,
y0 = L M
x = block x0 block x1 block x2
y1 = L M
y2 = L M
42
8/11/2019 Typical Real Time DSP System
42/86
Digital Signal Processing
YCJ
Finite filter, Infinite inputSample 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
w0 = x
y = h0w0 + h1w1 + h2w2 +.. hMwM
wM= wM-1wM-1 = wM-2|
|
w1 = w0
43
8/11/2019 Typical Real Time DSP System
43/86
Digital Signal Processing
YCJ
Circular Buffersyx h0
h1
w0
w1
h2
h3
w2
w3
XMAC:Multiply & Accumulate
44
8/11/2019 Typical Real Time DSP System
44/86
Digital Signal Processing
YCJ
Z-Transform{x[n], n = -, }
X(z) = n=-x[n]z-n
= +x[-2]z2 +x[-1]z1 +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.
45
8/11/2019 Typical Real Time DSP System
45/86
Digital Signal Processing
YCJ
Basic Properties of Z-transformLinearity:
Z
a1x1[n] + a2x2[n] a1X1(z) + a2X2(z)
Delay:
Z
x[n-D] z-DX(z)
Convolution:Z
y[n] = h[n]*x[n] Y(z) = H(z) X(z)
46
8/11/2019 Typical Real Time DSP System
46/86
Digital Signal Processing
YCJ
Z-transform Examples
[n]
Z
1
[n-M]Z
z-M
u[n] Z 1/(1- z-1)for |z|> 1
anu[n] Z 1/(1- a z-1)for |z|>|a|
47
8/11/2019 Typical Real Time DSP System
47/86
Digital Signal Processing
YCJ
ROC: Region of ConvergenceROC: Region of z C (complex plane) where X(z)
Examples:
(0.5)nu[n] X(z) = 1/(1-0.5z-1) if |z| > 0.5
-(0.5)nu[-n-1] X(z) = 1/(1-0.5z-1) if |z| < 0.5
In general
anu[n] X(z) = 1/(1-a z-1) if |z| > |a|
-anu[-n-1] X(z) = 1/(1-a z-1) if |z| < |a|
48
i f l
8/11/2019 Typical Real Time DSP System
48/86
Digital Signal Processing
YCJ
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
IIIII
49
8/11/2019 Typical Real Time DSP System
49/86
Digital Signal Processing
YCJ
Causal Sequence & ROC: PolesX(z) = A1/(1-p1z
-1) + A2/(1-p2z-1) + .. Ak/(1-pkz
-1) +
Z-plane
Causal ROC
ROC:
z > max|pk|
causal sequence = right-sided sequence = ROC is outside of a circle
50
8/11/2019 Typical Real Time DSP System
50/86
Digital Signal Processing
YCJ
Anti-Causal Sequence & ROCX(z) = A1/(1-p1z
-1) + A2/(1-p2z-1) + .. Ak/(1-pkz
-1) +
Z-plane
Anti-Causal ROC
ROC:z < min|pk|
Anti-causal sequence = left-sided sequence = ROC is inside of a circle
51
8/11/2019 Typical Real Time DSP System
51/86
Digital Signal Processing
YCJ
Two-sided Sequence & ROCX(z) = A1/(1-p1z
-1) + A2/(1-p2z-1) + .. Ak/(1-pkz
-1) +
Z-plane
Mixed ROC
mixed sequence two-sided sequence = ROC is inside of a ring
52
8/11/2019 Typical Real Time DSP System
52/86
Digital Signal Processing
YCJ
Stability of a Sequence and ROCStable 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]|
8/11/2019 Typical Real Time DSP System
53/86
Digital Signal Processing
YCJ
Stable and Causal Sequence
Stable and Causal: All poles are inside the unit circle
Z-plane
Causal ROC unit circle
54
8/11/2019 Typical Real Time DSP System
54/86
Digital Signal Processing
YCJ
Stable and Anti-Causal Sequence
Stable and Anti-Causal: All poles are outside the unit circle
Z-plane
Anti-Causal ROC
unit circle
55
8/11/2019 Typical Real Time DSP System
55/86
Digital Signal Processing
YCJ
Stable and Two-sided SequenceStable and Two-sided:Some poles are outside the unit circle
Some poles are inside the unit circle
Z-plane
Mixed ROC
unit circle
56
8/11/2019 Typical Real Time DSP System
56/86
Digital Signal Processing
YCJ
Stable System
An LTI system is stable if and only if
H(z)s ROC contains the unit circle.
57
I Z t f
8/11/2019 Typical Real Time DSP System
57/86
Digital Signal Processing
YCJ
Inverse Z-transform
By inspection:
First order sequence/system
X(z) = 1/(1-a z-1) if |z| > |a| x[n] = anu[n]
X(z) = 1/(1-a z-1) if |z| < |a| x[n] = -anu[-n-1]
Second order sequence/system
X(z) =A1/(1-p1z-1) + A1
*/(1-p1*z-1) if |z| > |p1|
where A1
= B1
ej1 and p1
= R1
ej1
x[n] = 2B1R1ncos(n1+1)u[n]
X(z) = [2B1cos(
1)-2B
1R
1cos(
1-
1) z-1]
/[1-2R
1cos(
1) z-1+R
1
2z-2]
58
8/11/2019 Typical Real Time DSP System
58/86
Digital Signal Processing
YCJ
Inverse Z-transformPartial Fraction Expansion:X(z) = N(z)/D(z)
N(z) is of degree N & D(z) is of degree M, M
8/11/2019 Typical Real Time DSP System
59/86
Digital Signal Processing
YCJ
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=ej
The Inverse DTFTx[n] = (1/2)
X()ejnd
The Frequency Response of the LTI SystemH() =n=-
h[n]e-jn
Y()= H()X()
60
8/11/2019 Typical Real Time DSP System
60/86
Digital Signal Processing
YCJ
Parseval Theoremn=-
|x[n]|2 = (1/2)
|X()|2d
Digital measurement of energy of an analog signal
n=-|x[n]|2 = (1/2)
|X()|2d= (1/2)(1/T)
|X()|2d
=(1/T)
|x(t)|2dt
Total energy = (T)n=-|x[n]|2
61
Frequency Response & Pole/Zero Locations
8/11/2019 Typical Real Time DSP System
61/86
Digital Signal Processing
YCJ
Frequency Response & Pole/Zero Locations
X(z) = (1-z1z-1)/(1-p1z
-1)
X() = (ej-z1)/(ej-p1)|X()| = |(ej-z1)|/|(ej-p1)|
p1 =|p1|ej
z1 =|z1 |ej
|X()|
ej
z1
p1
62
Transfer Function of an LTI System
8/11/2019 Typical Real Time DSP System
62/86
Digital Signal Processing
YCJ
Transfer Function of an LTI System
Block ProcessingImpulse
Response h[n] I/O Convolution
Equation
Transfer
Function H(z) Pole/zeroPatternI/O Difference
Equation
Frequency
Response
Specification
Filter
Design Block DiagramRealization
Sample Processing
63
An Example
8/11/2019 Typical Real Time DSP System
63/86
Digital Signal Processing
YCJ
p
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)nu[n]
Difference Equation: H(z) = (5+2z-1)/(1-0.8z-1) = Y(z)/X(z)
Y(z) 0.8z-1Y(z) = 5X(z) +2z-1X(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)
64
An Example - Continued
8/11/2019 Typical Real Time DSP System
64/86
Digital Signal Processing
YCJ
a p e Co ued
Block Diagram: Y(z)/X(z) = (5+2z-1)/(1-0.8z-1)
5x[n]
0.8
z-1 z-1
+ y[n]
y[n-1]x[n-1]
2
65
An Example - Continued
8/11/2019 Typical Real Time DSP System
65/86
Digital Signal Processing
YCJ
p
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()+a2]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
66
Direct & Canonical Forms
8/11/2019 Typical Real Time DSP System
66/86
Digital Signal Processing
YCJ
Direct & Canonical Forms
H(z) = N(z)/D(z)
= (b0+ b1z-1+ b2z
-2 ++ bLz-L)/(1+ a1z
-1+ a2z-2 ++ aMz
-M)
Y(z)/X(z) = (b0+ b1z-1+ b2z
-2 ++ bLz-L)/(1+ a1z
-1+ a2z-2 ++ aMz
-M)
Y(z)= X(z)(b0+ b1z-1+ b2z-2 ++ bLz-L)/(1+ a1z-1+ a2z-2 ++ aMz-M)
= X(z)(b0+ b1z-1+ b2z
-2 ++ bLz-L)
[1/(1+ a1z-1+
a2z-2
++ aMz-M
)] Direct Form
= X(z)/(1+ a1z-1+ a2z
-2 ++ aMz-M)
[(b0+ b1z-1+ b2z
-2 ++ bLz-L)] Canonical Form
67
Direct Form
8/11/2019 Typical Real Time DSP System
67/86
Digital Signal Processing
YCJ
Y(z)= X(z)(b0+ b1z-1+ b2z-2 ++ bLz-L) [1/(1+ a1z-1+ a2z-2 ++ aMz-M)]
b0
b1
b2
bL
y[n]
y[n-1]x[n-1]
x[n]
-a1
-a2
-aM
y[n-2]x[n-2]
y[n-M]x[n-L]
z-1 z-1
+
z-1 z-1
z-1 z-1
68
Canonical Form
8/11/2019 Typical Real Time DSP System
68/86
Digital Signal Processing
YCJ
Y(z)= X(z)/(1+ a1z-1+
a2z-2
++ aMz-M
) [(b0+ b1z-1+
b2z-2
++ bLz-L
)]
b0
-a1 b1
b2-a2
-aM
w[n-1]
w[n]x[n] + + y[n]
z-1
z-1
bL
z-1
69
8/11/2019 Typical Real Time DSP System
69/86
Digital Signal Processing
YCJ
ExamplesExample 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]
70
Sinusoidal Steady State Response
8/11/2019 Typical Real Time DSP System
70/86
Digital Signal Processing
YCJ
y p
x[n] = ejon DTFT: X() = 2 () + replicas
Y() = H()X() = H()2 () + replicasy[n] = H() ejon
i.e., ejon H H() ejon = |H()| ej(on+Arg[H(o)])
cos(n)H|H()| cos(n+ Arg[H(o)] )sin(n) H|H()| sin(n+ Arg[H(o)] )
Linearity
Aej1n +Bej2n H A H(1) ej1n +B H(2) ej2n
71
Sinusoidal Transient Response
8/11/2019 Typical Real Time DSP System
71/86
Digital Signal Processing
YCJ
Input: x[n] = ejon u[n] : X(z) = 1/(1- ejoz-1)
LTI system: H(z) = N(z)/D(z) (assuming real poles)= N(z)/(1-p1z
-1)(1-p2z-1)..(1-pMz
-1)
all |pk| < 1, k = 1, 2, ., M
Output: Y(z) = X(z)H(z) = N(z)/(1- ejoz-1)(1-p1z-1)(1-p2z
-1)..(1-pMz-1)
= H() /(1- ejoz-1) + A1/(1-p1z-1) + A2/(1-p2z-1) + .. AM/(1-pMz-1)
y[n] = {H() ejon + A1p1n + A2p2n + .. AMpMn}u[n]
as n y[n] H() ejon
72
Sinusoidal Transient Response
8/11/2019 Typical Real Time DSP System
72/86
Digital Signal Processing
YCJ
Sinusoidal Transient Response
Example: H(z) = (5+2z-1)/(1-0.8z-1)
Y(z) = (5+2z-1
)/(1- ej
oz-1
)(1-0.8z-1
)
Observation:
1. Stability of the Filter
2. Effective Time Constant: neff= maxk|pk|, neff = neff= ln()/ln()
Example 6.3.2
73
Unit Step Response
8/11/2019 Typical Real Time DSP System
73/86
Digital Signal Processing
YCJ
Unit Step ResponseInput: x[n] = ejon u[n], = 0: X(z) = 1/(1- z-1)
LTI system: H(z) = N(z)/D(z) (assuming real poles)= N(z)/(1-p1z-1)(1-p2z
-1).. /(1-pMz-1)
all |pk| < 1, k = 1, 2, ., M
Output: Y(z) = X(z)H(z) = N(z)/(1-z-1)(1-p1z-1)(1-p2z
-1)..(1-pMz-1)
= H(1) /(1- z-1) + A1/(1-p1z-1) + A2/(1-p2z-1) + .. AM/(1-pMz-1)
y[n] = {H(1) + A1p1n + A2p2n + .. AMpMn}u[n]as n y[n] H(1)u[n]
H(1) = n=0
h[n] is the DC gain
74
Pole/Zero Designs
8/11/2019 Typical Real Time DSP System
74/86
Digital Signal Processing
YCJ
g
First Order Filter
H(z) = G(1+bz-1)/(1-az-1)
H(0), H(), and speed of response neff
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/neff
ExampleH(z) = (5+2z-1)/(1-0.8z-1)
= 5(1+0.4z-1)/(1-0.8z-1)
75
Second-Order Filter & Resonator
8/11/2019 Typical Real Time DSP System
75/86
Digital Signal Processing
YCJ
Rejo
o
Re-j
o
Z-Plane
Unit circle
H(z) = G/(1- Rejoz-1)(1- Re-joz-1)
= G/(1-2Rcos(o)z-1 + R2z-2)
H() = G/(1- Rejo e-j)(1- Re-joe-j)
G: normalize H(o) = 1
76
8/11/2019 Typical Real Time DSP System
76/86
Digital Signal Processing
YCJ
Second-Order Filter & Resonator
|H()|2 = G/(1- 2Rcos(o) + R2)(1- 2Rcos(+o) + R2)
|H()|2
2(1-R)
(3 dB bandwidth)1
1/2
o
77
Second-Order Filter & Resonator
8/11/2019 Typical Real Time DSP System
77/86
Digital Signal Processing
YCJ
Transfer Function: H(z) = G/(1- 2Rcos(o) z-1 + R2z-2)
Impulse Response: h[n] = [G/sin(o)] Rnsin(n
o)
Difference Equation: y[n] = 2Rcos(o)y[n-1] - R2y[n-2] Gx[n]
G
-a1
-a2
y[n]x[n]
z-1+
y[n-1]z-1
a1 = -2Rcos(o)
a2 = R2
y[n-2]
78
8/11/2019 Typical Real Time DSP System
78/86
Digital Signal Processing
YCJ
Second-Order Filter & ResonatorExample:
Design a 2-pole resonator filter with peak frequencyfo = 500 Hz, and 3-dB bandwidth f = 32 Hz.The sampling frequency is fs = 10KHz.
R = 0.99, G = 0.0062,
a1= -1.8831 and a2= 0.9801
H(z) = 0.0062/(1 - 1.8831 z-1 + 0.9801 z-2)
79
Parametric Equalizer
8/11/2019 Typical Real Time DSP System
79/86
Digital Signal Processing
YCJ
Rejo
o
Re-joZ-Plane
Unit circle
p1=R ejo p1
*=R e-jo
z1=r ejo z1
*=r e-jo
H(z) = (1- rejoz-1)(1- re-joz-1) /(1- Rejoz-1)(1- Re-joz-1)
= (1 + b1z-1 + b2z
-2)/(1 + a1z-1 + a2z
-2)
a1 = -2Rcos(o), a2 = R2b1 = -2rcos(o), b2 = r2
H(z) = (1 + b1z-1 + b2z
-2)/(1 + (R/r)b1z-1 + (R/r)2b2z
-2)
80
Parametric Equalizer
8/11/2019 Typical Real Time DSP System
80/86
Digital Signal Processing
YCJ
H(z) = (1 + b1z-1 + b2z
-2)/(1 + (R/r)b1z-1 + (R/r)2b2z
-2)
b1 = -2rcos(o), b2 = r2
|H()|2 = (1- 2rcos(o) + r2)(1- 2rcos(+o) + r2)/(1- 2Rcos(o) + R2)(1- 2Rcos(+o) + R2)
|H()|2
o
81
8/11/2019 Typical Real Time DSP System
81/86
Digital Signal Processing
YCJ
Notch FilterRejo
o
Re-joZ-Plane
Unit circle
Notch Filter:
Zeros on the unit circle
r = 1
H(z) = (1 + b1z-1 + z-2)/(1 + (R)b1z
-1 + R2z-2)
b1 = -2cos(o),
82
8/11/2019 Typical Real Time DSP System
82/86
Digital Signal Processing
YCJ
Notch FilterNotch polynomial N(z) = k(1-ejkz-1)
Real Coefficient N(z) =k(1-2coskz-1 +z-2)
Notch Filter = N(z)/N( -1z)
= (1 + b1z-1 + b2z-2+ + b2z-(M-1) + b1z-M)/(1 +b1z-1 +2b2z-2+ +-(M-1)b2z-(M-1) +Mb1z-M)
Examples 6.4.3, 6.4.4
83
8/11/2019 Typical Real Time DSP System
83/86
Digital Signal Processing
YCJ
Comb Filter
From notch filter moves the zeros inside the poles
H(z) = (1 + rb1z-1 + r2b2z
-2+ + r-(M-1) b2z-(M-1) + rMb1z
-M)/
(1 +b1z-1 +2b2z-2+ +-(M-1)b2z-(M-1) +Mb1z-M)
r and r
8/11/2019 Typical Real Time DSP System
84/86
Digital Signal Processing
YCJ
DTFT, DFT, and FFTFourier Transform Xa() =xc(t)e-jtdt
Discrete Time Fourier Transform X() = nx[n] e-jn
x[n] = xc
(nT) X( T) =(1/T)Xa
()
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
85
Digital Spectral Analysis
8/11/2019 Typical Real Time DSP System
85/86
Digital Signal Processing
YCJ
Frequency Resolution
Mainlobe
Sidelobe
Windowing
Physical Resolution
Computational Resolution
86
The Fast Fourier Transform
8/11/2019 Typical Real Time DSP System
86/86
Digital Signal Processing
YCJ
Decimation in Time (DIT) Algorithm
DIT Butterfly
Decimation in Frequency (DIF) Algorithm
DIF Butterfly
N log(N) Algorithm
Bits Reversal Indexing