Assignment 3 (27 09 2010)
Assignment 3 (27 09 2010)
Assignment 3 (27 09 2010)
Assignment-3
Page 1
ASSIGNMENT-3
SUBMITTED BY:
FARHAJ AHSAN
STUDENT ID: 1093459
A3.1 PROBLEMS
Assignment-3
Page 2
f2= 500Hz,
Assignment-3
Page 3
F1s= 350Hz,
F2s= 575Hz,
F3s= 815Hz,
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
A2 1
.from eq(4.32)
1
k1
1
k1
= 72.9381
A2 1
2
316.22781
0.0593
Page 5
log10 ( 1/k 1)
N=
log 10 ( 1/k )
= 3.0934
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
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
And
n=0
~
X
Hence,
rN
{1, for0, fork =l+
kl
[k] =
k=1,7
{4,0, forotherwise
From Eq(2.47a)
* N1 =2**r
N1 = 6*r
The value of N1 can be 6 when r = 1
Assignment-3
Page 7
* 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
[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
N 1
e j 2 ( kl) n / N
n=0
23
ejn 2 (k3)/24
n=0
Assignment-3
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
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
And
n=0
~
X
Hence,
[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
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
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] =
1
2
1
2
cos(
4 n
N )=
1
2
1 j 4 n/ N j 4 n / N
(e
+e
)
4
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
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
( )
xc[n] = cos3(2n/N) =
3
2 n
cos
4
N
( )
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
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
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
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)
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| > ||
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| < ||
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| > ||
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| < ||
(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
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) =
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
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]
Page 17
Solution:
(a)
(b)
Y (z )
2
=
1
X (z) 10.2 z 0.08 z2
a
1
10.4 z
b
1
10.2 z
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
2
2
1
(10.2 z 0.08 z )(1z )
1
S(z) =
10.4 z
a
b
+
1
(1z )
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
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},
w[n]= 3n,
%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
Column 5
-10.0000 +12.0000i
y3 =
-23.0000 -69.0000 35.0000 105.0000 73.0000
-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
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
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
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
(b) G2(z) =
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
Assignment-3
G2 (z)
is given as:
G2 ( z) . They are:
Page 40
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
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
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
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
Page 43
1.0333
0.0000 -0.1000
0.0333 -0.0333
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
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
(c)
4+2 z1 2
4
X 3 ( z )=
Solution:
The results are displayed as:
Assignment-3
Page 44
5.7500
2.0500
0.4800
1.0000
0.8900
0.6400
0.1600
(d)
X 4 ( z )=5+
2
z
+
1
1
2
4 +3 z
4+3 z + 0.9 z
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
Assignment-3
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 -
1.03330.1 z2
1+ 0.0333 z10.0333 z2
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
1 n
7
[n]
5
6
4
3 [ n]
5
(b) X2(z) =
2.5+
3
1.4 + z1
1+0.4 z 1 1+ 0.6 z 2
1.2960
0.3077
0.2009 -0.1754
Columns 10 through 18
-0.1242
0.1067
0.0383
Columns 19 through 27
0.0138
0.0050
Columns 28 through 30
0.0012 -0.0011 -0.0007
The inverse z-transform is given as:
Assignment-3
Page 47
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 )=
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
Page 48
(d)
X 4 ( z )=5+
2
z 1
+
4 +3 z1 4+3 z1+ 0.9 z 2
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
X4[1]= -0.125 ;
X4[2]= 0.0936....
Assignment-3
Page 49
Assignment-3
Page 50