Upload
unist
View
2
Download
0
Embed Size (px)
Citation preview
EEE238: Digital Signal Processing β Tutorial 1: Sampling and Quantization 2/8
2. Prefiltering and reconstruction
EEE238: Digital Signal Processing β Tutorial 1: Sampling and Quantization 4/8
Solution: Case (b)
Solution: Case (c)
EEE238: Digital Signal Processing β Tutorial 1: Sampling and Quantization 5/8
Solution: Case (c) β continuation
EEE238: Digital Signal Processing β Tutorial 1: Sampling and Quantization 6/8
Solution: Case (c) β continuation
EEE238: Digital Signal Processing β Tutorial 1: Sampling and Quantization 7/8
3. Discrete Time Fourier Transform
Calculate frequency spectrum of the sampled signal.
Solution:
EEE238: Digital Signal Processing β Tutorial 1: Sampling and Quantization 8/8
4. Quantization (specifications)
Solution:
4. Quantization (truncation)
Solution:
EEE238: Digital Signal Processing β Tutorial 2: Discrete Time Systems 1/7
1. Time invariance
Example 3.2.2: Test the time invariance of the discrete-time systems defined by
y(n)= nx(n) and the downsampler y(n)= x(2n).
EEE238: Digital Signal Processing β Tutorial 2: Discrete Time Systems 2/7
2. Time invariance and linearity
Solution:
EEE238: Digital Signal Processing β Tutorial 2: Discrete Time Systems 3/7
3. Impulse response of FIR filters
EEE238: Digital Signal Processing β Tutorial 2: Discrete Time Systems 4/7
4. Impulse response of IIR filters
EEE238: Digital Signal Processing β Tutorial 2: Discrete Time Systems 6/7
5. Difference equation
Solution:
EEE238: Digital Signal Processing β Tutorial 2: Discrete Time Systems 7/7
6. Stability
For each impulse response above determine if the LTI system is stable or not, based on
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 3: FIR filtering and Convolution 1/5
1. Convolution table
Solution:
2. Sample processing (pp. 156-157)
EEE238: Digital Signal and Image Processing β Tutorial 3: FIR filtering and Convolution 3/5
3. Sample processing
Solution: The impulse response is read off from the coefficients of the I/O equation: h=[1,0,-1]
EEE238: Digital Signal and Image Processing β Tutorial 3: FIR filtering and Convolution 4/5
4. Convolution of infinite sequences
EEE238: Digital Signal and Image Processing β Tutorial 3: FIR filtering and Convolution 5/5
5. Index range
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 4: z-Transforms 1/6
1. Transform properties
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 4: z-Transforms 2/6
2. Transform and Region of Convergence (ROC)
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 4: z-Transforms 3/6
3. Transform and Region of Convergence (ROC)
Solution:
4. Inverse transform
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 4: z-Transforms 4/6
5. Inverse transform (partial fraction expansions)
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 4: z-Transforms 6/6
6. Transform of sinusoids
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 5: Transfer Functions 1/7
1. Frequency response
EEE238: Digital Signal and Image Processing β Tutorial 5: Transfer Functions 4/7
2. Transient response
EEE238: Digital Signal and Image Processing β Tutorial 5: Transfer Functions 5/7
3. Pole/Zero Design
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 5: Transfer Functions 7/7
3. Transfer function
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 6: DFT/FFT Algorithms 1/5
1. Frequency analysis
EEE238: Digital Signal and Image Processing β Tutorial 6: DFT/FFT Algorithms 2/5
2. Discrete Fourier Transform (DFT)
LN
LN
N
L
NN
N
NNN
NNN
WWW
WWW
WWW
A
A
)1)(1()1(0
)1(10
000
xX
with Nj
N eW
2
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 7: FIR & IIR Digital Filter Design 1/3
1. FIR Digital Filter Design (impulse responses)
By performing the appropriate integrations in the inverse DTFT equation, calculate the impulse response d(k) of the bandpass, lowpass and highpass ideal filters
.
EEE238: Digital Signal and Image Processing β Tutorial 7: FIR & IIR Digital Filter Design 2/3
2. FIR Digital Filter Design (using slides 21-23 of Lecture 7)
EEE238: Digital Signal and Image Processing β Tutorial 7: FIR & IIR Digital Filter Design 3/3
3. IIR Digital Filter Design
Solution:
EEE238: Digital Signal and Image Processing β Tutorial 8: Enhancement and Mathematical Morphology 1/3
1. Consider the 3-bit image A of Figure 1. For the questions below, assume that pixel values outside
the image boundaries have a zero grey level. In addition, round the output image pixel values to
the nearest integer (nint[] operator).
132
564
213
A
Figure 1: Image A.
By processing the input image A, determine the output
(a) image B resulting from a linear contrast scaling;
031
674
103
132
564
213
:Solution
14.1nint124.1nint14.1nint
:Example
14.1nint15
7nint1
16
12nint)min(
)min()max(
1nint
:Equation
1313
3
BA
AB
AAAAAAA
LB
scalingcontrastlinear
ijijijijij
(b) image C resulting from a thresholding at standard deviation of A;
011
111
101
132
564
213
:Solution
6330.13)(because1
:Example
otherwise0
if1
1.6330
)31()33()32()35()36()34()32(31)33(33
1
1,3132564213
33
11
:Equations
)(
3232
222222222
,
2
,
CA
AC
AC
AMN
AMN
AAngthresholdi
A
Aij
ij
A
A
ji
AijA
ji
ijA
EEE238: Digital Signal and Image Processing β Tutorial 8: Enhancement and Mathematical Morphology 2/3
(c) image C resulting from a 3x3 smoothing;
222
232
222
00000
0
0
0
132
564
213
0
0
0
00000
:Solution
21.5556nint9
64013000nint
:Example
1nint
:Equation
smoothing33
11
1
1
1
1
,
CA
C
CMN
Cm n
njmiij
(d) image D resulting from a 3x3 median filtering.
020
132
020
00000
0
0
0
132
564
213
0
0
0
00000
:Solution
3)6,5,4,3,3,2,1,,1(median
:Example
filteringmedian33
22
DA
D
EEE238: Digital Signal and Image Processing β Tutorial 8: Enhancement and Mathematical Morphology 3/3
2. Consider the binary image A and the structuring element B of Figure 2.
010
111
010
,
000000
000100
001110
011100
001000
000000
BA
Figure 2: Binary image and structuring element.
(a) Determine the morphological dilation of A by B;
π΄β¨π΅ = β (π΅)ππππ΄ where (B)a is the structuring element translated by a
Solution:
000100
001110
011111
111110
011100
001000
,
010
111
010
,
000000
000100
001110
011100
001000
000000
BABA
(b) Determine the morphological erosion of A by B.
π΄ β π΅ = π§ |(π΅)π§ β π΄
Solution:
000000
000000
000100
001000
000000
000000
,
010
111
010
,
000000
000100
001110
011100
001000
000000
BABA
Midterm Examination (Lecture Section 2, Fall 2015), EEE 238 DIGITAL SIGNAL AND IMAGE PROCESSING
Page 1 of 5
NAZARBAYEV UNIVERSITY
School of Engineering
Midterm Examination
(Lecture Section 2, Fall 2015)
EEE 238 DIGITAL SIGNAL AND IMAGE PROCESSING
Date: Monday, October 19, 2015 Time: 11:00 AM β 12:50 PM
Student name:
Student ID:
All questions carry indicated marks, you can obtain a maximum of 100 marks.
Only handwritten notes are permitted.
The use of calculators approved by the School of Engineering is permitted.
PLEASE WRITE YOUR ANSWERS ON THIS EXAMINATION
QUESTION PAPER. IT WILL BE COLLECTED AT THE END OF
THIS EXAMINATION.
Midterm Examination (Lecture Section 2, Fall 2015), EEE 238 DIGITAL SIGNAL AND IMAGE PROCESSING
Page 2 of 5
1. Determine the impulse response β(π) of the filters:
(a) π¦(π) = π₯(π) + π₯(π β 1) [5 marks]
(b) π¦(π) = π₯(π) + 2π₯(π β 1) + 4π₯(π β 2) [5 marks]
Answers:
(a)
β(π) = πΏ(π) + πΏ(π β 1)
(b)
β(π) = πΏ(π) + 2πΏ(π β 1) + 4πΏ(π β 2)
2. Compute the convolution, π² = π‘ β π±, of the filter impulse response π‘ and input signal π±:
π‘ = [3 2 1], π± = [ 1 2 1 0 1 3 ]
using the convolution table method. [10 marks]
Answer:
h\x 1 2 1 0 1 3
3 3 6 3 0 3 9
2 2 4 2 0 2 6
1 1 2 1 0 1 3
π² = [3, 8, 8, 4, 4, 11, 7, 3]
Midterm Examination (Lecture Section 2, Fall 2015), EEE 238 DIGITAL SIGNAL AND IMAGE PROCESSING
Page 3 of 5
3. Determine the Discrete Time Fourier Transform (DTFT) of
(a) π₯(π) = (0.5)π π’(π) [10 marks]
(b) π₯(π) = πΏ(π β 3) [5 marks]
(c) π₯(π) = ((0.4)π π’(π)) β πΏ(π β 2) [5 marks]
(d) π₯(π) = ((0.3)π π’(π)) π€(π) [5 marks]
where π’(π) and πΏ(π) are the step function and the unit impulse function, respectively. Note
that π€(π) is an arbitrary window. For questions (a) and (b), justify mathematically your
answer by using the DTFT equation: π(π) = β π₯(π)πβπππβπ=ββ .
Answers:
(a)
π(π) = β π₯(π)πβπππ
β
π=ββ
= β (0.5)ππ’(π)πβπππ
β
π=ββ
π(π) = β(0.5)ππβπππ =
β
π=0
β(0.5πβππ)π
=1
1 β 0.5πβππ
β
π=0
(b)
π(π) = β π₯(π)πβπππ
β
π=ββ
= β πΏ(π β 3)πβπππ
β
π=ββ
= β πβπππ =
3
π=3
πβπ3π
(c)
π(π) =1
1 β 0.4πβπππβπ2π
(d)
π(π) =1
1 β 0.3πβππβ π(π)
Midterm Examination (Lecture Section 2, Fall 2015), EEE 238 DIGITAL SIGNAL AND IMAGE PROCESSING
Page 4 of 5
4. Determine the z-transform of
(a) π₯(π) = πππ0π π’(π) [10 marks]
(b) π₯(π) = sin(π0π) π’(π) [15 marks]
(c) π¦(π) = ((0.5)ππ’(π)) β πΏ(π β 2) [5 marks]
where π’(π) and πΏ(π) are the step function and the unit impulse function, respectively. For
questions (a) and (b), justify mathematically your answers by using the z-transform equation:
π(π§) = β π₯(π)π§βπβπ=ββ . To simplify your result for question (b), you must use Eulerβs
formula for sine and cosine.
Answers:
(a)
π(π§) = β π₯(π)π§βπ
β
π=ββ
= β πππ0π π’(π)π§βπ
β
π=ββ
= β πππ0π π§βπ
β
π=0
π(π§) = β(πππ0 π§β1)π =1
1 β πππ0 π§β1
β
π=0
(b)
π(π§) = β π₯(π)π§βπ
β
π=ββ
= β sin (π0π)π’(π)π§βπ =
β
π=ββ
βπππ0π β πβππ0π
2π
β
π=0
π§βπ
π(π§) =1
2π(β πππ0ππ§βπ
β
π=0
β β πβππ0ππ§βπ
β
π=0
) =1
2π(β(πππ0π§β1)
πβ
π=0
β β(πβππ0π§β1)π
β
π=0
)
π(π§) =1
2π(
1
1 β πππ0π§β1β
1
1 β πβππ0π§β1) =
1
2π(
1 β πβππ0π§β1 β 1 + πππ0π§β1
(1 β πππ0π§β1)(1 β πβππ0π§β1))
π(π§) =1
2π(
(πππ0 β πβππ0)π§β1
1 β πβππ0π§β1 β πππ0π§β1 + πππ0πβππ0π§β2) =
πππ0 + πβππ0
2π π§β1
1 β 2πππ0 + πβππ0
2 π§β1 + π§β2
π(π§) =sin (π0)π§β1
1 β 2cos (π0)π§β1 + π§β2
(c)
π(π§) = π§β2
1 β 0.5 π§β1
Midterm Examination (Lecture Section 2, Fall 2015), EEE 238 DIGITAL SIGNAL AND IMAGE PROCESSING
Page 5 of 5
5. Consider the filter transfer function
π»(π§) =1 β π§β1
1 β 0.6 π§β1
(a) Determine the magnitude spectrum |π»(π)|. [10 marks]
(b) Find the Input/Output difference equation from π»(π§). [10 marks]
(c) Draw the block diagram realization. [5 marks]
Answers:
(a)
π»(π§) =1 β π§β1
1 β 0.6 π§β1|
π§ = πππ
, π»(π) =1 β πβππ
1 β 0.6πβππ
|1 β ππβππ| = |1 β acos π β πasin π| = β(1 β acos π)2 + (β asin π)2
|1 β ππβππ| = β1 β 2 acos π + π2cos2 π + π2sin2 π = β1 β 2 acos π + π2(cos2 π + sin2 π)
|1 β ππβππ| = β1 β 2 acos π + π2
|π»(π)| = |1 β πβππ
1 β 0.6πβππ| =
β1 β 2 cos π + 1
β1 β 1.2 cos π + 0.36
|π»(π)| =β2 β 2 cos π
β1.36 β 1.2 cos π
(b)
π»(π§) =π(π§)
π(π§)=
1 β π§β1
1 β 0.6 π§β1
π(π§)(1 β 0.6π§β1) = π(π§)(1 β π§β1)
π(π§) β 0.6π(π§) π§β1 = π(π§) β π(π§)π§β1
π(π§) = 0.6π(π§) π§β1 + π(π§) β π(π§)π§β1
π¦(π) = 0.6π¦(π β 1) + π₯(π) β π₯(π β 1)
(c)
THIS IS THE END OF THE EXAMINATION
Assignment 6
Sanzhar Askaruly
October 29, 2015
Problem 1.a. Determine the Laplace transfer function Ha(s) in terms of Ξ± and Ξ©0, whereΞ± = R
Lis a coefficient and Ξ©0 = 1/
βLC is the angular analog cutoff frequency.
Figure 1: Analog filter circuit
Proof. I = VinR+ 1
sC+sL
Ha(s) = 1RCs+s2LC+1
= 1s2LC+sRC+1
1/LC1/LC
= 1/LCs2+Rs/L+1/LC
=Ξ©2
0
s2+Ξ±s+Ξ©20
Problem 1.b. Calculate the value of the analog cutoff frequency in hertz f0.
Proof. Ξ©0 = 2Οf0 = 1/ 2βLC
f0 = 1
2Ο 2βLC= 1
2Ο2β
10β60.253310β3= 1
s2LC+sRC+11/LC1/LC
= 1/LCs2+Rs/L+1/LC
=Ξ©2
0
s2+Ξ±s+Ξ©20
= 10000
f0=10 kHz
Problem 1.c. Determine the analog filter magnitude spectrum |Ha(Ξ©)| by setting s=jΞ© inHa(s), where Ξ© is the angular frequency.
Proof. Ha(s)=Ξ©2
0
s2+Ξ±s+Ξ©20=
Ξ©20
βΞ©2+Ξ±Ξ©j+Ξ©20
G2B=|Ha(Ξ©)|2=
Ξ©40
(Ξ©20βΞ©2)2+(Ξ±Ξ©)2
|Ha(Ξ©)|= Ξ©20
2β
(Ξ©20βΞ©2)2+(Ξ±Ξ©)2
Problem 1.d. Apply the bi-linear transformation by setting s=K 1βzβ1
1+zβ1 in Ha(s) and de-termine the coefficients b0, b1, b2, a0, a1, a2 in terms of K, Ξ± and Ξ©0.
1
2
Problem 1. Part D
π»! π =πΊ!!
π ! + πΌπ + πΊ!!=
πΊ!!
πΎ! 1β π§!!1+ π§!! ! + πΌπΎ 1β π§!!
1+ π§!! + πΊ!! 1+ π§!! !
1+ π§!! !
=πΊ!! 1+ π§!! !
πΎ! 1β π§!! ! + πΌπΎ 1β π§!! 1+ π§!! + πΊ!! 1+ π§!! ! =
=πΊ!! + 2πΊ!!π§!! + πΊ!!π§!!
πΎ! + πΌπΎ + πΊ!! + 2 πΊ!! β πΎ! π§!! + πΎ! β πΌπΎ + πΊ!! π§!!Γ
1πΎ! + πΌπΎ + πΊ!!
1πΎ! + πΌπΎ + πΊ!!
=
πΊ!!πΎ! + πΌπΎ + πΊ!!
+ 2πΊ!!π§!!πΎ! + πΌπΎ + πΊ!!
+ πΊ!!π§!!πΎ! + πΌπΎ + πΊ!!
1+ 2 πΊ!! β πΎ!
πΎ! + πΌπΎ + πΊ!!π§!! + πΎ
! β πΌπΎ + πΊ!!πΎ! + πΌπΎ + πΊ!!
π§!!
Therefore,
π! =!!!
!!!!"!!!! π! =
!!!!
!!!!"!!!!; π! =
!!!
!!!!"!!!!
π! = 2 !!!!!!
!!!!"!!!!; π! =
!!!!"!!!!
!!!!"!!!!
Problem 1. Part E
πΎ =2ππ!πππ‘ ππ!
π!= 2π10! cot π10!/10! = 1.934Γ10!
πΌ =π πΏ = 78.958Γ10!
Ξ©! =1πΏπΆ
= 62,832
π! =Ξ©!!
π = 0.0697 = π!
π! = 2π! = 0.1395 π! = β1.1816 π! = β0.4606
Problem 1. Part F
π» π§ =0.0697π§! + 0.13957π§ + 0.0697
π§! β 1.1816π§ + 0.4606
To find poles and zeros: Numerator (zeros):
0.0697π§! + 0.13957π§ + 0.0697 = 0 0.0697 π§! + 2π§ + 1 = 0
π§ = β1 Denominator (poles):
π§! β 1.1816π§ + 0.4606 = 0 D = 0.6680j
π§!,! = 0.5908Β± 0.3340π
3
Problem 1. Part G f_s=100e+3; %sampling frequency f_0=10e+3; %cutoff frequency f=[logspace(0,5,199)] %range of frequency %Analog filter w_a=2*pi*f;%analog frequency %H_a(f) hAnalog=(62832^2)./(62832^2-w_a.^2+1j*78958*w_a) analogDB=20.*log10(abs(hAnalog)); %magnitude in dB %Digital filter w=2*pi.*f/f_s; %digital cutoff angular frequency %H(z) shown with e^(-jw) hDigital=(0.0697+0.1395*exp(-1j*w)+0.0697*exp(-2*1j*w))./(1-1.1816*exp(-1j*w)+0.4606*exp(-1j*w)); digitalDB=20.*log10(hDigital); %magnitude in dB figure; semilogx(f, analogDB, f, digitalDB); legend('Analog filter', 'Digital filer'); title('Analog and Digital Filter Magnitude Spectrum'); xlabel('f(kHz)') ylabel('H(dB)') axis([10^0 5*10^4 -100 10]) grid on
100 101 102 103 104
f(kHz)
-100
-90
-80
-70
-60
-50
-40
-30
-20
-10
0
10
H(d
B)
Analog and Digital Filter Magnitude Spectrum
Analog filterDigital filer