digital signal processing (comm 602) final assignment

26
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

Upload: others

Post on 09-May-2022

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Digital Signal Processing (COMM 602) Final Assignment

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

Page 2: Digital Signal Processing (COMM 602) Final Assignment

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!!!!

Page 3: Digital Signal Processing (COMM 602) Final Assignment

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:

Page 4: Digital Signal Processing (COMM 602) Final Assignment
Page 5: Digital Signal Processing (COMM 602) Final Assignment
Page 6: Digital Signal Processing (COMM 602) Final Assignment

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.

------------------------------------------------------------------------------------------------------------

Page 7: Digital Signal Processing (COMM 602) Final Assignment

Solution:

Page 8: Digital Signal Processing (COMM 602) Final Assignment
Page 9: Digital Signal Processing (COMM 602) Final Assignment
Page 10: Digital Signal Processing (COMM 602) Final Assignment

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:

Page 11: Digital Signal Processing (COMM 602) Final Assignment
Page 12: Digital Signal Processing (COMM 602) Final Assignment

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:

Page 13: Digital Signal Processing (COMM 602) Final Assignment
Page 14: Digital Signal Processing (COMM 602) Final Assignment

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:

Page 15: Digital Signal Processing (COMM 602) Final Assignment
Page 16: Digital Signal Processing (COMM 602) Final Assignment

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:

Page 17: Digital Signal Processing (COMM 602) Final Assignment
Page 18: Digital Signal Processing (COMM 602) Final Assignment
Page 19: Digital Signal Processing (COMM 602) Final Assignment

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

π‘Žπœ‹

Page 20: Digital Signal Processing (COMM 602) Final Assignment
Page 21: Digital Signal Processing (COMM 602) Final Assignment

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

Page 22: Digital Signal Processing (COMM 602) Final Assignment

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)𝑋+(𝑧).

Page 23: Digital Signal Processing (COMM 602) Final Assignment

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

Page 24: Digital Signal Processing (COMM 602) Final Assignment

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

Page 25: Digital Signal Processing (COMM 602) Final Assignment

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]

Page 26: Digital Signal Processing (COMM 602) Final Assignment