Vous êtes sur la page 1sur 50

MASTER OF ENGINEERING STUDIES

Assignment-3

Page 1

DIGITAL SIGNAL PROCESSING AND


APPLICATIONS

PROFESSOR DR HAMID GHOLAM HOSSEINI

ASSIGNMENT-3

SUBMITTED BY:
FARHAJ AHSAN
STUDENT ID: 1093459

A3.1 PROBLEMS

Assignment-3

Page 2

Q 4.6) A continuous-time signal xa(t) is composed of a linear combination of sinusoidal


signals of frequencies 300Hz, 500Hz, 1.2kHz, 2.15kHz, and 3.5kHz. The signal x a(t) is
sampled at a 2.0-kHz rate, and the sampled sequence is passed through an ideal lowpass
filter with a cutoff frequency of 900Hz, generating a continuous-time signal y a(t). What are
the frequency components present in the reconstructed signal y a(t) ?
Solution:
The sampling frequency (fs) of the continuous-time signal xa(t) is given as 2.0kHz.
The given signal xa(t) is composed of a linear combination of sinusoidal signals of
frequencies 300Hz, 500Hz, 1.2kHz, 2.15kHz, and 3.5kHz.
Therefore, the sinusoidal sequence generated after being sampled have the
frequency components of the form fk2000n, - < n < , k= 1, 2, 3..
f1= 300Hz,

f1s= 300, 1700, 2300, 3700, 4300Hz

f2= 500Hz,

f2s= 500, 1500, 2500, 3500, 4500....Hz

f3= 1200Hz, f3s= 1200, 800, 3200, 2800, 5200.Hz


f4= 2150Hz, f4s= 2150, 150, 4150, 1850, 6150.Hz
f5= 3500Hz, f5s= 3500, 1500, 5500, 500, 7500.Hz
Then the sampled signal is passed through an ideal lowpass filter with a cutoff
frequency of 900Hz i.e., the signal with frequency above 900Hz is removed and
frequency below 900Hz is passed.
Therefore, the reconstructed signal ya(t) has the following frequencies:
150Hz, 300Hz, 500Hz, 800Hz

Q 4.7) A continuous-time signal xa(t) is composed of a linear combination of sinusoidal


signals of frequencies F1Hz, F2Hz, F3Hz, and F4Hz. The signal xa(t) is sampled at a 10-kHz
rate, and the sampled sequence is passed through an ideal lowpass filter with a cutoff
frequency of 4kHz, generating a continuous-time signal y a(t) composed of three sinusoidal
signals of frequencies 350Hz, 575Hz, and 815Hz, respectively. What are the possible values
of F1, F2, F3, and F4? Is your answer unique? If not, indicate another set of possible values
of these frequencies.
Solution:
The sampling frequency (fs) of the continuous-time signal xa(t) is given as 10kHz.
The generated continuous time signal ya(t) after sampling at 10kHz and passing
through an ideal lowpass filter with a cutoff frequency of 4kHz has the frequencies
350Hz, 575Hz, and 815Hz.

Assignment-3

Page 3

F1s= 350Hz,

F1= 35010,000n Hz, - < n <


F1= 350, 10350, 9650.Hz

F2s= 575Hz,

F2= 575, 10575, 9425.Hz

F3s= 815Hz,

F3= 815, 10815, 9125.Hz

Hence, the frequencies of the continuous-time signal x a(t) composed of a linear


combination of sinusoidal signals are as follows:
F1= 350 Hz, F2= 575Hz, F3=815Hz, and F4=9650Hz
and the other set of frequencies are
F1= 350 Hz, F2= 575Hz, F3=815Hz, and F4=10575Hz
or
F1= 350 Hz, F2= 575Hz, F3=815Hz, and F4=9125Hz
From the above, we can say that the answer is not Unique.

Q 4.8) The continuous-time signal xa(t)=4sin(20t)-5cos(24t)+3sin(120t)+2cos(176t) is


sampled at 50Hz rate, generating the sequence x[n]. Determine the exact expression of
x[n].
Solution:
g[n]=ga(nT)..from the equation (4.1) of sk mitra
T - Sampling period; 1/T = FT = sampling frequency
and t = nT,

t = n/FT = n/50

n
n
n
x[n] = 4sin(20** 50 )-5cos(24** 50 )+3sin(120** 50 )+2cos(176**
n
50 )

= 4sin(

2 n
12 n
12 n
88 n
)
-5cos
(
)
+3sin
(
)
+2cos
(
5
25
5
25 )

= 4sin(

2 n
12 n
(10+2)n
(10012)n
)
-5cos
(
)
+3sin
(
)
+2cos
(
)
5
25
5
25

= 4sin(

2 n
12 n
2 n
5 )-5cos( 25 )+3sin(2n+ 5 )+2cos(4n-

2 n
12 n
2 n
12 n
x[n] = 4sin( 5 ) - 5cos( 25 ) + 3sin( 5 ) + 2cos( 25 )

Assignment-3

Page 4

12 n
25 )

Q 4.22) Using eq.(4.35), determine the lowest order of a lowpass butterworth filter with a
0.25-dB cutoff frequency at 1.5 kHz and a minimum attenuation of 25 dB at 6 kHz. Verify
your result using buttord.
Solution:
We first determine and A from eq(4.34a)
10log10

( 1+1 )
2

= -0.25

2= 100.025-1
2 = 0.0593
from eq (4.34b),
1
10log10( A 2 ) = -25
A2= 102.5
A2 = 316.2278
The transition ratio or selectivity parameter k can be determined as:
k=

p
s

=
1
k

1.5
6

1
4

..from eq(4.31)

=4

The discrimination parameter can be determined as:


k1 =

A2 1

.from eq(4.32)

1
k1

1
k1

= 72.9381

A2 1
2

316.22781
0.0593

The order of the filter can be determined from the eq(4.35)


Assignment-3

Page 5

