Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
Digital Signal ProcessingYCJ
1
A Typical DSP System
Sampling&
A/D
AnalogPre-filterHPRE(f)
x(t) x[n]xa(t)Analog
inDSPFilter
HDSP(z)
Analogout
AnalogPost-filterHPOST(f)
D/AConverter
HDAC(f)
ya(t) y(t) y[n]
Digital Signal ProcessingYCJ
2
Analog Signal Processing
xa(t) : an analog signal
Xa(Ω) = ∫ xa(t)e-jΩt dt is its Fourier transform
The inverse Fourier transform is
xa(t) = (1/2π)∫ Xa(Ω) ejΩt dΩ
Digital Signal ProcessingYCJ
3
Analog Signal ProcessingAnalogFilterHa(Ω)
ya(t)xa(t)
Ha(Ω) is the Fourier transform of the impulse response, ha(t), of the filter
ya(t) = ∫ ha(t-τ) xa(τ) dτ
OR, equivalently, in frequency domain
Ya(Ω) = Ha(Ω) Xa(Ω)
Digital Signal ProcessingYCJ
4
A Typical DSP SystemA Typical DSP System
AnalogPre-filterHPRE(f)
Sampling&
A/DDSPFilter
HDSP(z)D/A
ConverterHDAC(f)
AnalogPost-filterHPOST(f)
xa(t) x(t) x[n]
ya(t) y(t) y[n]
Digital Signal ProcessingYCJ
5
A digital Spectral Analyzer
AnalogPre-filterHPRE(f)
Sampling&
A/D
FFTProcessor
Displaythe
Spectrum
xa(t) x(t)
Digital Signal ProcessingYCJ
6
Linear Time-Invariant Systems•The delta function: δ(t)
•Linearity
•Time-invariant
•The Impulse Response
•The Convolution Integral
•The Convolution Theorem
Digital Signal ProcessingYCJ
7
Sinusoidal Response of LTI System
ejΩt Ha(Ω) ejΩtHa(Ω)
Ha(Ω) = |Ha(Ω)| e jARGHa(Ω)
Ha(Ω1) A1ejΩ1t
+ Ha(Ω2) A2ejΩ2tA1ejΩ1t
+A2ejΩ2tHa(Ω)
Digital Signal ProcessingYCJ
8
Linear FilteringXa(Ω)
Ω=2πf
Ya(Ω)
Ω=2πf
Digital Signal ProcessingYCJ
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
Digital Signal ProcessingYCJ
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 ProcessingYCJ
11
Fourier Transform and The DTFTIf Xa(Ω) = ∫ xa(t)e-jΩt dt and x[n] = xa(nT)Then X(ΩΤ) = (1/T) Σk Xa(Ω - k2π/T)
-4πfs -2πfs 0 2πfs 4πfs
1/T
0
Xa(Ω)
Ω
X(ΩΤ)
Ω
Digital Signal ProcessingYCJ
12
Aliasing
Ω-4πfs -2πfs 0 2πfs 4πfs
X(Ω)
0-4πfs -2πfs 2πfs 4πfs Ω
Digital Signal ProcessingYCJ
13
AliasingCos(Ω t) = ½(ejΩt + e-jΩt )
-4πfs -2πfs 0 2πfs 4πfs Ω
-4πfs -2πfs 0 2πfs 4πfs Ω
Digital Signal ProcessingYCJ
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 ProcessingYCJ
15
Anti-Aliasing Filter
A(f)
ffpass fs/2 fstop
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 ProcessingYCJ
16
DAC & Analog Reconstruction
D/AConverter
HDAC(f)y[n] ya(t)
ya(t) = Σn y[n] hDAC(t-nT)
Ya(Ω) = Y(ω) |ω=ΩΤ HDAC(Ω)
Digital Signal ProcessingYCJ
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/20, otherwise
h(t) = u(t) - u(t-T) =
H(f) = (T/j) [Sin(πfT)/(πfT)]t
f
Digital Signal ProcessingYCJ
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
Digital Signal ProcessingYCJ
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/2f
-fs/2
•Removing high frequency images•Equalizing D/A converter’s in-band distortion
•(may be done digitally)• -20 log[H(fs/2)/H(0)] ~ 3.9 dB
Digital Signal ProcessingYCJ
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
Digital Signal ProcessingYCJ
21
A/D Converter & Quantization
R: fu
ll sc
ale
R/23Q2QQ0
-Q-2Q-3Q-R/2
R/Q = 2BQ: step size
Digital Signal ProcessingYCJ
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
Digital Signal ProcessingYCJ
23
Signal to Noise Ratio: SNR
Noise Power = Q2/12Signal Power = ?Assuming Sine Wave -> Signal Power = A2/2Assuming Full Scale -> A = R/2 -> Signal Power = R2/8Assuming 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
Digital Signal ProcessingYCJ
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 ProcessingBlock Processing
Digital Signal ProcessingYCJ
25
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 xDO y = 2x + 3w1 + 4w2
w2 = w1w1 = x
CONTINUE
Digital Signal ProcessingYCJ
26
Block Processingy[n] = 2x[n] + 3x[n-1] + 4x[n-2]
y[0] 2 0 0 0 0y[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 ProcessingYCJ
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 ProcessingYCJ
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 ProcessingYCJ
29
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 xDO y = 0.5w + 2x + 3v
w = yv = x
CONTINUE
Digital Signal ProcessingYCJ
30
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]
Digital Signal ProcessingYCJ
31
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]
Digital Signal ProcessingYCJ
32
Impulse Response of an LTI System
δ[n] = 1, for n=0, and 0, otherwise
h[n]δ[n]
H nn
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 ProcessingYCJ
33
Convolutionh[n]δ[n]
H nnh[n-1]
δ[n-1]
H nnh[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] +
Digital Signal ProcessingYCJ
34
FIR and IIR FiltersAn 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 ProcessingYCJ
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] = anu[n]
Digital Signal ProcessingYCJ
36
Causality and StabilityA causal sequence is a right-sided sequence, and an anti-causalsequence 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]| < ∞
Digital Signal ProcessingYCJ
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+1and 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 ProcessingYCJ
38
Linear Convolution: Flip & Slide
h3 h2 h1 h0 → h3 h2 h1 h0 → h3 h2 h1 h0
0 0 0 x0 x1 x2 x3 … xn-3 xn-2 xn-1 xn xL-1 0 0 0
y0 yn yL-1+M
h = M+1x = L
y = h*x = L M
Digital Signal ProcessingYCJ
39
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]
n0 M L-1 L-1+M
Digital Signal ProcessingYCJ
40
Convolution of Infinite Sequencey[n] = Σm=max(0,n—L+1)
min(n,M) h[m]x[n-m]
Infinite filter, finite input: M = ∞, L < ∞y[n] = Σm=max(0,n—L+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 ProcessingYCJ
41
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
Digital Signal ProcessingYCJ
42
Finite filter, Infinite inputSample Processing
y[n] = Σm=max(0,n—L+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 DOw0 = xy = h0w0 + h1w1 + h2w2 +….. hMwM
wM = wM-1wM-1 = wM-2||w1 = w0
Digital Signal ProcessingYCJ
43
Circular Buffers
yx h0
h1
w0
w1
h2
h3
w2
w3
XMAC: Multiply & Accumulate
Σ
Digital Signal ProcessingYCJ
44
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.
Digital Signal ProcessingYCJ
45
Basic Properties of Z-transformLinearity:
Za1x1[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)
Digital Signal ProcessingYCJ
46
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|
Digital Signal ProcessingYCJ
47
ROC: Region of Convergence
ROC: 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 generalanu[n] → X(z) = 1/(1-a z-1) if |z| > |a|-anu[-n-1] → X(z) = 1/(1-a z-1) if |z| < |a|
Digital Signal ProcessingYCJ
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
III
III
Digital Signal ProcessingYCJ
49
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
Digital Signal ProcessingYCJ
50
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
Digital Signal ProcessingYCJ
51
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
Digital Signal ProcessingYCJ
52
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]|<∞Therefore, its ROC contain the unit circle.
If H(z)’s ROC contains the unit circleThen Σn=-∞
∞ h[n]z-n ||z|=1= Σn=-∞∞ |h[n]| < ∞
Therefore, H is stable.
Digital Signal ProcessingYCJ
53
Stable and Causal SequenceStable and Causal: All poles are inside the unit circle
Z-plane
Causal ROCunit circle
Digital Signal ProcessingYCJ
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 ProcessingYCJ
55
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
Digital Signal ProcessingYCJ
56
Stable System
An LTI system is stable if and only if
H(z)’s ROC contains the unit circle.
Digital Signal ProcessingYCJ
57
Inverse Z-transformBy 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/systemX(z) =A1/(1-p1 z-1) + A1
*/(1-p1* z-1) if |z| > |p1|
where A1 = B1ejα1 and p1 = R1ejω1
→ x[n] = 2B1R1ncos(nω1+α1)u[n]
X(z) = [2B1cos(α1)-2B1R1cos(α1-ω1) z-1]/[1-2R1cos(ω1) z-1+R12z-2 ]
Digital Signal ProcessingYCJ
58
Inverse Z-transformPartial 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-p1 z-1)(1-p2 z-1)….. /(1-pM z-1)= A1/(1-p1 z-1)+ A2/(1-p2 z-1)+…. AM/(1-pM z-1)Ak = (1-pk z-1)X(z)|z=pk
• N(z) is of degree N & D(z) is of degree M, M<N, Complex Roots
X(z) = Σk [Ak/(1-pk z-1) + Ak*/(1-pk
* 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, M≥N, Complex Roots
Digital Signal ProcessingYCJ
59
Frequency Response & Z-Transform
The DTFT (Discrete-Time Fourier Transform)
X(ω) = Σn=-∞∞ x[n]e-jωn X(z) = Σn=-∞
∞ x[n]z-n
X(ω) = X(z)|z=ejω
The Inverse DTFT x[n] = (1/2π)∫−π
π X(ω)ejωndω
The Frequency Response of the LTI SystemH(ω) = Σn=-∞
∞ h[n]e-jωn
⇒ Y(ω)= H(ω)X(ω)
Digital Signal ProcessingYCJ
60
Parseval Theorem
Σn=-∞∞ |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
Digital Signal ProcessingYCJ
61
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
Digital Signal ProcessingYCJ
62
Transfer Function of an LTI SystemBlock Processing
ImpulseResponse h[n] I/O Convolution
Equation
TransferFunction H(z) Pole/zero
PatternI/O Difference Equation
FrequencyResponse
Specification
FilterDesign Block Diagram
Realization
Sample Processing
Digital Signal ProcessingYCJ
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)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)
Digital Signal ProcessingYCJ
64
An Example - Continued
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
Digital Signal ProcessingYCJ
65
An Example - ContinuedFrequency 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
355/3
ωπ
Digital Signal ProcessingYCJ
66
Direct & Canonical FormsH(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
Digital Signal ProcessingYCJ
67
Direct FormY(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
Digital Signal ProcessingYCJ
68
Canonical FormY(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
Digital Signal ProcessingYCJ
69
ExamplesExample 6.2.1: Impulse response: h = 1, 6, 11, 6Difference 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 ProcessingYCJ
70
Sinusoidal Steady State Response
x[n] = ejωon → DTFT: X(ω) = 2π δ(ω−ωο) + replicas→ Y(ω) = H(ω)X(ω) = H(ωο)2π δ(ω−ωο) + replicas→ y[n] = H(ωο) ejωon
i.e., ejωon → H→ H(ωο) ejωon = |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 Aejω1n +Bejω2n → H→ A H(ω1) ejω1n +B H(ω2) ejω2n
Digital Signal ProcessingYCJ
71
Sinusoidal Transient Response
Input: x[n] = ejωon u[n] → : X(z) = 1/(1- ejωo z-1)
LTI system: H(z) = N(z)/D(z) (assuming real poles)= N(z)/(1-p1 z-1)(1-p2 z-1)…..(1-pM z-1)
all |pk| < 1, k = 1, 2, …., M
Output: Y(z) = X(z)H(z) = N(z)/(1- ejωo z-1)(1-p1 z-1)(1-p2 z-1)…..(1-pM z-1)
= H(ωο) /(1- ejωo z-1) + A1/(1-p1z-1) + A2/(1-p2z-1) + ….. AM/(1-pMz-1)
→ y[n] = H(ωο) ejωon + A1p1n + A2p2
n + ….. AMpMn u[n]
as n → ∞ y[n] → H(ωο) ejωon
Digital Signal ProcessingYCJ
72
Sinusoidal Transient Response
Example: H(z) = (5+2z-1)/(1-0.8z-1)Y(z) = (5+2z-1)/(1- ejωo z-1)(1-0.8z-1)
Observation:1. Stability of the Filter2. Effective Time Constant: neff
ρ = maxk|pk|, ρ neff = ε neff = ln(ε )/ln(ρ)
Example 6.3.2
Digital Signal ProcessingYCJ
73
Unit Step ResponseInput: x[n] = ejωon u[n], ωο = 0 → : X(z) = 1/(1- z-1)
LTI system: H(z) = N(z)/D(z) (assuming real poles)= N(z)/(1-p1 z-1)(1-p2 z-1)….. /(1-pM z-1)
all |pk| < 1, k = 1, 2, …., M
Output: Y(z) = X(z)H(z) = N(z)/(1-z-1)(1-p1 z-1)(1-p2 z-1)…..(1-pM z-1)
= H(1) /(1- z-1) + A1/(1-p1z-1) + A2/(1-p2z-1) + ….. AM/(1-pMz-1)
→ y[n] = H(1) + A1p1n + A2p2
n + ….. AMpMn u[n]
as n → ∞ y[n] → H(1)u[n]→ H(1) = Σn=0
∞ h[n] is the DC gain
Digital Signal ProcessingYCJ
74
Pole/Zero Designs
First Order FilterH(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)
Digital Signal ProcessingYCJ
75
Second-Order Filter & Resonator
Rejωo
ωo
Re-jωo
Z-Plane
Unit circle
H(z) = G/(1- Rejωo z-1)(1- Re-jωoz-1)= G/(1-2Rcos(ωo)z-1 + R2 z-2)
H(ω) = G/(1- Rejωo e-jω)(1- Re-jωoe-jω)
G: normalize H(ωo) = 1
Digital Signal ProcessingYCJ
76
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 π
Digital Signal ProcessingYCJ
77
Second-Order Filter & ResonatorTransfer Function: H(z) = G/(1- 2Rcos(ωo) z-1 + R2 z-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-1a1 = -2Rcos(ωo)
a2 = R2
y[n-2]
Digital Signal ProcessingYCJ
78
Second-Order Filter & ResonatorExample: Design a 2-pole resonator filter with peak frequency fo = 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)
Digital Signal ProcessingYCJ
79
Parametric Equalizer
Rejωo
ωo
Re-jωoZ-Plane
Unit circle
p1=R ejωo p1*=R e-jωo
z1=r ejωo z1*=r e-jωo
H(z) = (1- rejωo z-1)(1- re-jωoz-1) /(1- Rejωo z-1)(1- Re-jωoz-1)= (1 + b1z-1 + b2z-2 )/(1 + a1z-1 + a2z-2 )
a1 = -2Rcos(ωo), a2 = R2
b1 = -2rcos(ωo), b2 = r2
H(z) = (1 + b1z-1 + b2z-2 )/(1 + (R/r)b1z-1 + (R/r)2b2z-2 )
Digital Signal ProcessingYCJ
80
Parametric EqualizerH(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
Digital Signal ProcessingYCJ
81
Notch Filter
Rejωo
ωo
Re-jωoZ-Plane
Unit circleNotch Filter:
Zeros on the unit circler = 1
H(z) = (1 + b1z-1 + z-2 )/(1 + (R)b1z-1 + R2z-2 )b1 = -2cos(ωo),
Digital Signal ProcessingYCJ
82
Notch Filter
Notch polynomial N(z) = Πk(1-ejωk z-1)Real Coefficient N(z) = Πk(1-2cosωk z-1 +z-2)
Notch Filter = N(z)/N(ρ -1 z)= (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
Digital Signal ProcessingYCJ
83
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 < ρ
Digital Signal ProcessingYCJ
84
DTFT, DFT, and FFT• Fourier Transform Xa(Ω) = ∫ xc(t)e-jΩt dt
• Discrete Time Fourier Transform X(ω) = Σn x[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
Digital Signal ProcessingYCJ
85
Digital Spectral Analysis
Frequency ResolutionMainlobeSidelobeWindowing
Physical Resolution
Computational Resolution
Digital Signal ProcessingYCJ
86
The Fast Fourier Transform
Decimation in Time (DIT) AlgorithmDIT Butterfly
Decimation in Frequency (DIF) AlgorithmDIF Butterfly
N log(N) Algorithm
Bits Reversal Indexing