Upload
others
View
12
Download
0
Embed Size (px)
Citation preview
German University in Cairo
Faculty of IET
Communication Engineering Department
Dr. Engy Aly Maher
Digital Signal Processing (COMM 602)
Final Assignment
Spring 2020
Full Name:
Student's ID:
Tutorial Number:
TA Name:
CHEATING CASES ARE GRADED ZERO!
Question
Number
1 2 3 4 5 6 7 Total
Obtained
Score
Maximum
Score
Instructions
You should submit the assignment with the cover page.
Solve in the space provided following each problem.
It’s an individual assignment so no grouping is allowed.
The deadline for submitting the assignment will be: June 11/06/2020. The
system will not accept any delayed submission
Important note:
Substitute with the numbers a, b, and c from the first step in your solution
where a, b, and c are given as:
If you have two zeros in your ID, convert the zero to 1
Example: ID=46-2004, then a=2, b=1, c=4
• In case you find in the problem 2a it means 2*a
Example : if your a= 2 then 2a = 4 not 22!!!!
Question 1:
For the following transfer function:
𝐻(𝑧) =5𝑎 − 2𝑏𝑧−1 − 𝑐𝑧−2
(1 − 𝑎𝑧−1)(1 − 0.5𝑧−1 + 0.25𝑧−2)
a) Find the difference equation
b) What is the type of the system?
c) What is the order of the system?
d) Sketch the pole-zero pattern on the Z-plane
e) Is the system stable or not?
f) Implement the transfer function using canonical realization.
g) Find the unit step response if the system is causal
h) Find the first three samples of h(n) using the long division.
------------------------------------------------------------------------------------------------------------
Solution:
Question 2:
(a) Proof the following relations:
(i) Nj
NNN eWWW
2
2/
2 where
(ii) k
N
Nk
N WW
2
(iii) kn
N
nk
N WW 2
2
(b) Compute the DFT of the following signal:
otherwise
nn
nx
0
302
)(
2
(c) Compute the DFT of the four points x(n)=(a b a c) using the linear transformations on
sequence x(n) and X(k). Use the matrix 4W to find the DFT using the relation:
NNN xWX .
Where
)1)(1()1(21
)1(242
12
....1
........
....1
....1
1....111
NN
N
N
N
N
N
N
NNN
N
NNN
N
www
www
www
W and
Nj
N ew
2
(d) Compute the Inverse DFT of the signal: 32102
cos21)( , , , , kkkX
using
the linear transformations on sequence X(k). Use the same matrix 4W to find the IDFT.
------------------------------------------------------------------------------------------------------------
Solution:
Question 3:
(a) Use the decimation in time algorithm to find FFT for the signal: x(n) = [a b a]
(b) Use the decimation in time algorithm to find Inverse FFT for the 4-points:
𝑋(𝑘) = [(1 + √𝑎) 𝑏 (1 − √𝑎) 𝑏 ]
------------------------------------------------------------------------------------------------------------
Solution:
Question 4:
(a) Given the following system:
𝑏𝑦[𝑛] − 𝑎𝑦[𝑛 − 1] + 𝑐𝑦[𝑛 − 2] − 𝑥[𝑛] − 𝑎𝑥[𝑛 − 1] = 0, given that the system
is non-causal.
(i) Find Z-transform of the above system and determine the ROC.
(ii) Find the frequency response, then determine the magnitude and phase
responses
(b) Find the inverse z-transform of: (𝑧) =1
(1+𝑧−1)(1−𝑧−1)2 , given that 𝑥[𝑛] is anti-causal.
(c) Determine the transfer function and the difference equation that describe the system
shown in the figure:
------------------------------------------------------------------------------------------------------------
Solution:
Question 5:
a) Given the analog transfer function: 3410
52
ss
sH(s) . Use the step invariant
method to design a digital filter. Use sampling interval T=1. Find the magnitude
and Phase response.
b) Design a band-pass filter with the cutoff frequencies then 𝜔𝑙 = 0.1𝑏𝜋 , 𝜔𝑙 =
0.5𝑏𝜋 and at least 20 dB of attenuation at 3.01s and 9.0
2s . Determine
the resonance frequency of the designed filter.
c) Use the bilinear transform method to design a low-pass IIR filter with the following
specifications: digital passband edge frequency is 125.0 , the passband ripple is
𝛿𝑝 = 0. abc, the digital stopband edge frequency is 5.0 , and the maximum
stopband ripple is𝛿𝑠 = 0. ab . Realize the resulting digital filter canonical form.
------------------------------------------------------------------------------------------------------------
Solution:
Question 6:
(a) Using a Hamming window with M=5, approximate the following ideal band-pass
filter with a causal linear-phase FIR filter
𝐻𝑑(𝑒𝑗𝜔) = {
0, 0 < |𝜔| < 0.4𝑎𝜋𝑏, 0.4𝑎𝜋 < |𝜔| < 0.6𝑎𝜋0, 0.6𝑎𝜋 < |𝜔| < 𝑎𝜋
(b) Using a Blackman window with M=4, approximate the following ideal band-stop
filter with a causal linear-phase FIR filter
𝐻𝑑(𝑒𝑗𝜔) = {
𝑐, 0 < |𝜔| < 0.4𝑏𝜋0, 0.4𝑏𝜋 < |𝜔| < 0.6𝑏𝜋𝑐, 0.6𝑏𝜋 < |𝜔| < 𝑏𝜋
(b) Repeat Part (a) but using frequency sampling method.
------------------------------------------------------------------------------------------------------------
Solution:
Question 7:
(a) Use the window method with Hamming window to design FIR filter with order
M=4. The desired frequency response is given by:
The frequency response is periodic at the sampling angular frequency 2s .
The cut-off angular frequency c .
(b) For the desired frequency response plotted in part (a), use frequency sampling
method to design the FIR filter if sec]/[6 rads , sec]/[2 radc and the
filter order M=4.
------------------------------------------------------------------------------------------------------------
Solution:
s c
0 c s
|)(| dH
𝑎𝜋
Formula Sheet Common Z-transform Pairs:
Sequence Transform ROC
𝜹[𝒏] 1 𝐴𝑙𝑙 𝑧
𝒖[𝒏] 1
1 − 𝑧−1 |𝑧| > 1
−𝒖[−𝒏 − 𝟏] 1
1 − 𝑧−1 |𝑧| < 1
𝒂𝒏𝒖[𝒏] 1
1 − 𝑎𝑧−1 |𝑧| > |𝑎|
−𝒂𝒏𝒖[−𝒏 − 𝟏] 1
1 − 𝑎𝑧−1 |𝑧| < |𝑎|
𝒏𝒂𝒏𝒖[𝒏] 𝑎𝑧−1
(1 − 𝑎𝑧−1)2 |𝑧| > |𝑎|
−𝒏𝒂𝒏𝒖[−𝒏 − 𝟏] 𝑎𝑧−1
(1 − 𝑎𝑧−1)2 |𝑧| < |𝑎|
𝒂𝒏 𝐜𝐨𝐬[𝝎𝒏 + 𝝋]𝒖[𝒏] cos(𝜑) − 𝑎 cos(𝜔 − 𝜑) 𝑧−1
1 − 2𝑎 cos(𝜔) 𝑧−1 + 𝑎2𝑧−2 |𝑧| > |𝑎|
−𝒂𝒏 𝐜𝐨𝐬[𝝎𝒏 + 𝝋]𝒖[−𝒏 − 𝟏] cos(𝜑) − 𝑎 cos(𝜔 − 𝜑) 𝑧−1
1 − 2𝑎 cos(𝜔) 𝑧−1 + 𝑎2𝑧−2 |𝑧| < |𝑎|
𝟐|𝑨| ∙ (|𝒑|)𝒏 𝐜𝐨𝐬[𝜽𝒑𝒏 + 𝜽𝑨] 𝒖[𝒏] 𝐴
1 − 𝑝𝑧−1+
𝐴∗
1 − 𝑝∗𝑧−1 |𝑧| > |𝑝|
−𝟐|𝑨| ∙ (|𝒑|)𝒏 𝐜𝐨𝐬[𝜽𝒑𝒏 + 𝜽𝑨] 𝒖[−𝒏 − 𝟏] 𝐴
1 − 𝑝𝑧−1+
𝐴∗
1 − 𝑝∗𝑧−1 |𝑧| < |𝑝|
Geometric-sum Formulae:
∑𝜌𝑛𝑏
𝑛=𝑎
= {
𝜌𝑎 − 𝜌𝑏+1
1 − 𝜌, 𝜌 ≠ 1
𝑏 − 𝑎 + 1 , 𝜌 = 1
∑𝜌𝑛∞
𝑛=𝑎
=𝜌𝑎
1 − 𝜌, |𝜌| < 1
∑𝑛𝜌𝑛∞
𝑛=0
=𝜌
(1 − 𝜌)2, |𝜌| < 1
Z-transform Properties:
Property Time domain Z-domain ROC
Notation 𝑥[𝑛] 𝑋(𝑧) ROC: 𝑟1 < |𝑧| < 𝑟2
𝑥1[𝑛] 𝑋1(𝑧) ROC1
𝑥2[𝑛] 𝑋2(𝑧) ROC2
Conjugation 𝑥∗[𝑛] 𝑋∗(𝑧∗) ROC
Time reversal 𝑥[−𝑛] 𝑋(𝑧−1) 1
𝑟2< |𝑧| <
1
𝑟1
Time shifting 𝑥[𝑛 − 𝑘] 𝑧−𝑘𝑋(𝑧)
ROC with possible
inclusion/exception of the points: 𝑧 =
0 and/or 𝑧 = ∞
Z-domain scaling 𝑎𝑛𝑥[𝑛] 𝑋(𝑎−1𝑧) |𝑎|𝑟1 < |𝑧| < |𝑎|𝑟2
Z-domain
differentiation 𝑛𝑥[𝑛] −𝑧
𝑑𝑋(𝑧)
𝑑𝑧 ROC
Linearity 𝛼𝑥1[𝑛] + 𝛽𝑥2[𝑛] 𝛼𝑋1(𝑧) + 𝛽𝑋2(𝑧) At least, ROC1 ∩ ROC2
Convolution 𝑥1[𝑛] ∗ 𝑥2[𝑛] 𝑋1(𝑧)𝑋2(𝑧) At least, ROC1 ∩ ROC2
Unilateral Z-transform Shifting Properties:
Property 𝐱[𝐧] 𝐗+(𝐳)
Time delay 𝑥[𝑛 − 𝑘], 𝑘 > 0 𝑧−𝑘 [𝑋+(𝑧) +∑𝑥[−𝑛]𝑧𝑛𝑘
𝑛=1
]
Time advance 𝑥[𝑛 + 𝑘], 𝑘 > 0 𝑧𝑘 [𝑋+(𝑧) −∑𝑥[𝑛]𝑧−𝑛𝑘−1
𝑛=0
]
Z-transform Theorems:
Initial value theorem: 𝑥[0] = lim𝑧→∞
𝑋+(𝑧)
Or: 𝑥[0] = lim𝑧→∞
𝑋(𝑧) if 𝑥[𝑛] is causal.
Final value theorem: If ROC of (𝑧 − 1)𝑋+(𝑧) includes the unit circle, then 𝑥[∞] = lim𝑧→1(𝑧 − 1)𝑋+(𝑧).
DFT Properties:
Property Time domain Discrete frequency domain
Notation 𝑥[𝑛] =1
𝑁∑ 𝑋[𝑘]𝑒𝑗
2𝜋𝑘𝑛𝑁
𝑁−1
𝑘=0
𝑋[𝑘] = ∑ 𝑥[𝑛]𝑒−𝑗2𝜋𝑘𝑛𝑁
𝑁−1
𝑛=0
𝑥1[𝑛] 𝑋1[𝑘]
𝑥2[𝑛] 𝑋2[𝑘]
Conjugation 𝑥∗[𝑛] 𝑋∗[(−𝑘)𝑁]
Circular time reversal 𝑥[(−𝑛)𝑁] 𝑋[(−𝑘)𝑁]
Circular time shifting 𝑥[(𝑛 − 𝑙)𝑁] 𝑒−𝑗2𝜋𝑘𝑙𝑁 𝑋[𝑘]
Circular frequency shifting 𝑒𝑗2𝜋𝑛𝑙𝑁 𝑥[𝑛] 𝑋[(𝑘 − 𝑙)𝑁]
Linearity 𝛼𝑥1[𝑛] + 𝛽𝑥2[𝑛] 𝛼𝑋1[𝑘] + 𝛽𝑋2[𝑘]
Circular convolution 𝑥1[𝑛]⊛ 𝑥2[𝑛] 𝑋1[𝑘]𝑋2[𝑘]
Multiplication 𝑥1[𝑛]𝑥2[𝑛] 1
𝑁𝑋1[𝑘]⊛ 𝑋2[𝑘]
Parseval’s theorem ∑𝑥1[𝑛]𝑥2∗[𝑛]
𝑁−1
𝑛=0
1
𝑁∑ 𝑋1[𝑘]𝑋2
∗[𝑘]
𝑁−1
𝑘=0
If 𝑥[𝑛] 𝑁−𝐷𝐹𝑇 → 𝑋[𝑘], then
𝑥[𝑛] = 𝑥𝑅𝑒[𝑛] + 𝑥𝑅
𝑜[𝑛] + 𝑗𝑥𝐼𝑒[𝑛] + 𝑗𝑥𝐼
𝑜[𝑛]
𝑋[𝑘] = 𝑋𝑅𝑒[𝑘] + 𝑋𝑅
𝑜[𝑘] + 𝑗𝑋𝐼𝑒[𝑘] + 𝑗𝑋𝐼
𝑜[𝑘]
NNN )x(WX
Inverse Discrete-Time Fourier Transform (IDTFT):
ℎ𝑑[𝑛] =1
2𝜋∫𝐻𝑑(𝑒
𝑗𝜔)𝑒𝑗𝜔𝑛𝑑𝜔
𝜋
−𝜋
N
1
NN X)(Wx and
N
1
N (1/N)W)(W
Low-pass Butterworth Filters:
For |𝐻𝑎(𝑗Ω1)| ≥ 𝐴1 and |𝐻𝑎(𝑗Ω2)| ≤ 𝐴2, the filter order has to satisfy
𝑁 ≥
log (𝐴2−2 − 1𝐴1−2 − 1
)
2 log (Ω2Ω1)
Given that |𝐻𝑎(𝑗Ω1)| = 𝐴1 and |𝐻𝑎(𝑗Ω2)| = 𝐴2, the following relation holds
(Ω2Ω1)2𝑁
=𝐴2−2 − 1
𝐴1−2 − 1
Normalized low-pass prototype filters (Ω𝑐′ = 1):
Order Transfer function
𝟏 1
𝑠 + 1
𝟐 1
𝑠2 + √2𝑠 + 1
𝟑 1
𝑠3 + 2𝑠2 + 2𝑠 + 1
𝟒 1
𝑠4 + 2.6131𝑠3 + 3.4142𝑠2 + 2.6131𝑠 + 1
Frequency transformations for Analog filters:
Transformed filter type Transformation Frequency mapping
Low-pass 𝑠 →𝑠
Ω𝑐 -
High-pass 𝑠 →Ω𝑐𝑠
Ω′ →Ω𝑐Ω
Band-pass 𝑠 →𝑠2 + Ω𝑢Ω𝑙𝑠(Ω𝑢 − Ω𝑙)
Ω′ → |−Ω2 + Ω𝑢Ω𝑙Ω(Ω𝑢 − Ω𝑙)
|
Band-stop 𝑠 →𝑠(Ω𝑢 − Ω𝑙)
𝑠2 + Ω𝑢Ω𝑙 Ω′ → |
Ω(Ω𝑢 − Ω𝑙)
−Ω2 + Ω𝑢Ω𝑙|
Bilinear Transformation:
Ω =2
𝑇tan (
𝜔
2) , 𝑠 =
2
𝑇∙1 − 𝑧−1
1 + 𝑧−1
Common Laplace-transform Pairs:
Signal Transform
𝜹(𝒕) 1
𝒖(𝒕) 1
𝑠
𝒆−𝒂𝒕𝒖(𝒕) 1
𝑠 + 𝑎
𝒕𝒆−𝒂𝒕𝒖(𝒕) 1
(𝑠 + 𝑎)2
𝒕𝒏−𝟏
(𝒏 − 𝟏)!𝒆−𝒂𝒕𝒖(𝒕)
1
(𝑠 + 𝑎)𝑛
𝐜𝐨𝐬(𝝎𝒕)𝒖(𝒕) 𝑠
𝑠2 +𝜔2
𝐬𝐢𝐧(𝝎𝒕)𝒖(𝒕) 𝜔
𝑠2 +𝜔2
𝒆−𝒂𝒕 𝐜𝐨𝐬(𝝎𝒕)𝒖(𝒕) 𝑠 + 𝑎
(𝑠 + 𝑎)2 +𝜔2
𝒆−𝒂𝒕 𝐬𝐢𝐧(𝝎𝒕)𝒖(𝒕) 𝜔
(𝑠 + 𝑎)2 +𝜔2
√𝒄𝟐 + 𝒅𝟐𝒆−𝒂𝒕 𝐜𝐨𝐬 (𝝎𝒕 − 𝐭𝐚𝐧−𝟏 (𝒅
𝒄))𝒖(𝒕)
𝑐(𝑠 + 𝑎) + 𝑑𝜔
(𝑠 + 𝑎)2 +𝜔2, 𝑐 > 0
√𝒄𝟐 + 𝒅𝟐𝒆−𝒂𝒕 𝐜𝐨𝐬 (𝝎𝒕 − 𝐭𝐚𝐧−𝟏 (𝒅
𝒄) + 𝝅)𝒖(𝒕)
𝑐(𝑠 + 𝑎) + 𝑑𝜔
(𝑠 + 𝑎)2 +𝜔2, 𝑐 < 0
𝟐|𝑨|𝒆𝐑𝐞{𝒑}𝒕 𝐜𝐨𝐬(𝐈𝐦{𝒑} 𝒕 + 𝜽𝑨) 𝒖(𝒕) 𝐴
𝑠 − 𝑝+
𝐴∗
𝑠 − 𝑝∗
Window Functions for FIR Filter Design:
Name of window Time-domain sequence
𝟎 ≤ 𝒏 ≤ 𝑴− 𝟏
Hamming 0.54 − 0.46 cos [2𝜋𝑛
𝑀 − 1]
Hanning 0.5 (1 − cos [2𝜋𝑛
𝑀 − 1])
Blackman 0.42 − 0.5 cos [2𝜋𝑛
𝑀 − 1] + 0.08 cos [
4𝜋𝑛
𝑀 − 1]