log10 ( 1/k 1)

N=

log 10 ( 1/k )

= 3.0934

Since the order of a filter must be an integer, we round the above up as N = 4


In MATLAB we can determine the order of lowpass butterworth filter as:
[N,wn] = buttord (wp,ws,rp,rs,s)
Where, wp=2**1500; ws=2**6000; rp=0.25; rs=25
MATLAB program for Q4.22
%program to find order of a lowpass butterworth filter
wp=2*pi*1500; ws=2*pi*6000; rp=0.25; rs=25;
[N,wn] = buttord (wp,ws,rp,rs,'s');
display(N)
result:

N=4

Q 5.4) Determine the discrete fourier series coefficients, defined in eq.(5.185b), of the
following periodic sequences:
(a) xx 1[n]=cos(n/4)
Solution:
0 N=2 r
From Eq(2.47a)
Where 0= Angular frequency;
N = period of the sequence and is positive integer;
r = any integer
from the given equation, 0 = /4

* N = 2**r

N = 8*r
The lowest value of N can be 8 when r = 1
Therefore, period is N=8
From the eq(5.185b)
N 1

~
X [k ]= ~x [n ]e j 2 kn/ N
n=0

Assignment-3

Page 6

xx 1[n] = cos(n/4) =

~
X

~
X

[k] =

1
2

[k] =

1
2

1 jn/ 4 jn/ 4
( e +e
)
2

2 jn/8 j 2 kn/ 8

n=0

+ e2 jn/ 8 e j 2 kn / 8
n=0

n=0

n =0

e jn2 (k1)/8 + e jn2 (k +1)/8

From the equation (5.11),


1
N

N 1

e j 2 ( kl) n / N

n=0

ejn 2 (k1)/8
n=0

