The Islamic University of Gaza Faculty of Engineering Electrical Engineering Department Digital Signal Processing Lab EELE 4110
The Islamic University of Gaza Faculty of Engineering Electrical Engineering Department Digital Signal Processing Lab EELE 4110
Faculty of Engineering
Electrical Engineering Department
Digital Signal Processing Lab
EELE 4110
Prepared by:
Sanabel Nasser El-Haddad 220170536
Submitted for:
Eng. Nada N. Awadallah
Gaza, Palestine
Lab Exercises
Exercise (1)
I. Theoretical calculations:
𝜋 𝜋 1 3𝜋
𝑥(𝑛) = 2 + 2 × 𝑐𝑜𝑠 ( 𝑛) + 𝑐𝑜𝑠 ( 𝑛) + 𝑐𝑜𝑠 ( 𝑛)
4 2 2 4
1
𝑓1 = 𝑁1 = 8
8
1
𝑓2 = 𝑁2 = 4
4
3
𝑓3 = 𝑁3 = 8
8
𝑷𝒆𝒓𝒊𝒐𝒅 𝒐𝒇 𝒕𝒉𝒆 𝒔𝒊𝒈𝒏𝒂𝒍 → 𝑵 = 𝑳𝑪𝑴(𝟖, 𝟒, 𝟖) = 𝟖 𝒔𝒂𝒎𝒑𝒍𝒆
2𝜋 𝜋
𝜔𝑜 = =
𝑁 4
𝑖𝜔𝑜 −𝑖𝜔𝑜
𝑒 𝑖2𝜔𝑜 + 𝑒 −𝑖2𝜔𝑜 𝑒 𝑖3𝜔𝑜 + 𝑒 −𝑖3𝜔𝑜
𝑥(𝑛) = 2 + 𝑒 +𝑒 + +
2 4
𝐶𝑜 = 2 , 𝐶1 = 1 , 𝐶−1 = 𝐶7 = 1 , 𝐶2 = 0.5
𝐶−2 = 𝐶6 = 0.5, 𝐶3 = 0.25 𝐶−3 = 𝐶5 = 0.25
𝐶4 = 0
1
II. Simulated calculations using MATLAB:
1. Observing the fundamental period of the signal "By plotting"
The code (Fig.1)
Note:
𝑥(𝑛) is periodic signal and it repeats its self every eight samples → 𝑁 = 8
2
2. Required to calculate
Part (a)
The code (Fig.3)
3
Note
Parseval's theorem is verified, power of signal = 6.625.
Part (c)
The code (Fig.7)
4
Exercise (2)
I. Theoretical calculations:
1
𝑦(𝑛) = [𝑥(𝑛 + 1) − 𝑥(𝑛 − 1)]
2
1
ℎ(𝑛) = [𝛿(𝑛 + 1) − 𝛿(𝑛 − 1)]
2
1
𝐻(𝜔) = [𝑒 𝑗𝜔 − 𝑒 −𝑗𝜔 ]
2
= 𝑗 × 𝑠𝑖𝑛(𝜔)
|𝐻(𝜔)| = |𝑠𝑖𝑛(𝜔)|
90° , 𝑠𝑖𝑛(𝜔) > 0
∠𝐻(𝜔) = { °
−90 , 𝑠𝑖𝑛(𝜔) < 0
5
The result (Fig.10)
6
The result (Fig.12)
Exercise (3)
I. Theoretical calculations:
𝑦(𝑛) = 𝑥(𝑛) − 𝑥(𝑛 − 2)
ℎ(𝑛) = 𝛿(𝑛) − 𝛿(𝑛 − 2)
𝐻(𝜔) = 1 − 𝑒 −𝑗2𝜔
= 𝑒 −𝑗𝜔 × 2𝑗 × 𝑠𝑖𝑛(𝜔)
°
= 2 × 𝑒 𝑗(−𝜔+90 ) × 𝑠𝑖𝑛(𝜔)
|𝐻(𝜔)| = 2 × |𝑠𝑖𝑛(𝜔)|
−𝜔 + 90° , 𝑠𝑖𝑛(𝜔) > 0
∠𝐻(𝜔) = { °
−𝜔 − 90 , 𝑠𝑖𝑛(𝜔) < 0
7
II. Simulated calculations using MATLAB:
1. Plotting impulse time response
The code (Fig.13)
8
2. Plotting impulse time response
First method "Without using 'freqz' function"
The code (Fig.15)
9
Second method "Using 'freqz' function"
The code (Fig.17)
10
The code (Fig.19)
11