8, for k=1
{0,otherwise

8, for k=7
{0,otherwise

ejn 2 (k+ 1)/ 8

And

n=0

~
X

Hence,

rN
{1, for0, fork =l+
kl

[k] =

k=1,7
{4,0, forotherwise

(b) xx 2[n]= sin(n/3) + 3cos(n/4)


Solution:
0 N=2 r

From Eq(2.47a)

Where 0= Angular frequency;


N = period of the sequence and is positive integer;
r = any integer
From the given equation, 01 = /3

* N1 =2**r

N1 = 6*r
The value of N1 can be 6 when r = 1
Assignment-3

Page 7

Therefore, period is N1=6


When 02 = /4

* N2 =2**r

N2 = 8*r
The value of N2 can be 8 when r = 1
Therefore, period is N2 = 8
The period of the entire sequence is the GCM of(6,8) = 24
From the eq(5.185b)
N 1

~
X [k ]= ~x [n ]e j 2 kn/ N
n=0

1 jn/3 jn/ 3
( e e
)
2j

xx 2[n] = sin(n/3)+3cos(n/4) =

~
X

3
2

[k] =

23

23

n=0

n=0

23

n=0

n=0

e6 jn/24 e j 2 kn /24 + e6 jn/24 e j 2 kn/ 24

[k] =

{
23

1
2j

{
23

n=0

j 2 n(k3)/24

n=0

j 2 n(k4 )/ 24

23

e j 2 n(k+3 )/ 24
n=0

23

+ e j 2 n(k +4)/24
n=0

From the equation (5.11),


1
N

N 1

e j 2 ( kl) n / N

n=0

23

ejn 2 (k3)/24
n=0

Assignment-3

ejn 2 (k+ 3)/ 24


n=0

rN
{1, for0, fork =l+
kl

for k=3
{0,j12,otherwise

for k=21
{ j12,
0, otherwise

23

And

3 jn/ 4 jn/ 4
( e +e
)
2

e8 jn/24 e j 2 kn /24 e8 jn/24 e j 8 kn /24

23

~
X

3
2

1
2j

Page 8

23

ejn 2 (k4 )/ 24

And

n=0

36, for k =4
{0,otherwise

for k =20
{36,0, otherwise

23

ejn 2 (k+ 4)/24

And

n=0

~
X

Hence,

j12, for k=3


j12, for k=21 and 0 otherwise
36, for k =4,20

[k] =

Q 5.8) Determine the N-point DFTs of the following length-N sequences defined for
n N-1:
(a) xa[n]=sin(2n/N)
Solution:
xa[n]=sin(2n/N) =

1 j 2 n/ N j 2 n / N
(e
e
)
2j

From the eq(5.7)


N1

X [k ]= x [n]e

j 2 kn /N

n=0

Xa[k] =

1
2j

1
2j

, 0 k N-1

N1

N 1

n=0

n=0

e 2 jn/ N e j 2 kn / N e j 2 kn/ N e j 2 n/ N
N 1

e2 j (k1)n / N
n=0

N1

1
e j 2 (k +1)n/ N
2 j n=0

From the equation (5.11),


1
N

N 1

e j 2 ( kl) n / N
n=0

N 1

e2 j(k1)n / N
n=0

Assignment-3

Page 9

rN
{1, for0, fork =l+
kl
N , for k =1
{0,otherwise

N 1

e j 2 (k+1)n / N
n=0

Hence,

k =N 1
{N0,, forotherwise

N /2 j , for k=1
N /2 j , for k=N 1
0, otherwise

Xa[k] =

(b) xb[n] = cos2(2n/N)


Solution:
xb[n] = cos2(2n/N) =

1
2

1
2

cos(

4 n
N )=

1
2

1 j 4 n/ N j 4 n / N
(e
+e
)
4

From the eq(5.7)


N1

X [k ]= x [n]e j 2 kn /N , 0 k N-1
n=0
N 1

Xb[k] =

N 1

12

j 2 kn / N

n=0

12 ( e jn/ 4 +e jn/ 4 ) e j 2 kn / N
n=0

From the equation (5.11),


1
N

N 1

e j 2 ( kl) n / N

n=0

N 1

e2 jn/ N
n=0

rN
{1, for0, fork =l+
kl

N , for k =0
{0,otherwise

N 1

( e jn/ 4 +e jn/ 4 ) e j 2 kn / N =
n=0

Hence, Xb[k] =

Assignment-3

N
, for k =2, N 2
2
0, otherwise

N
, for k =0
2
N
, for k =2, N 2
4
0, otherwise

Page 10

(c) xc[n] = cos3(2n/N)


Solution:
1
6 n
cos
4
N

( )

xc[n] = cos3(2n/N) =

3
2 n
cos
4
N

( )

From the eq(5.7)


N1

X [k ]= x [n]e

j 2 kn /N

n=0

Xc[k] =
3
4

1
4

N1

N1

N1

n=0

n=0

, 0 k N-1

e j 6 n/ N e j 6 kn / N + e j 6 n/ N e j 6 kn / N

j 2 n / N

j 2 kn / N

n=0

N 1

+ e j 2 n /N e j 2 kn/ N
n=0

From the equation (5.11),


1
N

N 1

e j 2 ( kl) n / N
n=0

N 1

6 j (k 1 )n/ N

n=0

N 1

and

6 j (k +1)n / N

n=0

N 1

2 j(k1)n / N

n=0

N 1

And

Assignment-3

e
n=0

2 j(k +1)n/ N

rN
{1, for0, fork =l+
kl

Page 11

N
, for k =3,
2
0, otherwise

N
, for k =N3
2
0, otherwise

N
, for k=1
2
0,otherwise

N
, for k =N1
2
0, otherwise

Hence,

Xc[k]=

N
, for k=3, N 3
8
3N
, for k=1, N 1
8
0, otherwise

Q 5.15) Let x[n], 0nN-1, be a length-N sequence with an N-point DFT given by X[k],
0kN-1. Determine the 2N-point DFT of each of the following length-2N sequences:
(a) g[n] =

1,
{x0,[ nN] ,0 nn 2 NN 1

Solution:
Given that ,
1,
{x0,[ nN] ,0 nn 2 NN 1

g[n] =

N 1

x [n ]W nk2 N

G[k] =

n=0

When k is even, i.e., k=2p


N 1

G[2p] =

x [n ]W 22 pnN
n=0

N 1

x [n ]2pnN

n=0

= X[p],
(b) h[n] =

0 p N-1

{x [n],0, 0N n nN1,
2 N 1

Solution:
Given that,
h[n] =

Assignment-3

{x [n],0, 0N n nN1,
2 N 1

Page 12

2 N 1

H[k] =
Let

n=N

x [nN ]W nk
2N

m = n N => n = m+N
N 1

N)k
x [m]W (m+
2N

Then, H[k] =

m=0

N 1

= (-1)

x [m]W mk2 N

m=0

For k even, i.e., k = 2


N 1

H[2 ] =

x [n ]W 2l2 Nn
n=0

N 1

x [n ]W lNn
n=0

= X[],

0 N-1

Q 6.3) Determine the z-transforms of the following sequences and their respective ROCs:
(a) x1[n]=n[n-2]
Solution:
For a sequence g[n], its z-transform G(z) is defined as

G(z)= g [ n ] zn ,
n=

(6.1)

Where z = Re(z) + jIm(z) is a continuous complex variable.


Since the sequence is right sided sequence the ROC of its z-transform is
exterior to unit circle.
From the eq(6.1)

X1(z) =

n=

Assignment-3

x 1 [n] zn

n [n2] zn

n=

Page 13

n z n
n=2

n zn

1 z-1

1
1
1 z

1 z-1

11+ z z + z
1
1 z

n=0

2 2

2 z2
= 1 z1 ,

|z| > ||

The ROC of the z-transform X1(z) is given as |z| > ||


(b) x2[n] = -n[-n - 3]
Solution:
x2[n] is a left sided sequence, so ROC of its z-transform is interior to the circle.

X2(z) =

n=

x 2 [n] z

n [n3]z n

n=

n n

n =

m z m

3 z 3
1 1 z

m=3

|z| < ||

Hence, the ROC of X2(z) is given as |z| < ||


(c) x3[n] = n[n + 4]
Solution:

Assignment-3

Page 14

x3[n] is a right sided sequence, hence ROC of its z-transform is exterior to the
unit circle.

X3(z) =

n=

x 3 [n] zn

n [n+4 ] zn

n=

n n

n=4

4 z 4
1 1 z

( /z )

1
z

|z| > ||

Hence, the ROC of X3(z) is given as |z| > ||


(d) x4[n] = n[-n]
Solution:
x4[n] is a left sided sequence, hence ROC of its Z-transform is interior to the
unit circle.

X4(z) =

n=

x 4 [n] z

n=

[n] z

n n

n=

n z n
n=0

1
=

Assignment-3

z
a

Page 15

|z| < ||

Hence, the ROC of X4(z) is given as |z| < ||

Q 6.20) Each one of the following Z-transforms


3z
2
z +0.3 z0.18

(a) Xa(z) =

(b) Xb(z) =

3 z +0.1 z +0.87
2
( z+0.6)(z0.3)

has three ROCs. Evaluate their respective inverse z-transforms corresponding to each
ROC.
Solution:
(a)

Xa(z) =

3z
z +0.3 z0.18
2

The given z-transform can be written as :


Xa(z) =

3z
z +0.3 z0.18
2

3z
(z+ 0.6)(z0.3)

3 z1
(1+0.6 z1)(10.3 z 1 )

a
1
1+0.6 z

a=

3
z0.3

b=

b
1
10.3 z

|z=0.6

3
z +0.6

3
= 0.9

|z=0.3 =

Therefore, Xa(z) =

by method of partial fractions

3
0.9

10/3
1+0.6 z 1

10
3

10
3

10 /3
10.3 z1

The three ROCs of Xa(z) are R1: |z| < 0.3; R2: |z| > 0.6; R3: 0.3 < |z| < 0.6
The inverse z-transform for R1: |z| < 0.3 is a left sided sequence
-1

Z {Xa(z)} = xa[n] =

10
3

{(0.6)n (0.3)n }

[-n-1]

The inverse z-transform for R2: |z| > 0.6 is a right sided sequence

Assignment-3

Page 16

Z-1{Xa(z)} = xa[n] =

10
3

{(0.6)n(0.3)n }

[n]

The inverse z-transform for R3: 0.3 < |z| < 0.6 is a two sided sequence
10
Z {Xa(z)} = xa[n] =
3

(0.6)

-1

[-n-1] +

10
n
(0.3)
3

(b)

Xb(z) =

3 z +0.1 z +0.87
2
( z+ 0.6)( z0.3)
The given z-transform can be written as
Xb(z) =

3 z2 +0.1 z +0.87
( z+ 0.6)( z0.3)2

a
= k + 1+0.6 z 1

b
10.3 z1

c
(10.3 z1)2

By solving the above equation by the method of partial fractions


We get the following resolved equation
Xb(z) =

2.333
3.666

1
1+0.6 z
10.3 z1

4.333

+ (10.3 z1)2

The three ROCs are R1: |z| < 0.3; R2: 0.3 < |z| < 0.6; R3: |z| > 0.6
The inverse z-transform for R1: |z| < 0.3 is given as:
Z-1{Xb(z)} = xb[n] =2.333(-0.6)n[-n-1] + (-3.666 + 4.333(n+1))(0.3)n[-n-1]
The inverse z-transform for R2: 0.3 < |z| < 0.6 is given as:
Z-1{Xb(z)} = xb[n] =2.333(-0.6)n[-n-1] + (-3.666 + 4.333(n+1))(0.3)n[n]
The inverse z-transform for R3: |z| > 0.6 is given as:
Z-1{Xb(z)} = xb[n] =2.333(-0.6)n[n] + (-3.666 + 4.333(n+1))(0.3)n[n]

Q 6.43) A causal LTI discrete-time system is described by the difference equation


y[n] = 0.2y[n-1] + 0.08y[n-2] + 2x[n],
where x[n] and y[n] are, respectively, the input and the output sequences of the system.
(a) Determine the transfer function H(z) of the system.
(b) Determine the impulse response h[n] of the system.
(c) Determine the step response s[n] of the system.
Assignment-3

Page 17

Solution:
(a)

y[n] = 0.2y[n-1] + 0.08y[n-2] + 2x[n]

applying z-transform to the above difference equation on both sides


Y(z) = 0.2z-1Y(z) + 0.08z-2Y(z) + 2X(z)
Y(z) - 0.2z-1Y(z) - 0.08z-2Y(z) = 2X(z)
Y(z){1 0.2z-1 0.08z-2} = 2X(z)
H (z)=

(b)

Y (z )
2
=
1
X (z) 10.2 z 0.08 z2

The above transfer function can be written as


H(z) =

a
1
10.4 z

b
1
10.2 z

by the method of partial

fractions
By solving the above equation, we get the following resolved equation
H(z) =

4/3
10.4 z1

2/3
10.2 z 1

Hence from the table 6.1


0.2 n [n]
2
0.4 n [ n ] +
3
4
h [n]=
3
(c)

The step response can be obtained by


S(z) = Z(s[n]) = H(z).Z([n]) =

2
2
1
(10.2 z 0.08 z )(1z )
1

By applying partial fractions to the above equation, we get

S(z) =

10.4 z

a
b
+
1
(1z )

By solving the above equation for a, b, c values


Assignment-3

Page 18

S(z) =

1
10.4 z

2.7778 0.8889

(1z1)
Hence from the table 6.1

0.2 n [n]
0.4 n [n ]+ 0.1111
S [n]=2.7778 [n] 0.8889

A3.2 MATLAB EXERCISE


M 5.1) using MATLAB, compute the N-point DFTs of the length-N sequences of problem
3.19 for N = 4, 6, 8, and 10. Compare your results with that obtained by evaluating the
DTFTs computed in problem 3.19 at = 2k/N, k = 0, 1, 2 N-1.
Solution:
(a)
% program M5.1
N = input('Enter the value of N=');% length of sequence
k = -N:N;
y = ones(1,2*N+1);
w = 0:2*pi/255:2*pi;
Y = freqz(y,1,w);
Ydft = fft(y);%fast fourier transform
n = 0:1:2*N;
plot(w/pi,abs(Y),n*2/(2*N+1),abs(Ydft),'o');
xlabel('\omega/\pi/'),ylabel('Amplitude');

Assignment-3

Page 19

for N = 4

For N = 6

Assignment-3

Page 20

For N = 8

For n = 10

Assignment-3

Page 21

(b)
% program M5.1b
N = input('Enter the value of N=');% lenghth of sequence
k = 0:N;
y = ones(1,N+1);
w = 0:2*pi/255:2*pi;
Y = freqz(y,1,w);
Ydft = fft(y);%fast fourier transform
n = 0:N;
plot(w/pi,abs(Y),n*2/(N+1),abs(Ydft),'o');
xlabel('\omega/\pi/'),ylabel('Amplitude');

for N = 4

Assignment-3

Page 22

For N = 6

Assignment-3

Page 23

For N = 8

For N = 10
Assignment-3

Page 24

(c)
% program M5.1c
N = input('Enter the value of N=');% lenghth of sequence
k = -N:N;
y = ones(1,2*N+1);
y = y-abs(k)/N;
w = 0:2*pi/255:2*pi;
Y = freqz(y,1,w);
Ydft = fft(y);%fast fourier transform
n = 0:1:2*N;
plot(w/pi,abs(Y),n*2/(2*N+1),abs(Ydft),'o');
xlabel('\omega/\pi/'),ylabel('Amplitude');

for N = 4
Assignment-3

Page 25

For N = 6

For N = 8
Assignment-3

Page 26

For N = 10

Assignment-3

Page 27

(d)
% program M5.1d
N = input('Enter the value of N=');% length of sequence
k = -N:N;
y = N+ones(1,2*N+1)-abs(k);
w = 0:2*pi/255:2*pi;
Y = freqz(y,1,w);
Ydft = fft(y);%fast fourier transform
n = 0:1:2*N;
plot(w/pi,abs(Y),n*2/(2*N+1),abs(Ydft),'o');
xlabel('\omega/\pi/'),ylabel('Amplitude');

for N = 4

For N = 6
Assignment-3

Page 28

For N = 8

For N = 10
Assignment-3

Page 29

(e)
% program M5.1e
N = input('Enter the value of N=');% lenghth of sequence
k = -N:N;
y = cos(pi*k/(2*N));
w = 0:2*pi/255:2*pi;
Y = freqz(y,1,w);
Ydft = fft(y);%fast fourier transform
n = 0:1:2*N;
plot(w/pi,abs(Y),n*2/(2*N+1),abs(Ydft),'o');
xlabel('\omega/\pi/'),ylabel('Amplitude');

for N = 4
Assignment-3

Page 30

For N = 6

For N = 8
Assignment-3

Page 31

For N = 10

Assignment-3

Page 32

M 5.2) write a MATLAB program to compute the circular convolution of two length-N
sequences via the DFT-based approach. Using this program, determine the circular
convolution of the following pairs of sequences:
(a) g[n] = {5, -2, 2, 0, 4, 3},

h[n]= {3, 1, -2, 2, -4, 4},

(b) x[n] = {2-j, -1-j3, 4-j3, 1+j2, 3+j2},


(c) u[n] = cos(n/2),

w[n]= 3n,

v[n]= {-3, 2+j4, -1+j4, 4+j2, -3+j},


0 n 4.

Verify your result using the function cconv.


Solution:
MATLAB Program using DFT approach
%program M5.2 using DFT-based approach
%program M5.2a
g=[5 -2 2 0 4 3];
h=[3 1 -2 2 -4 4];
Y1=fft(g).*fft(h);
y1=ifft(Y1);
display(y1)

%program M5.2b
x=[2-j -1-j*3 4-j*3 1+j*2 3+j*2];
v=[-3 2+j*4 -1+j*4 4+j*2 -3+j];
Y2=fft(x).*fft(v);
y2=ifft(Y2);
display(y2)
%program M5.2C
n=0:4;
u=cos(pi*n/2);
w=3.^n;
Y3=fft(u).*fft(w);
y3=ifft(Y3);
display(y3)
The results are displayed as:
y1 =
-6

9 -16

20

-4

45

y2 =
Columns 1 through 4
Assignment-3

Page 33

11.0000 +25.0000i -9.0000 +48.0000i

3.0000 +17.0000i 29.0000 + 0.0000i

Column 5
-10.0000 +12.0000i
y3 =
-23.0000 -69.0000 35.0000 105.0000 73.0000

MATLAB program using circonv function


%program M5.2a
g=[5 -2 2 0 4 3];
h=[3 1 -2 2 -4 4];
y1=circonv(g,h);
display(y1)
%program M5.2b
x=[2-j -1-j*3 4-j*3 1+j*2 3+j*2];
v=[-3 2+j*4 -1+j*4 4+j*2 -3+j];
y2=circonv(x,v);
display(y2)
%program M5.2C
n=0:4;
u=cos(pi*n/2);
w=3.^n;
y3=circonv(u,w);
display(y3)
The result is displayed as:
3

-4

-2

-4

-2

-2
2
-4
4

-4

-2

2
-4

-2
2

Assignment-3

9 -16

20

-4

-4

-2

y1 =
-6

45

Page 34

Columns 1 through 4
-3.0000

-3.0000 + 1.0000i 4.0000 + 2.0000i -1.0000 + 4.0000i

Column 5
2.0000 + 4.0000i
Columns 1 through 4
2.0000 + 4.0000i -3.0000

-3.0000 + 1.0000i

4.0000 + 2.0000i

Column 5
-1.0000 + 4.0000i
Columns 1 through 4
-1.0000 + 4.0000i 2.0000 + 4.0000i

-3.0000

-3.0000 + 1.0000i

Column 5
4.0000 + 2.0000i
Columns 1 through 4
4.0000 + 2.0000i -1.0000 + 4.0000i 2.0000 + 4.0000i -3.0000
Column 5
-3.0000 + 1.0000i
Columns 1 through 4
-3.0000 + 1.0000i 4.0000 + 2.0000i -1.0000 + 4.0000i 2.0000 + 4.0000i
Column 5
-3.0000
y2 =
Columns 1 through 4
11.0000 +25.0000i -9.0000 +48.0000i 3.0000 +17.0000i 29.0000
Column 5
-10.0000 +12.0000i

Assignment-3

81

27

81

27

81

27

Page 35

27

81

81

27

y3 =
-23.0000 -69.0000 35.0000 105.0000 73.0000

Here, we make use of cconv function to determine the circular convolution as circonv
function is no longer being used.
%program M5.2 using circonv function
%circonv function is outdated. hence we use cconv function to
%determine the circular convolution
%program M5.2a
g=[5 -2 2 0 4 3];
h=[3 1 -2 2 -4 4];
y1=cconv(g,h,6);
display(y1)
%program M5.2b
x=[2-j -1-j*3 4-j*3 1+j*2 3+j*2];
v=[-3 2+j*4 -1+j*4 4+j*2 -3+j];
y2=cconv(x,v,5);
display(y2)
%program M5.2C
n=0:4;
u=cos(pi*n/2);
w=3.^n;
y3=cconv(u,w,5);
display(y3)
The result is displayed as:
y1 =
-6

9 -16

20

-4

45

y2 =
Columns 1 through 4
11.0000 +25.0000i

-9.0000 +48.0000i

Column 5
-10.0000 +12.0000i
Assignment-3

Page 36

3.0000 +17.0000i

29.0000 + 0.0000i

y3 =
-23.0000

-69.0000

35.0000

105.0000

73.0000

The result obtained from both the programs is same. Hence, we can conclude that
the circular convolution can be obtained using DFT and also using cconv function.

M 6.1) using program 6_1, determine the factored form of the following z-transforms:

(a)

2 z 4 5 z 3 +13.48 z 27.78 z + 9
4
3
2
4 z +7.2 z +20 z 0.8 z+ 8

5 z 4 +3.5 z 3+ 21.5 z 24.6 z+18


5 z 4 +15.5 z 3 +31.7 z2 +22.52 z+ 4.8

G1(z) =

(b) G2(z) =

And show their pole-zero plots. Determine all possible ROCs of each of the above ztransforms, and describe of their inverse z-transform (left-sided, right-sided sequences)
associated with each of ROCs.
Solution:
% Program M6.1
% Determination of the Factored Form
% of a Rational z-Transform
%
num = input('Type in the numerator coefficients = ');
den = input('Type in the denominator coefficients = ');
K = num(1)/den(1);
Numfactors = factorize(num)
Denfactors = factorize(den)
disp('Numerator factors');disp(Numfactors);
disp('Denominator factors');disp(Denfactors);
disp('Gain constant');disp(K);
zplane(num,den)

(a) G1(z) =

2 z 4 5 z 3 +13.48 z 27.78 z + 9
4 z 4 +7.2 z 3 +20 z 20.8 z+ 8

The result is displayed as:


Type in the numerator coefficients = [2 -5 13.48 -7.78 9]
Type in the denominator coefficients = [4 7.2 20 -0.8 8]
Numfactors =
Assignment-3

Page 37

1.000000000000000 -2.100000000000001

5.000000000000003

1.000000000000000 -0.399999999999998

0.900000000000000

Denfactors =
1.000000000000000

2.000000000000000

4.999999999999996

1.000000000000000 -0.200000000000000

0.400000000000004

Numerator factors
1.000000000000000 -2.100000000000001

5.000000000000003

1.000000000000000 -0.399999999999998

0.900000000000000

Denominator factors
1.000000000000000

2.000000000000000

4.999999999999996

1.000000000000000 -0.200000000000000

0.400000000000004

Gain constant
0.500000000000000
0.5(12.1 z 1 +5 z2 )(10.399 z1+ 0.9 z 2 )
Hence, G1 ( z )= (1+2 z1+ 4.99 z 2 )(10.2 z1+0.4 z2 )
The pole-zero plot of

Assignment-3

G1 (z)

is given as:

Page 38

There are 3 region of convergence for

G 1 (z) . They are:

R1 :| z|< 0.4 , its inverse z-transform is left sided sequence.


R2 : 0.4 <|z|< 5 , its inverse z-transform is a two sided sequence.
R3 : |z|> 5 , its inverse z-transform is a right sided sequence.

(b) G2(z) =

5 z +3.5 z + 21.5 z 4.6 z+18


5 z 4 +15.5 z 3 +31.7 z2 +22.52 z+ 4.8

The result is displayed as:


Type in the numerator coefficients = [5 3.5 21.5 -4.6 18]
Type in the denominator coefficients = [5 15.5 31.7 22.5 4.8]

Numfactors =
1.000000000000000

1.200000000000002

4.000000000000005

1.000000000000000 -0.500000000000001

0.899999999999997

Assignment-3

Page 39

Denfactors =
1.000000000000000 2.101461104467252 4.001712027439878
1.000000000000000 0.596081942686077

1.000000000000000 0.402456952846671

Numerator factors
1.000000000000000

1.200000000000002

4.000000000000005

1.000000000000000 -0.500000000000001

0.899999999999997

Denominator factors
1.000000000000000 2.101461104467252 4.001712027439878
1.000000000000000 0.596081942686077

1.000000000000000 0.402456952846671

Gain constant
1
(1+1.2 z1+ 4 z2)(10.5 z1 +0.899 z2)
Hence, G2 ( z )= (1+2.101 z1+ 4 z2)(1+0.596 z 1)(1+ 0.402 z1)
The pole-zero plot of

There are 4 ROCs for

Assignment-3

G2 (z)

is given as:

G2 ( z) . They are:

Page 40

R1 :| z|< 0.4 , its inverse z-transform is left-sided sequence.


R2 : 0.4<|z|<0.6 , its inverse z-transform is a two sided sequence.
R3 : 0.6<|z|<2 , its inverse z-transform is a two sided sequence.
R4 :|z|>2 , its inverse z-transform is right sided sequence.

M 6.2) Using program 6_3, determine the partial-fraction expansions of the z-transforms
listed in problem 6.2 then determine their inverse z-transform.
Solution:
%program M6.2
% Partial-Fraction Expansion of Rational z-Transform
%
num = input('Type in numerator coefficients = ');
den = input('Type in denominator coefficients = ');
[r,p,k] = residuez(num,den);%gives the partal fractions
disp('Residues');disp(r')%numerator coefficients of partial
fractions
disp('Poles');disp(p')%gives the poles
disp('Constants');disp(k)%gives the constants

(a)

Xa(z) =

3z
z +0.3 z0.18
2

Type in numerator coefficients = [0 3]


Type in denominator coefficients = [1 0.3 -0.18]
Residues
-3.3333

3.3333

-0.6000

0.3000

Poles

Constants
0
Therefore, Xa(z) =

Assignment-3

3.33
1
1+0.6 z

Page 41

3.33
1
10.3 z

The poles for the z-transform are at z = -0.6 and z = 0.3


The three ROCs of Xa(z) are R1: |z| < 0.3; R2: |z| > 0.6; R3: 0.3 < |z| < 0.6
The inverse z-transform for R1: |z| < 0.3 is a left sided sequence
Z-1{Xa(z)} = xa[n] =

10
3

{(0.6)n (0.3)n }

[-n-1]

The inverse z-transform for R2: |z| > 0.6 is a right sided sequence
Z-1{Xa(z)} = xa[n] =

10
3

{(0.6)n(0.3)n }

[n]

The inverse z-transform for R3: 0.3 < |z| < 0.6 is a two sided sequence
Z-1{Xa(z)} = xa[n] =

10
3

(0.6)n

[-n-1] +

10
n
(0.3)
3

(b)

Xb(z) =

3 z +0.1 z +0.87
( z+ 0.6)( z0.3)2
Type in numerator coefficients = [3 0.1 0.87]
Type in denominator coefficients = [1 0 -0.27 0.054]

Residues
Columns 1 through 2
2.333333333333335

-3.666666666666670 + 0.000000087665732i

Column 3
4.333333333333334 - 0.000000087665732i
Poles
Columns 1 through 2
-0.600000000000000

0.300000000000000 - 0.000000007172651i

Column 3
0.300000000000000 + 0.000000007172651i
Constants
0

Assignment-3

Page 42

We get the following resolved equation


Xb(z) =

2.333
3.666

1
1
1+0.6 z
10.3 z

4.333

+ (10.3 z1)2

The three ROCs are R1: |z| < 0.3; R2: 0.3 < |z| < 0.6; R3: |z| > 0.6
The inverse z-transform for R1: |z| < 0.3 is given as:
Z-1{Xb(z)} = xb[n] =2.333(-0.6)n[-n-1] + (-3.666 + 4.333(n+1))(0.3)n[-n-1]
The inverse z-transform for R2: 0.3 < |z| < 0.6 is given as:
Z-1{Xb(z)} = xb[n] =2.333(-0.6)n[-n-1] + (-3.666 + 4.333(n+1))(0.3)n[n]
The inverse z-transform for R3: |z| > 0.6 is given as:
Z-1{Xb(z)} = xb[n] =2.333(-0.6)n[n] + (-3.666 + 4.333(n+1))(0.3)n[n]

M 6.3) Using program 6_4, determine the z-transform as a ratio of two polynomials in z -1
from each of the partial fraction expansions listed below:
Solution:
% program M6.3
% Partial-Fraction Expansion to Rational z-Transform
%
r = input('Type in the residues = ');
p = input('Type in the poles = ');
k = input('Type in the constants = ');
[num, den] = residuez(r,p,k);
disp('Numerator polynomial coefficients'); disp(num)
disp('Denominator polynomial coefficients'); disp(den)

(a) X1(z) = 3 -

4
7

1
1
5+ z
6z

, |z| > 0.2,

Results are displayed as:


Type in the residues = [-4/5 -7/6]
Type in the poles = [-1/5 1/6]
Type in the constants = 3
Numerator polynomial coefficients
Assignment-3

Page 43

1.0333

0.0000 -0.1000

Denominator polynomial coefficients


1.0000

0.0333 -0.0333

Hence, the equation can be expressed as


X 1 (z )=

1.03330.1 z2
1+ 0.0333 z10.0333 z2

(b) X2(z) =

2.5+

3
1.4 + z

1
2
1+0.4 z
1+ 0.6 z

|z| > 0.25,

Solution:
The results are displayed as:
Type in the residues = [3 -0.7-0.6455*i -0.7+0.6455*i]
Type in the poles = [-0.4 -0.7746*i 0.7746*i]
Type in the constants = -2.5
Numerator polynomial coefficients
-0.9000 -2.5600 -0.1000 -0.6000
Denominator polynomial coefficients
1.0000

0.4000

0.6000

0.2400

Hence, the equation can be expressed as:


X 2 ( z) =

(c)

4+2 z1 2

4
X 3 ( z )=

0.92.56 z10.1 z20.6 z 3


1+ 0.4 z1 +0.6 z 2 +0.24 z3

|z| > 0.8

Solution:
The results are displayed as:
Assignment-3

Page 44

Type in the residues = [1.5 2.5 2.5 -0.25]


Type in the poles = [-0.5 -0.8*i 0.8*i -0.5]
Type in the constants = 0
Numerator polynomial coefficients
6.2500

5.7500

2.0500

0.4800

Denominator polynomial coefficients


1.0000

1.0000

0.8900

0.6400

0.1600

Hence, the equation can be expressed as:


X 3 ( z )=

6.25+5.75 z1+ 2.05 z 2 +0.48 z3


1
2
3
4
1+ z +0.89 z +0.64 z +0.16 z

(d)

X 4 ( z )=5+

2
z
+
1
1
2
4 +3 z
4+3 z + 0.9 z

|z| > 0.75

Solution:
The results are displayed as:
Type in the residues = [0.5 0.4303*i -0.4303*i]
Type in the poles = [-0.75 -0.3750-0.2905*i -0.3750+0.2905*i]
Type in the constants = -5
Numerator polynomial coefficients
-4.5000 -6.8750 -3.6376 -0.8438
Denominator polynomial coefficients
1.0000

1.5000

0.7875

0.1688

Hence, the equation can be expressed as:


X 4 ( z )=

Assignment-3

4.56.8750 z 13.6376 z20.8438 z3


1+1.5 z 1 +0.7875 z2+1.688 z3

Page 45

M 6.4) Using program 6_5, determine the first 30 samples of the inverse z-transforms of the
rational z-transform determined in problem M6.3. Show that these samples are identical to
those obtained by explicitly evaluating exact inverse z-transforms.
Solution:
% Program M6.4
% Power Series Expansion of a Rational z-Transform
% Read in the number of inverse z-transform coefficients to be computed
L = input('Type in the length of output vector = ');
% Read in the numerator and denominator coefficients of
% the z-transform
num = input('Type in the numerator coefficients = ');
den = input('Type in the denominator coefficients = ');
% Compute the desired number of inverse transform coefficients
[y,t] = impz(num,den,L);
disp('Coefficients of the power series expansion');
disp(y')
4
7

1
1
5+ z
6z

(a) X1(z) = 3 -

, |z| > 0.2,

Which can also be expressed as below :


X 1 (z )=

1.03330.1 z2
1+ 0.0333 z10.0333 z2

The result is displayed as:


Type in the length of output vector = 30
Type in the numerator coefficients = [1.0333 0 -0.1]
Type in the denominator coefficients = [1 0.0333 -0.0333]
Coefficients of the power series expansion
Columns 1 through 9
1.0333 -0.0344 -0.0644

0.0010 -0.0022

0.0001 -0.0001

0.0000 -0.0000

Columns 10 through 18
0.0000 -0.0000

0.0000 -0.0000

0.0000 -0.0000

0.0000 -0.0000

0.0000

Columns 19 through 27
-0.0000

0.0000 -0.0000

0.0000 -0.0000

Columns 28 through 30
Assignment-3

Page 46

0.0000 -0.0000

0.0000 -0.0000

0.0000 -0.0000

0.0000

The inverse z-transform is given as:


1 n
[n]
6
X1[n] =

1 n
7
[n]
5
6
4
3 [ n]
5

For n = 0, x1[0] = 1.0333; for n = 1, x2[1] = -0.0344..


Hence, the samples are identical.

(b) X2(z) =

2.5+

3
1.4 + z1

1+0.4 z 1 1+ 0.6 z 2

|z| > 0.25,

The above equation can also be expressed as:


X 2 ( z) =

0.92.56 z10.1 z20.6 z 3


1+ 0.4 z1 +0.6 z 2 +0.24 z3

The result is displayed as:


Type in the length of output vector = 30
Type in the numerator coefficients = [-0.9 -2.5 -0.1 -0.6]
Type in the denominator coefficients = [1 0.4 0.6 0.24]
Coefficients of the power series expansion
Columns 1 through 9
-0.9000 -2.1400

1.2960

0.3816 -0.4166 -0.3733

0.3077

0.2009 -0.1754

Columns 10 through 18
-0.1242

0.1067

0.0740 -0.0638 -0.0445

0.0383

0.0267 -0.0230 -0.0160

Columns 19 through 27
0.0138

0.0096 -0.0083 -0.0058

0.0050

Columns 28 through 30
0.0012 -0.0011 -0.0007
The inverse z-transform is given as:
Assignment-3

Page 47

0.0035 -0.0030 -0.0021

0.0018

0.7746i [n]
0.7746i n [ n ] +(0.7+0.6455 i)
0.4 n +(0.70.6455 i)
x 2 [ n ] =2.5 [ n ] +3
From the above Inverse z-transform we can get,
x2[0] = -0.9; x2[1] = -2.14; x2[2] = 1.296.
Hence, the samples are identical
1 2

(c)

4+2 z

4
X 3 ( z )=

|z| > 0.8

The above equation can also be written as:


6.25+5.75 z1+ 2.05 z 2 +0.48 z3
(
)
X3 z =
1+ z 1 +0.89 z2 +0.64 z 3 +0.16 z4
The result is displayed as:
Type in the length of output vector = 30
Type in the numerator coefficients = [6.25 5.75 2.05 0.48]
Type in the denominator coefficients = [1 1 0.89 0.64 0.16]
Coefficients of the power series expansion
Columns 1 through 9
6.2500 -0.5000 -3.0125 -0.0625

2.0636

0 -1.3146

0.0039

0.8359

Columns 10 through 18
0.0020 -0.5381

0.0007

0.3432

0.0002 -0.2200

0.0576

0.0000 -0.0369

0.0001

0.1407

0.0000

0.0236

0.0000 -0.0151

Columns 19 through 27
-0.0901

0.0000

0.0000

Columns 28 through 30
0.0000

0.0097

0.0000

The inverse z-transform is given as :


X3[n] = 1.5(-0.5)n[n] + 2.5(-0.8)n [n] + 2.5(0.8)n [n] 0.25(n+1)(-0.5)n [n]
From the above equation we can get the following values:
Assignment-3

Page 48

X3[0] = 6.25; X3[1] = -0.5; X3[2] = -3.0125


Hence, the samples are identical

(d)

X 4 ( z )=5+

2
z 1
+
4 +3 z1 4+3 z1+ 0.9 z 2

|z| > 0.75

The above equation can also be written as:


X 4 ( z )=

4.56.8750 z 13.6376 z20.8438 z3


1+1.5 z 1 +0.7875 z2+1.688 z3

The result is displayed as below:


Type in the length of output vector = 30
Type in the numerator coefficients = [-4.5 -6.875 -3.6376 -0.8438]
Type in the denominator coefficients = [1 1.5 0.7875 0.1688]
Coefficients of the power series expansion
Columns 1 through 9
-4.5000 -0.1250

0.0936 -0.1262

0.1367 -0.1215

0.0958 -0.0712

0.0518

Columns 10 through 18
-0.0378

0.0280 -0.0209

0.0157 -0.0118

0.0089 -0.0067

0.0050 -0.0038

Columns 19 through 27
0.0028 -0.0021

0.0016 -0.0012

0.0009 -0.0007

0.0005 -0.0004

0.0003

Columns 28 through 30
-0.0002

0.0002 -0.0001

The inverse z-transform is given as:


X4[n] = -5[n] + 0.5(-0.75)n[n] + 0.4303i(-0.3750-0.2905i)n [n] -0.4303i(0.3750+0.2905i)n [n]
From the above equation we can get the sample values as below:
X4[0] = -4.5;

X4[1]= -0.125 ;

X4[2]= 0.0936....

Hence samples are identical.

Assignment-3

Page 49

Assignment-3

Page 50

Vous aimerez peut-être aussi