0% found this document useful (0 votes)
302 views56 pages

The - Transform: X 2z 4z 2z

The document discusses polynomial operations using MATLAB and the z-transform. It provides examples of convolving sequences to obtain other sequences and taking the z-transform. It also proves properties of convolution and the z-transform.

Uploaded by

OH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
302 views56 pages

The - Transform: X 2z 4z 2z

The document discusses polynomial operations using MATLAB and the z-transform. It provides examples of convolving sequences to obtain other sequences and taking the z-transform. It also proves properties of convolution and the z-transform.

Uploaded by

OH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Chapter 4

The z -Transform
P4.1 Polynomial operations using M ATLAB :
1. X1 (z) = (1 − 2z −1 + 3z −2 − 4z −3 )(4 + 3z −1 − 2z −2 + z −3 )
% P0401a.m
clc; close all;
n1 = [0:3]; y1 = [1 -2 3 -4]; n2 = [0:3]; y2 = [4 3 -2 1];
[x1,n] = conv_m(y1,n1,y2,n2)
x1 =
4 -5 4 -2 -20 11 -4
n =
0 1 2 3 4 5 6
Hence

X1 (z) = 4 − 5z −1 + 4z −2 − 2z −3 − 20z −4 11 + z −5 − 4z −6

2. X2 (z) = (z 2 − 2z + 3 + 2z −1 + z −2 )(z 3 − z −3 )
% P0401b.m
clc; close all;
n1 = [-2:2]; y1 = [1 -2 3 2 1]; n2 = [-3:3]; y2 = [1 0 0 0 0 0 1];
[x2,n] = conv_m(y1,n1,y2,n2)
x2 =
1 -2 3 2 1 0 1 -2 3 2 1
n =
-5 -4 -3 -2 -1 0 1 2 3 4 5
Hence

X2 (z) = z 5 − 2z 4 + 3z 3 + 2z 4 + z + z −1 − 2z −2 + 3z −3 + 2z −4 + z −5

145
© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
146 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

3. X3 (z) = (1 + z −1 + z −2 )3
% P0401c.m
clc; close all;
n1 = [0 1 2]; y1 = [1 1 1]; [y2,n2] = conv_m(y1,n1,y1,n1);
[x3,n] = conv_m(y1,n1,y2,n2)
x3 =
1 3 6 7 6 3 1
n =
0 1 2 3 4 5 6
Hence

X3 (z) = 1 + 3z −1 + 6z −2 + 7z −3 + 6z −4 + 3z −5 + z −6

4. X4 (z) = X1 (z)X2 (z) + X3 (z)


% P0401d.m
clc; close all;
n11 = [0:3]; y11 = [1 -2 3 -4]; n12 = [0:3]; y12 = [4 3 -2 1];
[y13,n13] = conv_m(y11,n11,y12,n12);
n21 = [-2:2]; y21 = [1 -2 3 2 1]; n22 = [-3:3]; y22 = [1 0 0 0 0 0 1];
[y23,n23] = conv_m(y21,n21,y22,n22);
n31 = [0 1 2]; y31 = [1 1 1];
[y32,n32] = conv_m(y31,n31,y31,n31); [y33,n33] = conv_m(y31,n31,y32,n32);
[y41,n41] = conv_m(y13,n13,y23,n23); [x4,n] = sigadd(y41,n41,y33,n33)
x4 =
Columns 1 through 12
4 -13 26 -17 -10 49 -79 -8 23 -8 -11 49
Columns 13 through 17
-86 -1 -10 3 -4
n =
Columns 1 through 12
-5 -4 -3 -2 -1 0 1 2 3 4 5 6
Columns 13 through 17
7 8 9 10 11
Hence

X4 (z) = 4z 5 − 13z 4 + 26z 3 − 17z 2 − 10z 1 + 49 − 79z −1 − 8z −2 + 23z −3 − 8z −4 − 11z −5


+ 49z −6 − 86z −7 − z −8 − 10z −9 + 3z −10 − 4z −11

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 147

5. X5 (z) = (z −1 − 3z −3 + 2z −5 + 5z −7 − z −9 )(z + 3z 2 + 2z 3 + 4z 4 )
% P0401e.m
clc; close all;
n1 = [0:9]; y1 = [0 1 0 -3 0 2 0 5 0 -1]; n2 = [-4:0]; y2 = [4 2 3 1 0];
[x5,n] = conv_m(y1,n1,y2,n2)
x5 =
Columns 1 through 12
0 4 2 -9 -5 -1 1 26 12 11 3 -3
Columns 13 through 14
-1 0
n =
Columns 1 through 12
-4 -3 -2 -1 0 1 2 3 4 5 6 7
Columns 13 through 14
8 9
Hence

X5 (z) = 4z 3 + 2z 2 − 9z 1 − 5 − z −1 + z −2 + 26z −3 + 12z −4 + 11z −5 + 3z −6 − 3z −7 − z −8

P4.2 If sequences x1 (n), x2 (n), and x3 (n) are related by x3 (n) = x1 (n) ∗ x2 (n) then

 ∞  ∞ 
  
x3 (n) = x1 (n) x2 (n)
n=−∞ n=−∞ n=−∞

1. Proof using the definition of convolution:



 ∞
 ∞
 ∞

x3 (n) = x1 (n) ∗ x2 (n) = x1 (k)x2 (n − k)
n=−∞ n=−∞ n=−∞ k=−∞
 ∞
 ∞
 ∞
 ∞

   
= x1 (k) x2 (n − k) = x1 (n) x2 (n)
k=−∞ n=−∞ n=−∞ n=−∞

as expected.
2. Proof using the convolution property:

Z [x3 (n)] = Z [x1 (n) ∗ x2 (n)] = Z [x1 (n)] Z [x2 (n)]


   ∞   ∞ 

     
−n  −n  −n 
x3 (n)z  = x1 (n)z  x2 (n)z 
  
n=−∞ z=1 n=−∞ n=−∞

 ∞
  ∞
z=1
 z=1
  
x3 (n) = x1 (n) x2 (n)
n=−∞ n=−∞ n=−∞

as expected.

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
148 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

3. M ATLAB verification:
clc; close all;
N = 1000; n1 = [0:N]; x1 = rand(1,length(n1));
n2 = [0:N]; x2 = rand(1,length(n2)); [x3,n3] = conv_m(x1,n1,x2,n2);
sumx1 = sum(x1); sumx2 = sum(x2); sumx3 = sum(x3);
error = max(abs(sumx3-sumx1*sumx2))
error =
2.9104e-011
P4.3 The z-transform of x(n) is X(z) = 1/(1 + 0.5z −1 ), |z| ≥ 0.5.
1. The z-transforms of x1 (n) = x(3 − n) + x(n − 3):

X1 (z) = Z [x1 (n)] = Z [x(3 − n) + x(n − 3)] = Z [x{−(n − 3)}] + Z [x(n − 3)]
 
−3 −3 −3 1 1
= z X(1/z) + z X(z) = z + , 0.5 < |z| < 2
1 + 0.5z 1 + 0.5z −1
0.5z −3 + 2z −4 + 0.5z −5
= , 0.5 < |z| < 2
0.5 + 1.25z −1 + 0.5z −2

2. The z-transforms of x2 (n) = (1 + n + n2 )x(n):



X2 (z) = Z 1 + n + n2 x(n) = Z x(n) + n x(n) + n2 x(n)
d d2
= X(z) − z X(z) + z 2 2 X(z)
dz dz
1 0.5z −1 z −1 + 0.5z −2 1 − 0.25z −2
= − − = 4 , |z| > 0.5
1 + 0.5z −1 (1 + 0.5z −1 )
2
(1 + 0.5z −1 )
4
(1 + 0.5z −1 )

1
n
3. The z-transforms of x3 (n) = 2 x(n − 2):

 n 
1
X3 (z) = Z x(n − 2) = Z [x(n − 2)]|( 1 )−1 z = Z [x(n − 2)]|2z
2 2
 
 −2  z −2  −2
= z X(z) 2z = , |z| > 0.5  = 0.25z , |z| > 0.25
1 + 0.5z −1  1 + 0.25z −1
2z

4. The z-transforms of x4 (n) = x(n + 2) ∗ x(n − 2):

  
X4 (z) = Z [x(n + 2) ∗ x(n − 2)] = z 2 X(z) z −2 X(z) = X 2 (z)
1
= 2 , |z| > 0.5
(1 + 0.5z −1 )

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 149

5. The z-transforms of x5 (n) = cos(πn/2)x∗ (n):


 
ejπn/2 + e−jπn/2
X5 (z) = Z [cos(πn/2)x∗ (n)] = Z x∗ (n)
2
1   jπn/2 ∗   
= Z e x (n) + Z e−jπn/2 x∗ (n)
2
1
= ( Z [x∗ (n)]|e−jπ/2 z + Z [x∗ (n)]|ejπ/2 z )
2
1  ∗  jπ/2 ∗   
= X e z + X ∗ e−jπ/2 z ∗
2 
1 1 1
= +
2 1 + 0.5e−jπ/2 z −1 1 + 0.5ejπ/2 z −1
1
= , |z| > 0.5
1 + 0.25z −2
P4.4 The z-transform of x(n) is
1 + z −1 1
X(z) = 5 −1 ; |z| >
1+ 6z+ 16 z −2 2
1. The z-transforms of x1 (n) = x(3 − n) + x(n − 3):

X1 (z) = Z [x1 (n)] = Z [x(3 − n) + x(n − 3)] = Z [x{−(n − 3)}] + Z [x(n − 3)]
 
−3 −3 −3 1+z 1 + z −1
= z X(1/z) + z X(z) = z + , 0.5 < |z| < 2
1 + 56 z + 16 z 2 1 + 56 z −1 + 16 z −2
36z −1 + 72z −2 + 36z −3
= , 0.5 < |z| < 2
6 + 35z −1 + 62z −2 + 35z −3 + 6z −4
2. The z-transforms of x2 (n) = (1 + n + n2 )x(n):


 d d2
X2 (z) = Z 1 + n + n2 x(n) = Z x(n) + n x(n) + n2 x(n) = X(z) − z X(z) + z 2 2 X(z)
dz dz
or X2 (z) =
1 + 17 z −1 + 1 z −2 + 1429 z −3 + 2399 z −4 + 215 z −5 + 829 z −6 − 167 z −7 − 7 z −8 − 2 z −9 − 1 z −10
3 2 108 286 72 1944 1944 144 243 1944 , |z| > 0.5
1 + 5z −1 + 137 z −2 + 425 z −3 + 6305 z −4 + 2694 z −5 + 1711 z −6 + 449 z −7 + 1258 z −8 + 425 z −9 + 137 z −10 + 5 z −11 + 1 z −12
12 27 432 281 374 281 3103 5832 15552 7776 46656

1
n
3. The z-transforms of x3 (n) = 2 x(n − 2):
 n 
1
X3 (z) = Z x(n − 2) = Z [x(n − 2)]|( 1 )−1 z = Z [x(n − 2)]|2z
2 2

1 −2
  4z + 18 z −3
= z −2 X(z) 2z = [, |z| > 0.5]|2z = 5 −1 1 −2 , |z| > 0.25
1 + 12 z + 24 z

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
150 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

4. The z-transforms of x4 (n) = x(n + 2) ∗ x(n − 2):


  
X4 (z) = Z [x(n + 2) ∗ x(n − 2)] = z 2 X(z) z −2 X(z) = X 2 (z)
1 + 2z −1 + z −2
= 5 −1 −2 + 5 z −3 + 1 −4 , |z| > 0.5
1+ 3z + 37
36 z 18 36 z

5. The z-transforms of x5 (n) = cos(πn/2)x∗ (n):


 
ejπn/2 + e−jπn/2
X5 (z) = Z [cos(πn/2)x∗ (n)] = Z x∗ (n)
2
1   jπn/2 ∗   
= Z e x (n) + Z e−jπn/2 x∗ (n)
2
1
= ( Z [x∗ (n)]|e−jπ/2 z + Z [x∗ (n)]|ejπ/2 z )
2
1  ∗  jπ/2 ∗   
= X e z + X ∗ e−jπ/2 z ∗
2 
1 1 − jz −1 1 + jz −1
=
2 1 − j 56 z −1 − 16 z −2 1 + j 56 z −1 − 16 z −2
2 + 43 z −2
= −2 + 1 z −4
, |z| > 0.5
1 + 13
36 z 36

P4.5 Computation of z-transform using properties and the z-transform table:


1. x(n) = 2δ(n − 2) + 3u(n − 3):

1 2z −2 + z −3
X(z) = 2z −2 + 3z −3 = ; |z| > 1
1 − z −1 1 − z −1
M ATLAB script:
clc; close all;
b = [0 -8 0 -1.5 0 -1/16]; a = [1 0 3/16 0 3/256 0 1/(256*16)];
[delta,n1] = impseq(0,0,9); xb1 = filter(b,a,delta);
[u,n2] = stepseq(0,0,9);xb2 = (((n2-3).*((1/4).^(n2-2))).*cos((pi/2)*(n2-1))).*u;
error = max(abs(xb1-xb2))
error =
0
Hf_1 = figure; set(Hf_1,’NumberTitle’,’off’,’Name’,’P0405e’);
[Hz,Hp,Hl] = zplane(b,a); set(Hz,’linewidth’,1); set(Hp,’linewidth’,1);
title(’Pole-Zero plot’,’FontSize’,TFS); print -deps2 ../epsfiles/P0405e;
The pole-zero plot is shown in Figure 4.1.

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 151

Pole−Zero plot
1

Imaginary Part
0.5

2
0

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.1: Problem P4.5.1 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
152 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

2. x(n) = 3(0.75)n cos(0.3πn)u(n) + 4(0.75)n sin(0.3πn)u(n):

1 − [0.75 cos(0.3π)]z −1 [0.75 sin(0.3π)]z −1


Z(z) = 3 −1 −2
+4
1 − 2[0.75 cos(0.3π)]z + (0.75) z 2 1 − 2[0.75 cos(0.3π)]z −1 + (0.75)2 z −2
3 + [3 sin(0.3π) − 2.25 cos(0, 3π)]z −1 3 + 1.1045z −1
= −1 −2
= ; |z| > 0.75
1 − 1.5 cos(0, 3π)z + 0.5625z 1 − 0.8817z −1 + 0.5625z −2

M ATLAB script:
clc; close all;
b = [3 (3*sin(0.3*pi)-2.25*cos(0.3*pi))]; a = [1 -1.5*cos(0.3*pi) 0.5625];
[delta,n1] = impseq(0,0,7); xb1 = filter(b,a,delta); [u,n2] = stepseq(0,0, 7);
xb2 = 3*(((0.75).^n2).*cos(0.3*pi*n2)).*u+4*(((0.75).^n2).*sin(0.3*pi*n2)).*u ;
error = max(abs(xb1-xb2))
error =
4.4409e-016
Hf_1 = figure; set(Hf_1,’NumberTitle’,’off’,’Name’,’P0405b’);
[Hz,Hp,Hl] = zplane(b,a); set(Hz,’linewidth’,1); set(Hp,’linewidth’,1);
title(’Pole-Zero plot’,’FontSize’,TFS); print -deps2 ../epsfiles/P0405b;
The pole-zero plot is shown in Figure 4.2.

Pole−Zero plot
1
Imaginary Part

0.5

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.2: Problem P4.5.2 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 153

3 )u(n) + (0.9) u(n − 2): Consider


3. x(n) = n sin( πn n

 πn   πn 
x(n) = n sin u(n) + (0.9)n u(n − 2) = n sin u(n) + 0.92 (0.9)n−2 u(n − 2)
3
 πn  3
= n sin u(n) + 0.81(0.9)n−2 u(n − 2)
3
Hence
  πn   
X(z) = Z n sin u(n) + Z 0.81(0.9)n−2 u(n − 2)
3
d    πn  
= −z Z sin u(n) + 0.81z −2 Z [(0.9)n u(n)]
dz 3
d sin(π/3)z −1 0.81z −2
= −z −1 −2
+ ; |z| > 1
dz 1 − z + z 1 − 0.9z −1
sin(π/3)z −1 − sin(π/3)z −3 0.81z −2
= −1 −2 −3 −4
+ ; |z| > 1
1 − 2z + 3z − 2z + z 1 − 0.9z −1
0.866z −1 + 0.0306z −2 − 2.486z −3 + 3.2094z −4 − 1.62z −5 + 0.81z −6
= ; |z| > 1
1 − 2.9z −1 + 4.8z −2 − 4.7z −3 + 2.8z −4 − 0.9z −5
M ATLAB script:
clc; close all;
b = [0 sin(pi/3) (0.81-0.9*sin(pi/3)) -(1.62+sin(pi/3)) ...
(0.9*sin(pi/3)+2.43) -1.62 0.81];
a = [1 -2.9 4.8 -4.7 2.8 -0.9]; [delta,n1] = impseq(0,0,9);
xb1 = filter(b,a,delta);
[u2,n2] = stepseq(0,0,9); [u3,n3] = stepseq(2,0,9);
xb2 = (n2.*sin(pi/3*n2)).*u2+((0.9).^n3).*u3; error = max(abs(xb1-xb2))
Hf_1 = figure; set(Hf_1,’NumberTitle’,’off’,’Name’,’P0405c’);
[Hz,Hp,Hl] = zplane(b,a); set(Hz,’linewidth’,1); set(Hp,’linewidth’,1);
title(’Pole-Zero plot’,’FontSize’,TFS); print -deps2 ../epsfiles/P0405c;
error =
2.1039e-014
The pole-zero plot is shown in Figure 4.3.

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
154 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

Pole−Zero plot
1.5

1 2

Imaginary Part
0.5

−0.5
2
−1

−1.5
−2 −1.5 −1 −0.5 0 0.5 1
Real Part

Figure 4.3: Problem P4.5.3 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 155

4. x(n) = n2 (2/3)n−2 u(n − 1): Consider

x(n) = n2 (2/3)n−2 u(n − 1) = n2 (2/3)−1 (2/3)(n−1) u(n − 1)


   
(n−1)
3 2
= n n u(n − 1)
2 3

Let
(n−1)
2 z −1 2
x1 (n) = u(n − 1) ⇒ X1 (z) = 2 −1 ; |z| > 3
3 1 − 3z

Let
d z −1 2
x2 (n) = n x1 (n) ⇒ X2 (z) = −z X1 (z) = ; |z| >
dz 1 − 3 z + 49 z −2
4 −1 3

Let

d z −1 − 49 z −3 2
x3 (n) = n x2 (n) ⇒ X3 (z) = −z X2 (z) = 16 −4 ; |z| >
dz 1 − 83 z −1 + 83 z −2 − 32
27 z
−3 +
81 z
3

Finally, x(n) = 32 x3 (n). Hence



3 z −1 − 49 z −3
X(z) =
2 1 − 83 z −1 + 83 z −2 − 32
27 z
−3 + 16 −4
81 z
3 −1
2z − 23 z −3 2
= 8 −1 16 −4 ; |z| >
1− 3z + 83 z −2 − 3227 z
−3 + 81 z
3

M ATLAB script:
clc; close all; b = 3/2*[0 1 0 -4/9]; a = [1 -8/3 8/3 -32/27 16/81];
[delta,n1] = impseq(0,0,8); xb1 = filter(b,a,delta);
[u,n2] = stepseq(1,0,8); xb2 = ((n2.^2).*((2/3).^(n2-2))).*u;
error = max(abs(xb1-xb2))
Hf_1 = figure; set(Hf_1,’NumberTitle’,’off’,’Name’,’P0405d’);
[Hz,Hp,Hl] = zplane(b,a); set(Hz,’linewidth’,1); set(Hp,’linewidth’,1);
title(’Pole-Zero plot’,’FontSize’,TFS); print -deps2 ../epsfiles/P0405d;
error =
9.7700e-015
The pole-zero plot is shown in Figure 4.4.

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
156 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

Pole−Zero plot
1

Imaginary Part
0.5

4
0

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.4: Problem P4.5.4 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 157

1
n−2 π 
5. x(n) = (n − 3) 4 cos 2 (n − 1) u(n): Consider
n−2 π  n−2 π 
1 1
x(n) = (n − 3) cos (n − 1) u(n) = (n − 3) sin n u(n)
4 2 4 2
−2 n π  n π 
1 1 1
= (n − 3) sin n u(n) = 16(n − 3) sin n u(n)
4 4 2 4 2
n π  n π 
1 1
= 16 n sin n u(n) − 48 sin n u(n)
4 2 4 2

Hence

n π    n π  
1 1
X(z) = Z 16 n sin n u(n) − Z 48 sin n u(n)
4 2 4 2
 n π  

d 1 [ 14 sin(π/2)]z −1 1
= −z Z sin n u(n) − 48 1
2 ; |z| >
dz 4 2 1 − 2[ 4 cos(π/2)]z −1 + 4 z −2
1 4
1 −1 −1 −3
d 4z 12 z −1 4z − 4 z 1
12 z −1 1
= −z 1 −2
− 1 −2
= 1 −2 1 −4
− 1 −2
; |z| >
dz 1 + 16 z 1 + 16 z 1 + 8 z + 256 z 1 + 16 z 4
−8z −1 − 32 z −3 − 16
1 −5
z 1
= 3 −2 3 −4 1 −6
; |z| >
1 + 16 z + 256 z + 4096 z 4

M ATLAB script:
clc; close all; b = [0 -8 0 -1.5 0 -1/16]; a = [1 0 3/16 0 3/256 0 1/(256*16)];
[delta,n1] = impseq(0,0,9); xb1 = filter(b,a,delta);
[u,n2] = stepseq(0,0,9);xb2 = (((n2-3).*((1/4).^(n2-2))).*cos((pi/2)*(n2-1))).*u;
error = max(abs(xb1-xb2))
Hf_1 = figure; set(Hf_1,’NumberTitle’,’off’,’Name’,’P0405e’);
[Hz,Hp,Hl] = zplane(b,a); set(Hz,’linewidth’,1); set(Hp,’linewidth’,1);
title(’Pole-Zero plot’,’FontSize’,TFS); print -deps2 ../epsfiles/P0405e;
error =
2.9392e-015
The pole-zero plot is shown in Figure 4.5.

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
158 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

Pole−Zero plot
1

Imaginary Part
0.5
3
0
3
−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.5: Problem P4.5.5 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 159

P4.6 Consider the sequence x(n) = (0.9)n cos(πn/4)u(n). Let



x(n/2), n = 0, ±2, ±4, · · · ;
y(n) =
0, otherwise.

1. The z-transform Y (z) of y(n) in terms of the z-transform X(z) of x(n): Consider

 ∞

Y (z) = y(n)z −n = x(n/2)z −n ; n = 0, ±1, ±2, . . .
n=−∞ n=−∞
∞ ∞

−m
= x(m)z −2m = x(m) z 2 = X(z 2 )
m=−∞ m=−∞

2. The z-transform of x(n) is given by

1 − [(0.9) cos(π/4)]z −1
X(z) = Z [(0.9)n cos(πn/4)u(n)] =
1 − 2[(0.9) cos(π/4)]z −1 + (0.9)2 z −2
1 − 0.6364z −1
= ; |z| > 0.9
1 − 1.2728z −1 + 0.81z −2
Hence
1 − 0.6364z −2 √
Y (z) = −2 −4
; |z| > 0.9 = 0.9487
1 − 1.2728z + 0.81z
3. M ATLAB verification:
% P0406c.m
clc; close all;
b = [1 0 -0.9*cos(pi/4)]; a = [1 0 2*-0.9*cos(pi/4) 0 0.81];
[delta,n1] = impseq(0,0,13); xb1 = filter(b,a,delta);
[u,n2] = stepseq(0,0,6); x1 = (((0.9).^n2).*cos(pi*n2/4)).*u;
xb2 = zeros(1,2*length(x1)); xb2(1:2:end) = x1;
error = max(abs(xb1-xb2))
error =
1.2442e-016

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
160 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

P4.7 The z-transform computation using definition (4.1).


1. x(n) = {3, 2, 1, −2, −3}: Then X(z) = 3z 2 + 2z + 1 − 2z −1 + 3z −2 , 0 < |z| < ∞.

M ATLAB verification:
% P0407a.m
clc; close all;
b1 = [0 2 3]; a1 = [1]; [delta,n] = impseq(0,0,4);
xb1 = filter(b1,a1,delta); xb1 = fliplr(xb1); n1 = -fliplr(n);
b2 = [1 -2 -3]; a2 = [1]; xb2 = filter(b2,a2,delta); n2 = n;
[xa1,na1] = sigadd(xb1,n1,xb2,n2); xa2 = [0 0 3 2 1 -2 -3 0 0];
error = max(abs(xa1-xa2))
error =
0
2. x(n) = (0.8)n u(n − 2): Then


 ∞

n −n 2 −2 0.64z −2
X(z) = (0.8) z = (0.8) z (0.8)n z −n = ; |z| > 0.8
n=2 n=0
1 − 0.8z −1

M ATLAB verification:
% P0407b.m
clc; close all;
b = [0 0 0.64]; a = [1 -0.8]; [delta,n] = impseq(0,0,10);
xb1 = filter(b,a,delta);
[u,n] = stepseq(2,0,10); xb2 = ((0.8).^n).*u;
error = max(abs(xb1-xb2))
error =
1.1102e-016
3. x(n) = [(0.5)n + (−0.8)n ]u(n): Then

1 1
X(z) = Z [(0.5)n u(n)] + Z [(−0.8)n u(n)] = + ; {|z| > 0.5} ∩ {|z| > 0.8}
1 − 0.5z −1 1 + 0.8z −1
2 + 0.3z −1
= ; |z| > 0.8
1 + 0.3z −1 − 0.4z −2

M ATLAB verification:
% P0407c.m
clc; close all;
b = [ 2 0.3]; a = [1 0.3 -0.4]; [delta,n] = impseq(0,0,7);
xb1 = filter(b,a,delta);
[u,n] = stepseq(0,0,7); xb2 = (((0.5).^n).*u)+(((-0.8).^n).*u);
error = max(abs(xb1-xb2))
error =
1.1102e-016

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 161

4. x(n) = 2n cos(0.4πn)u(−n): Consider



 
0 ∞

X(z) = 2n cos(0.4πn)u(−n)z −n = 2n cos(0.4πn)z −n = 2−n cos(0.4πn)z n
n=−∞ n=−∞ n=0
∞ ∞ ∞

−n ej0.4πn
+e −j0.4πn
1 −1 j0.4π
n 1 −1 −j0.4π
n
= 2 zn = 2 e z + 2 e z
n=0
2 2 n=0
2 n=0

1 1 1 1
= + ; |z| < 2
2 1 − 12 ej0.4π z 2 1 − 12 e−j0.4π z
1 − [0.5 cos(0.4π)]z
= ; |z| < 2
1 − [cos(0.4π)]z + 0.25z 2

Hence
1 − [0.5 cos(0.4π)]z 1 − [0.5 cos(0.4π)]z
X(z) = = ; |z| < 2
1 − 2[0.5 cos(0.4π)]z + 0.25z 2 1 − [cos(0.4π)]z + 0.25z 2

M ATLAB verification:
% P0407d.m
clc; close all;
b = 0.5*[2 -cos(0.4*pi)]; a = [1 -cos(0.4*pi) 0.25];
[delta,n1] = impseq(0,0,7); xb1 = filter(b,a,delta); xb1 = fliplr(xb1);
[u,n2] = stepseq(-7,-7,0); xb2 = ((2.^n2).*cos(0.4*pi*n2)).*u;
error = max(abs(xb1-xb2))
error =
2.7756e-017

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
162 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

5. x(n) = (n + 1)(3)n u(n): Consider

x(n) = (n + 1)(3)n u(n) = n3n u(n) + 3n u(n)

Hence

d 1 1
X(z) = Z [n3 u(n)] + Z [3 u(n)] = −z
n n
+ ; |z| > 3
dz 1 − 3z −1 1 − 3z −1
3z −1 1 1 − 3z −1
= + = ; |z| > 3
1 − 6z −1 + 9z −2 1 − 3z −1 1 − 9z −1 + 27z −2 − 27z −3
M ATLAB verification:
% P0407e.m
clc; close all;
b = [1 -3]; a = [1 -9 27 -27]; [delta,n1] = impseq(0,0,7);
xb1 = filter(b,a,delta);
[u,n2] = stepseq(0,0,7); xb2 = ((n2+1).*(3.^n2)).*u;
error = max(abs(xb1-xb2))
error =
0

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 163

P4.8 Let x(n) be a complex-valued sequence with the real part xR (n) and the imaginary part xI (n).
1. The z-transform relations for real and imaginary parts.: Consider
 
 x(n) + x∗ (n) Z [x(n)] + Z [x∗ (n)]
XR (z)=Z [xR (n)] = Z =
2 2
∗ ∗
X(z) + X (z )
= (4.1)
2
and  
 x(n) − x∗ (n) Z [x(n)] − Z [x∗ (n)]
XI (z)=Z [xI (n)] = Z =
2 2
∗ ∗
X(z) − X (z )
= (4.2)
2

2. Verification using x(n) = exp {(−1 + j0.2π)n} u(n): Consider


x(n) = exp {(−1 + j0.2π)n} u(n) = e−n ej0.2πn u(n)
= e−n {cos(0.2πn)u(n) + j sin(0.2πn)u(n)}
Hence the real and imaginary parts of x(n), respectively, are
xR (n) = e−n cos(0.2πn)u(n) = (1/e) cos(0.2πn)u(n)
n
(4.3)
−n n
xI (n) = e sin(0.2πn)u(n) = (1/e) sin(0.2πn)u(n) (4.4)
with z-transforms , respectively,
1 − [(1/e) cos(0.2π)]z −1 1 − 0.2976z −1
XR (z) = −1 −2
= , |z| > 1/e (4.5)
1 − [(2/e) cos(0.2π)]z + (1/e )z 2 1 − 0.5952z −1 + 0.1353z −2
[(1/e) sin(0.2π)]z −1 0.2162z −1
XI (z) = −1 −2
= , |z| > 1/e (4.6)
1 − [(2/e) cos(0.2π)]z + (1/e )z 2 1 − 0.5952z −1 + 0.1353z −2
The z-transform of x(n) is

n  1
X(z) = Z e−1+j0.2π u(n) = , |z| > 1/e (4.7)
1 − e−1+j0.2π z −1
Substituting (4.7) in (4.1),
 ∗ 
1 1 1
XR (z) = +
2 1 − e−1+j2π z −1 1 − e−1+j2π z −∗
   
1 1 1 1 2 − 0.5952z −1
= + =
2 1 − e−1+j2π z −1 1 − e−1−j2π z −1 2 1 − 0.5952z −1 + 0.1353z −2
−1
1 − 0.2976z
= , |z| > e−1 (4.8)
1 − 0.5952z −1 + 0.1353z −2
as expected in (4.5). Similarly, Substituting (4.7) in (4.2),
 ∗ 
1 1 1
XI (z) = −
2 1 − e−1+j2π z −1 1 − e−1+j2π z −∗
   
1 1 1 1 0.2162z −1
= − =
2 1 − e−1+j2π z −1 1 − e−1−j2π z −1 2 1 − 0.5952z −1 + 0.1353z −2
−1
0.2162z
= , |z| > e−1 (4.9)
1 − 0.5952z −1 + 0.1353z −2
as expected in (4.6).

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
164 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

P4.9 The inverse z-transform of X(z) is x(n) = (1/2)n u(n). Sequence computation Using the z-transform
properties:
z−1
1. X1 (z) = z X(z): Consider
 
−1 −1 1 
x1 (n) = Z [X1 (z)] = Z 1− X(z) = Z −1 X(z) − z −1 X(z)
z
= x(n) − x(n − 1) = 0.5n u(n) − 0.5n−1 u(n − 1) = 1 − 0.5n u(n − 1)

2. X2 (z) = zX(z −1 ): Consider


   
x2 (n) = Z −1 [X2 (z)] = Z −1 zX(z −1 ) = Z −1 X(z −1 ) n→(n+1) = Z −1 [X(z)]n→−(n+1)
= (0.5)−(n+1) u(−n − 1) = 2n+1 u(−n − 1)

3. X3 (z) = 2X(3z) + 3X(z/3): Consider

x3 (n) = Z −1 [X3 (z)] = Z −1 [2X(3z) + 3X(z/3)] = 2(3−n )x(n) + 3(3n )x(n)


 n n 
−n −n n −n 1 3
= 2(3 )(2 )u(n) + 3(3 )(2 )u(n) = 2 +3 u(n)
6 2

4. X4 (z) = X(z)X(z −1 ): Consider



x4 (n) = Z −1 [X4 (z)] = Z −1 X(z)X(z −1 ) = x(n) ∗ x(−n)


= [0.5n u(n)] ∗ [2n u(−n)] = (0.5)k u(k)2n−k u(−n + k)
k=−∞
 ∞  ∞
2 k=0 (0.5)k 2−k ,
n
n < 0; 2n k=−∞ k
∞(0.25) , k n < 0;
= ∞ =
2n k=n (0.5)k 2−k , n ≥ 0. n −2n
2 2 k=−∞ (0.25) , n ≥ 0.
4 |n|
= 2
3

5. X5 (z) = z 2 dX(z)
dz : Consider
 
dX(z)
x5 (n) = Z −1 [X5 (z)] = Z −1 z 2 = n2 x(n)
dz
= n2 (1/2)n u(n)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 165

P4.10 The M ATLAB function deconv_m:

function [p,np,r,nr] = deconv_m(b,nb,a,na)


% Modified deconvolution routine for noncausal sequences
% function [p,np,r,nr] = deconv_m(b,nb,a,na)
%
% p = polynomial part of support np1 <= n <= np2
% np = [np1, np2]
% r = remainder part of support nr1 <= n <= nr2
% nr = [nr1, nr2]
% b = numerator polynomial of support nb1 <= n <= nb2
% nb = [nb1, nb2]
% a = denominator polynomial of support na1 <= n <= na2
% na = [na1, na2]
%
[p,r] = deconv(b,a);
np1 = nb(1) - na(1); np2 = np1 + length(p)-1; np = [np1:np2];
nr1 = nb(1); nr2 = nr1 + length(r)-1; nr = [nr1:nr2];

M ATLAB verification:

% P0410
clc; close all;
nb = [-2:3]; b = [1 1 1 1 1 1]; na = [-1:1]; a = [1 2 1];
[p,np,r,nr] = deconv_m(b,nb,a,na)
p =
1 -1 2 -2
np =
-1 0 1 2
r =
0 0 0 0 3 3
nr =
-2 -1 0 1 2 3

Hence
z 2 + z + 1 + z −1 + z −2 + z −3 3z −2 + 3z −3
−1
= (z − 1 + 2z −1 − 2z −2 ) +
z+2+z z + 2 + z −1

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
166 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

P4.11 Inverse z-transforms using the partial fraction expansion method:


1. X1 (z) = (1 − z −1 − 4z −2 + 4z −3 )/(1 − 11 −1
4 z + 13 −2
8 z − 14 z −3 ). The sequence is right-sided.
M ATLAB script:
% P0411a: Inverse z-Transform of X1(z)
clc; close all;
b1 = [1,-1,-4,4]; a1 = [1,-11/4,13/8,-1/4];
[R,p,k] = residuez(b1,a1)
R =
0.0000
-10.0000
27.0000
p =
2.0000
0.5000
0.2500
k =
-16
or

1 − z −1 − 4z −2 + 4z −3 0 10 27
X1 (z) = 11 −1 13 −2 1 −3 = −16 + 1 − 2z −1 − 1 − 0.5z −1 + 1 − 0.25z −1 , |z| > 0.5
1 − 4 z + 8 z − 4z

Note that from the second term on the right, there is a pole-zero cancellation. Hence

x1 (n) = −16δ(n) − 10(0.5)n u(n) + 27(0.25)n u(n)

2. X2 (z) = (1+z −1 −4z −2 +4z −3 )/(1− 11


4 z
−1
+ 13
8 z
−2
− 14 z −3 ). The sequence is absolutely summable.
M ATLAB script:
% P0411b: Inverse z-Transform of X2(z)
clc; close all;
b2 = [1,1,-4,4]; a2 = [1,-11/4,13/8,-1/4];
[R,p,k] = residuez(b2,a2)
R =
1.5238
-12.6667
28.1429
p =
2.0000
0.5000
0.2500
k =
-16
or

1 − z −1 − 4z −2 + 4z −3 1.5238 12.6667 28.1429


X2 (z) = 11 −1 13 −2 1 −3 = −16 + 1 − 2z −1 − 1 − 0.5z −1 + 1 − 0.25z −1 , 0.5 < |z| > 2
1 − 4 z + 8 z − 4z

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 167

Hence

x2 (n) = −16δ(n) − 1.5238(2)n u(−n − 1) − 12.6667(0.5)n u(n) + 28.1429(0.25)n u(n)

3. X3 (z) = (z 3 − 3z 2 + 4z + 1)/(z 3 − 4z 2 + z − 0.16). The sequence is left-sided. Consider

z 3 − 3z 2 + 4z + 1 1 − 3z −1 + 4z −2 + z −3
X3 (z) = =
z − 4z + z − 0.16
3 2 1 − 4z −1 + z −2 − 0.16z −3
M ATLAB script for the PFE:
% P0411c: Inverse z-Transform of X3(z)
clc; close all;
b3 = [1,-3,4,1]; a3 = [1,-4,1,-0.16];
[R,p,k] = residuez(b3,a3)
% R =
% 0.5383
% 3.3559 + 5.7659i
% 3.3559 - 5.7659i
% p =
% 3.7443
% 0.1278 + 0.1625i
% 0.1278 - 0.1625i
% k =
% -6.2500

r = abs(p(2))
% r =
% 0.2067

[b,a] = residuez(R(2:3),p(2:3),[])
% b =
% 6.7117 -2.7313
% a =
% 1.0000 -0.2557 0.0427
or
0.5383 3.3559 + j5.7659
X3 (z) = −6.25 + +
1 − 3.7443z −1 1 − (0.1278 + j0.1625)z −1
3.3559 − j5.7659
+ , |z| < 0.2067
1 − (0.1278 − j0.1625)z −1

Hence

x3 (n) = −6.25δ(n) − 0.5383(3.7443)n u(−n − 1)


− (3.3559 + j5.7659)(0.1278 + j0.1625)n u(−n − 1)
− (3.3559 − j5.7659)(0.1278 − j0.1625)n u(−n − 1)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
168 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

4. X4 (z) = z/(z 3 + 2z 2 + 1.25z + 0.25), |z| > 1. Consider


z z −2
X4 (z) = 3 =
z + 2z 2 + 1.25z + 0.25 1 + 2z −1 + 1.25z −2 + 0.25z −3
M ATLAB script for the PFE:
% P0411d: Inverse z-Transform of X4(z)
clc; close all;
b4 = [0,0,1]; a4 = [1,2,1.25,0.25];
[R,p,k] = residuez(b4,a4)
R =
4.0000
-0.0000 + 0.0000i
-4.0000 - 0.0000i
p =
-1.0000
-0.5000 + 0.0000i
-0.5000 - 0.0000i
k =
[]
or
4 4 4 0.5z −1
X4 (z) = −1
− 2 = −1
− 8z 2 , |z| > 1
1+z (1 + 0.5z −1 ) 1+z (1 + 0.5z −1 )
Hence
x4 (n) = 4(−1)n u(n) − 8(n + 1)(0.5)n+1 u(n + 1)
5. X5 (z) = z/(z 2 − 0.25)2 , |z| < 0.5. Consider
z z −3
X5 (z) = = , |z| < 0.5
(z 2 − 0.25)2 (1 − 0.25z −2 )2
M ATLAB script for PFE:
% P0411e: Inverse z-Transform of X5(z)
clc; close all;
b5 = [0,0,0,1]; a5 = conv([1,0,-0.25],[1,0,-0.25]);
[R,p,k] = residuez(b5,a5)
R =
4.0000 + 0.0000i
-2.0000
-4.0000 - 0.0000i
2.0000 + 0.0000i
p =
-0.5000
-0.5000
0.5000 + 0.0000i
0.5000 - 0.0000i
k =
[]

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 169

or
4 1 1 1
X5 (z) = −2 −4 +2 , |z| < 0.5
1 + 0.5z −1 (1 + 0.5z −1 )2 1 − 0.5z −1 (1 − 0.5z −1 )2
4 (−0.5)z −1 1 0.5z −1
= −1
+ 4z −1
−4 −1
+ 4z , |z| < 0.5
1 − (−0.5)z [1 − (−0.5)z ] 2 1 − 0.5z (1 − 0.5z −1 )2

Hence

x5 (n) = −4(−0.5)n u(−n − 1) − 4(n + 1)(−0.5)n u[−(n + 1) − 1] + 4(0.5)n u(−n − 1)


− 4(n + 1)(0.5)n u[−(n + 1) − 1]
= −4(−0.5)n u(−n − 1) − 4(n + 1)(−0.5)n u[−n − 2] + 4(0.5)n u(−n − 1)
− 4(n + 1)(0.5)n u[−n − 2]
= 4(0.5)n [1 − (−1)n ] u(−n − 1) − 4(n + 1)(0.5)n [1 + (−1)n ] u(−n − 2)

P4.12 Consider the sequence given below:

x(n) = Ac (r)n cos(πv0 n)u(n) + As (r)n sin(πv0 n)u(n) (4.10)

1. The z-transform of x(n) in (4.10): Taking z-transform of (4.10),

1 − r cos(πv0 )z −1 r sin(πv0 )z −1
X(z) = Ac + A s
1 − 2r cos(πv0 )z −1 + r2 z −2 1 − 2r cos(πv0 )z −1 + r2 z −2
−1
Ac + r [As sin(πv0 ) − Ac cos(πv0 )] z  b0 + b1 z −1
= = ; |z| > |r|
1 − 2r cos(πv0 )z −1 + r2 z −2 1 + a1 z −1 + a2 z −2

Comparing the last step above, we have

b0 = Ac ; b1 = r[As sin(πv0 ) − Ac cos(πv0 )]; a1 = −2r cos(πv0 ); a2 = r2 (4.11)

2. The signal parameters Ac , As , r, and v0 in terms of the rational function parameters b0 , b1 , a1 , and
a2 : Using (4.11) and solving parameters in the following order: Ac , then r, then v0 , and finally As , we
obtain
√ arccos(−a1 /2r) 2b1 − a1 b0
Ac = b0 ; r= a2 ; v0 = ; As = 
π 4a2 − a21

3. M ATLAB function invCCPP:


function [Ac,As,r,v0] = inv_CC_PP(b0,b1,a1,a2)
% [Ac,As,r,v0] = inv_CC_PP(b0,b1,a1,a2)
Ac = b0;
r = sqrt(a2);
w0 = acos(-a1/(2*r));
As = (b1/r+Ac*cos(w0))/sin(w0);
v0 = w0/(pi);

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
170 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

P4.13 A stable, linear and time-invariant system is given by the following system function
√ √
4z 2 − 2 2z + 1 4 − 2 2z −1 + z −2
H(z) = √ = √ (4.12)
z 2 − 2 2z + 4 1 − 2 2z −1 + 4z −2

j45 −1

1 − 0.5e z 1 − 0.5e−j45 z −1
= , |z| < 2 (for stability) (4.13)
(1 − 2ej45◦ z −1 ) (1 − 2e−j45◦ z −1 )
◦ ◦
2.1866e−j30.96 2.1866ej30.96
= 0.25 + ◦ −1 + , |z| < 2 (4.14)
1 − 2ej45 z 1 − 2e−j45◦ z −1
which is an anti-causal system.
1. The difference equation representation: From (4.12) above,
√ √
y(n) − 2 2y(n − 1) + 4y(n − 2) = 4x(n) − 2 2x(n − 1) + x(n − 2)
Hence for anti-causal implementation
1 1 1 1
y(n) = x(n) − √ x(n + 1) + x(n + 2) + √ y(n + 1) − y(n + 2)
4 2 2 4
◦ ◦
2. The pole-zero plot: From (4.13), the zeros are at 0.5e±45 and poles are at 2e±45 . The pole-zero plot
is shown in Figure 4.6.

Pole−Zero plot
Imaginary Part

−1

−1 0 1 2
Real Part

Figure 4.6: Problem P4.13 pole-zero plot

3. The unit sample response h(n): From (4.14),


 ◦
 
◦ n ◦
  
◦ n
h(n) = 0.25δ(n) − 2.1866e−j30.96 2ej45 + 2.1866ej30.96 2e−j45 u(−n − 1)
 ◦ ◦

= 0.25δ(n) − 2.1866(2)n e−j30.96 ejπ/4n + ej30.96 e−jπ/4n u(−n − 1)
= 0.25δ(n) − 2.1866(2)n cos(πn/4 − 30.96◦ )u(−n − 1)
4. The system is anti-causal. The causal (but not stable) unit-sample response is given by the system
function
◦ ◦
2.1866e−j30.96 2.1866ej30.96
H(z) = 0.25 + ◦ −1 + , |z| > 2
1 − 2ej45 z 1 − 2e−j45◦ z −1
Hence
h(n) = 0.25δ(n) + 2.1866(2)n cos(πn/4 − 30.96◦ )u(n)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 171

P4.14 The zero-input, zero-state, and steady-state responses of the system

y(n) = 0.9801y(n − 2) + x(n) + 2x(n − 1) + x(n − 2), n ≥ 0; y(−2) = 1, y(−1) = 0

to the input x(n) = 5(−1)n u(n): After taking the one-sided z-transform of the above difference equation,
we obtain
 
Y + (z) = 0.9801 y(−2) + y(−1)z −1 + z −2 Y + (z) + X + (z) + 2 x(−1) + z −1 X + (z)

+ x(−2) + x(−1)z −1 + z −2 X + (z)

5
After substituting the initial conditions and X(z) = Z [5(−1)n u(n)] = , we obtain
1 + z −1

1 + 2z −1 + z −2 + [2x(−1) + x(−2) + 0.9801y(−2)] + [2 + x(−1)]z −1


Y + (z) = X (z) +
1 − 0.9801z −2 1 − 0.9801z −2
−1 −2

1 + 2z + z 5 0.9801 + 2z −1
= −2 −1
+ (4.15)
1 − 0.9801z 1+z 1 − 0.9801z −2
5 + 10z −1 + 5z −2 0.9801 + 2z −1
= −1 −2 −3
+ (4.16)
1 + z − 0.9801z − 0.9801z 1 − 0.9801z −2
5.9801 + 12.9801z −1 + 7z −2
=
1 + z −1 − 0.9801z −2 − 0.9801z −3
−0.5453 6.5254
= −1
+ (4.17)
1 + 0.99z 1 − 0.99z −1
Hence

y(n) = −0.5453(−0.99)n u(n) + 6.5254(0.99)n u(n)

(a) Zero-input response: From (4.15), we have

0.9801 + 2z −1 −0.5201 1.5002


HZI (z) = −2
= −1
+
1 − 0.9801z 1 + 0.99z 1 − 0.99z −1
Hence

yZI (n) = −0.5201(−0.99)n u(n) + 1.5002(0.99)n u(n)

(b) Zero-state response: From (4.16), we have

5 + 10z −1 + 5z −2 −0.0253 5.0253


HZS (z) = −1 −2 −3
= −1
+
1 + z − 0.9801z − 0.9801z 1 + 0.99z 1 − 0.99z −1
Hence

yZS (n) = −0.0253(−0.99)n u(n) + 5.0253(0.99)n u(n)

(c) Steady-state response: Since the total response y(n) goes to zero as n  ∞, there is no steady-state
response.
P4.15 A digital filter is described by the frequency response function

H(ejω ) = [1 + 2 cos(ω) + 3 cos(2ω)] cos(ω/2)e−j5ω/2

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
172 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

which can be written as


 jω j2ω  j 1 ω
e + e−jω + e−j2ω e 2 + e−j 2 ω −j 5 ω
1
jω e
H(e ) = 1 + 2 +3 e 2
2 2 2
3 5 5 3
= + e−jω + e−j2ω + e−j3ω + e−j4ω + e−j5ω
4 4 4 4
or after substituting e−jω = z −1 , we obtain
3 5 −1 5 3
H(z) = + z + z −2 + z −3 + z −4 + z −5
4 4 4 4
1. The difference equation representation: From H(z) above

3 5 5 3
y(n) = x(n) + x(n − 1) + x(n − 2) + x(n − 3) + x(n − 4) + x(n − 5)
4 4 4 4
2. The magnitude and phase response plots are shown in Figure 4.7.

Magnitude Response Phase Response


180
6
Magnitude

4
Degree

0
−45
2
1.41

0 −180
0 0.25 0.5 0.75 1 0 0.25 0.5 0.75 1
ω/π ω/π

Figure 4.7: Problem P4.15.2 frequency-response plots



The magnitude and phase at ω = π/2 are 2 and −45◦ , respectively. The magnitude at ω = π is zero.
3. The output sequence y(n) for the input x(n) = sin(πn/2) + 5 cos(πn): M ATLAB script:
clc; close all; set(0,’defaultfigurepaperposition’,[0,0,7,5]);
b = [3/4 5/4 1 1 5/4 3/4]; a = [1 0];
n = 0:200; x = sin(pi*n/2)+5*cos(pi*n); y = filter(b,a,x);
Hf_1 = figure; set(Hf_1,’NumberTitle’,’off’,’Name’,’P0415c’);
subplot(2,1,1); Hs = stem(n,x); set(Hs,’markersize’,2); axis([-2 202 -7 6]);
xlabel(’n’,’FontSize’,LFS); ylabel(’x(n)’,’FontSize’,LFS);
title(’x(n) = sin(\pi \times n / 2)+5 \times cos(\pi \times n)’,...
’FontSize’,TFS);
subplot(2,1,2); Hs = stem(n,y); set(Hs,’markersize’,2); axis([-2 202 -2 4]);
xlabel(’n’,’FontSize’,LFS); ylabel(’y(n)’,’FontSize’,LFS);
title(’Output sequence after filtering’,’FontSize’,TFS);
print -deps2 ../epsfiles/P0415c;

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 173

The input and output sequence plots are shown in Figure 4.8. It shows that the sinusoidal sequence
with the input frequency ω = π is completely suppressed in the steady-state output. The steady-state
response of x(n) = sin(πn/2) should be (using the magnitude and phase at ω = π/2 computed in part
2. above)
√ √ √
yss (n) = 2 sin(πn/2 − 45◦ ) = 2 cos(45◦ ) sin(πn/2) − 2 sin(45◦ ) cos(πn/2)
= sin(πn/2) − cos(πn/2) = {. . . , −1, 1, 1, −1, −1, . . . }

as verified in the bottom plot of Figure 4.8.

x(n) = sin(π × n / 2)+5 × cos(π × n)


6

2
x(n)

−2

−4

−6

0 20 40 60 80 100 120 140 160 180 200


n
Output sequence after filtering
4

2
y(n)

−1

−2
0 20 40 60 80 100 120 140 160 180 200
n

Figure 4.8: Problem P4.15.3 input and output sequence plots

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
174 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

P4.16 A digital filter is described by the frequency response function

1 + e−j4ω
H(ejω ) =
1 − 0.8145e−j4ω

which after substituting e−jω = z −1 becomes

1 + z −4
H(z) =
1 − 0.8145z −4

1. The difference equation representation: From H(z) above

y(n) = x(n) + x(n − 4) + 0.8145y(n − 4)

2. The magnitude and phase response plots are shown in Figure 4.9.

Magnitude Response Phase Response


10.78 180
10

90
Magnitude

Degree

0
5

−90

0 −180
0 0.25 0.5 0.75 1 0 0.25 0.5 0.75 1
ω/π ω/π

Figure 4.9: Problem P4.16.2 frequency-response plots

The magnitudes and phases at both ω = π/2 and ω = π are 10.78 and 0◦ , respectively.
3. The output sequence y(n) for the input x(n) = sin(πn/2) + 5 cos(πn): M ATLAB script:
clc; close all; set(0,’defaultfigurepaperposition’,[0,0,7,5]);
b = [1 0 0 0 1]; a = [1 0 0 0 -0.8145];
n = 0:200; x = sin(pi*n/2)+5*cos(pi*n); y = filter(b,a,x);
Hf_1 = figure; set(Hf_1,’NumberTitle’,’off’,’Name’,’P0416c’);
subplot(2,1,1); Hs = stem(n,x); set(Hs,’markersize’,2); axis([-2 202 -7 7]);
xlabel(’n’,’FontSize’,LFS); ylabel(’x(n)’,’FontSize’,LFS);
title(’x(n) = sin(\pi \times n / 2)+5 \times cos(\pi \times n)’,...
’FontSize’,TFS);
subplot(2,1,2); Hs = stem(n,y); set(Hs,’markersize’,2); axis([-2 202 -70 70]);
xlabel(’n’,’FontSize’,LFS); ylabel(’y(n)’,’FontSize’,LFS);
title(’Output sequence after filtering’,’FontSize’,TFS);
print -deps2 ../epsfiles/P0416c;

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 175

The input and output sequence plots are shown in Figure 4.10.The steady-state response of x(n) should
be (using the magnitude and phase at ω = π/2 computed in part 2. above)

yss (n) = 10.78 sin(πn/2) + 10.78 × 5 cos(πn)


= 10.78sin(πn/2) + 53.91cos(πn/2)

The bottom plot of Figure 4.10 shows that both sinusoidal sequences have the scaling of 10.78 and no
delay distortion.

x(n) = sin(π × n / 2)+5 × cos(π × n)


6

2
x(n)

−2

−4

−6

0 20 40 60 80 100 120 140 160 180 200


n
Output sequence after filtering
60

40

20
y(n)

−20

−40

−60

0 20 40 60 80 100 120 140 160 180 200


n

Figure 4.10: Problem P4.16.3 input and output sequence plots

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
176 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

P4.17 Suppose X(z) is given as follows:


2 + 3z −1
X(z) = , |z| > 0.9
1 − z −1 + 0.81z −2
1. The signal x(n) in a form that contains no complex numbers: M ATLAB script:
% P0417.m
clc; close all;
b0 = 2; b1 = 3; a1 = -1; a2 = 0.81;
% (a): Computation of sequence parameters
[Ac,As,r,v0] = invCCPP(b0,b1,a1,a2);
disp(sprintf(’\nx(n) = %1i*(%3.1f)^n*cos(%5.4f*pi*n)u(n) ’,Ac,r,v0));
disp(sprintf(’ + %5.4f*(%3.1f)^n*sin(%5.4f*pi*n)u(n)\n’,As,r,v0));

x(n) = 2*(0.9)^n*cos(0.3125*pi*n)u(n)
+ 5.3452*(0.9)^n*sin(0.3125*pi*n)u(n)
Hence
x(n) = 2(0.9)n cos(0.3125πn)u(n) + 5.3452(0.9)n sin(0.3125πn)u(n)

2. M ATLAB verification:
% (b) Matlab Verification
n = 0:20; x = Ac*(r.^n).*cos(v0*pi*n) + As*(r.^n).*sin(v0*pi*n);
y = filter([b0,b1],[1,a1,a2],impseq(0,0,20));
error = abs(max(x-y))
error =
1.7764e-015
P4.18 The z-transform of a causal sequence is given as:
−2 + 5.65z −1 − 2.88z −2
X(z) = (4.18)
1 − 0.1z −1 + 0.09z −2 + 0.648z −3
which contains a complex-conjugate pole pair as well as a real-valued pole.
1. Rearrangement of X(z) into a first- and second-order sections: M ATLAB Script:
% P0418
clc; close all;
b = [-2 5.65 -2.88]; a = [1 -0.1 .09 0.648]; [R,p,k] = residuez(b,a)
R =
1.0000 - 0.8660i
1.0000 + 0.8660i
-4.0000
p =
0.4500 + 0.7794i
0.4500 - 0.7794i
-0.8000
k =
[]
[b1,a1] = residuez(R(1:2),p(1:2),k)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 177

b1 =
2.0000 0.4500
a1 =
1.0000 -0.9000 0.8100
Hence
(2) + (0.45)z −1 (−4)
X(z) = +
1 + (−0.9)z −1 + (0.81)z −2 1 − (−0.8)z −1
2. Computation of the causal sequence x(n) from the X(z) so that it contains no complex numbers:
M ATLAB Script:
[Ac,As,r,v0] = invCCPP(b1(1),b1(2),a1(2),a1(3));
disp(sprintf(’\nx1(n) = %2.0f*(%3.1f)^n*cos(%5.4f*pi*n)u(n) ’,Ac,r,v0));
disp(sprintf(’ + %5.4f*(%3.1f)^n*sin(%5.4f*pi*n)u(n)\n’,As,r,v0));
x1(n) = 2*(0.9)^n*cos(0.3333*pi*n)u(n)
+ 1.7321*(0.9)^n*sin(0.3333*pi*n)u(n)
Hence the sequence x(n) is:

x(n) = 2(0.9)n cos(πn/3)u(n) + 3(0.9)n sin(πn/3)u(n) − 4(−0.8)n u(n)

P4.19 System representations and input/output calculations:


1. h(n) = 5(1/4)n u(n)
i. The system function: Taking the z-transform of h(n),
5
H(z) = Z [h(n)] = Z [5(1/4)n u(n)] = , |z| > 0.5
1 − 0.25z −1
ii. The difference equation representation: From H(z) above,

y(n) = 5x(n) + 0.25y(n − 1)

iii. The pole-zero plot is shown in Figure 4.11.

Pole−Zero plot
1
Imaginary Part

0.5

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.11: Problem P4.19.1 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
178 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E
1
n
iv. The output y(n) for the input x(n) = 4 u(n): Taking the z-transform of x(n),

1
X(z) = Z [(1/4)n u(n)] = , |z| > 0.25
1 − 0.25z −1

Now the z-transform of y(n) is



5 1 5
Y (z) = H(z)X(z) =
1 − 0.25z −1 1 − 0.25z −1
= 2 , |z| > 0.25
(1 − 0.25z −1 )
0.25z −1
= 20z 2 , |z| > 0.25
(1 − 0.25z −1 )

Hence

y(n) = 20(n + 1)(0.25)n+1 u(n + 1)

2. h(n) = n(1/3)n u(n) + (−1/4)n u(n)


i. The system function: Taking the z-transform of h(n)

H(z) = Z [h(n)] = Z [n(1/3)n u(n) + (−1/4)n u(n)]


(1/3)z −1 1
= + , |z| > (1/3)
[1 − (1/3)z −1 ]
2 1 + (1/4)z −1
1 − 13 z −1 + 36
7 −2
z
= 5 −1 1 −2 1 −3 , |z| > (1/3)
1− 12 z − 18 z + 36 z

ii. The difference equation representation: From H(z) above,

1 7 5 1 1
y(n) = x(n) − x(n − 1) + x(n − 2) + y(n − 1) + y(n − 2) − y(n − 3)
3 36 12 18 36
iii. The pole-zero plot is shown in Figure 4.12.

Pole−Zero plot
1
Imaginary Part

0.5

2
0

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.12: Problem P4.19.2 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 179
1
n
iv. The output y(n) for the input x(n) = 4 u(n): Taking the z-transform of x(n),
1 1
X(z) = Z [(1/4)n u(n)] = , |z| >
1 − 14 z −1 4

Now the z-transform of y(n) is



1 − 13 z −1 + 36
7 −2
z 1 1
Y (z) = H(z)X(z) = , |z| >
5 −1 1 −2
1 − 12 z − 18 z + 36 1 −3
z 1 − 0.25z −1 3
1 25
−16 4 1
= 1 −1 +
+ 2
−1
+ 2
−1
, |z| >
1 − 3z 1 − 3 z −1
1 2 1
1 + 4z 1 − 4z
1 3
1 −1 1 25
−16 3z 1
= 1 −1 + 12z
+ 2
−1
+ 2
−1
, |z| >
1 − 3z 1 − 1 z −1
2 1
1 + 4z 1 − 4z
1 3
3

Hence

y(n) = −16( 13 )n u(n) + 12(n + 1)( 13 )n+1 u(n + 1) + 12 (− 14 )n u(n) + 25 1 n


2 ( 4 ) u(n)

3. h(n) = 3(0.9)n cos(πn/4 + π/3)u(n + 1): Consider


   
10 n+1 π(n + 1) π
h(n) = (0.9) cos + u(n + 1)
3 4 12
 π  π 
10
= cos (0.9)n+1 cos (n + 1) u(n + 1)
3 12 4
    π 
10 π
− sin (0.9)n+1 sin (n + 1) u(n + 1)
3 12 4
π  π 
= 3.2198(0.9)n+1 cos (n + 1) u(n + 1) − 0.8627(0.9)n+1 sin (n + 1) u(n + 1)
4 4
i. The system function: Taking the z-transform of h(n)

H(z) = Z [h(n)]

1 − 0.6364z −1 0.6364z −1
= z 3.2198 − 0.8627
1 − 1.2728z −1 + 0.81z −2 1 − 1.2728z −1 + 0.81z −2
3.2198z − 2.5981
= , |z| > 0.9
1 − 1.2728z −1 + 0.81z −2
ii. The difference equation representation: From H(z) above,

y(n) = 3.2198x(n + 1) − 2.5981x(n) + 1.2728y(n − 1) − 0.81y(n − 2)

iii. The pole-zero plot is shown in Figure 4.13.



n 1
iv. The output y(n) for the input x(n) = 14 u(n): The z-transform of x(n) is X(z) = ,
1 − 0.25z −1
|z| > 0.25. Now the z-transform of y(n) is

3.2198z − 2.5981 1
Y (z) = H(z)X(z) = , |z| > 0.9
1 − 1.2728z −1 + 0.81z −2 1 − 0.25z −1

4.0285 − 2.6203z −1 0.8087
=z −1 −2
− , |z| > 0.9
1.0000 − 1.2728z + 0.81z 1 − 14 z −1

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
180 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

Pole−Zero plot
1

Imaginary Part
0.5

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.13: Problem P4.19.3 pole-zero plot

Hence
     
π(n + 1) π(n + 1)
y(n) = 4.0285(0.9)n+1 cos − 0.0889(0.9)n+1 sin − 0.8087( 14 )n+1 u(n + 1)
4 4
(0.5)n sin[(n + 1)π/3]
4. h(n) = u(n): Consider
sin(π/3)
1  n
 πn π  
h(n) = (0.5) sin + u(n)
sin( π ) 3 3
 3    π    π  π 
1 π n 1
= π sin (0.5) sin n u(n) + π cos (0.5)n cos n u(n)
sin( 3 ) 3 3 sin( ) 3 3
π  π  3
= (0.5)n sin n u(n) + 0.5774(0.5)n cos n u(n)
3 3
i. The system function: Taking the z-transform of h(n)
0.4330z −1 1 − 0.25z −1
H(z) = Z [h(n)] = + 0.5774
1 − 0.5z −1 + 0.25z −2 1 − 0.5z −1 + 0.25z −2
−1
0.5774 + 0.2887z
= , |z| > 0.5
1 − 0.5z −1 + 0.25z −2
ii. The difference equation representation: From H(z) above,
y(n) = 0.5774x(n) + 0.2887x(n − 1) + 0.5y(n − 1) − 0.25y(n − 2)
iii. The pole-zero plot is shown in Figure 4.14.

n 1
iv. The output y(n) for the input x(n) = 14 u(n): The z-transform of x(n) is X(z) = ,
1 − 0.25z −1
|z| > 0.25. Now the z-transform of y(n) is

0.5774 + 0.2887z −1 1
Y (z) = H(z)X(z) = , |z| > 0.5
1 − 0.5z −1 + 0.25z −2 1 − 0.25z −1
0.5774z −1 0.5774
= −1 −2
− , |z| > 0.5
1.0000 − 0.5z + 0.25z 1 − 14 z −1

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 181

Pole−Zero plot
1

Imaginary Part
0.5

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.14: Problem P4.19.4 pole-zero plot

Hence
4
y(n) = (0.5)n sin( π3 n)u(n) + 0.5774( 14 )n u(n)
3
5. h(n) = [2 − sin(πn)]u(n) = 2u(n)
2
i. The system function: H(z) = Z [h(n)] = Z [2u(n)] = , |z| > 1.
1 − z −1
ii. The difference equation representation: y(n) = 2x(n) + y(n − 1)
iii. The pole-zero plot is shown in Figure 4.15.

Pole−Zero plot
1
Imaginary Part

0.5

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.15: Problem P4.19.5 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
182 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E
1
n
iv. The output y(n) for the input x(n) = 4 u(n): Taking the z-transform of x(n),

1
X(z) = Z [(1/4)n u(n)] = , |z| > 0.25
1 − 0.25z −1
Now the z-transform of y(n) is

2 1
Y (z) = H(z)X(z) = , |z| > 1
1 − z −1 1 − 0.25z −1
8/3 2/3
= − , |z| > 1
1 − z −1 1 − 14 z −1

Hence
n
8 2 1
y(n) = u(n) − u(n)
3 3 4

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 183

P4.20 Consider the system shown below.

1. The overall system impulse response, h(n), using the z-transform approach: The above system is given
by

1 
H(z) = H2 (z) [1 + H1 (z)] = −1
1 + 0.25z −2 − z −1
1 − 0.5z

2
1 − 0.5z −1
= = 1 − 0.5z −1 , |z| = 0
1 − 0.5z −1
Hence after taking inverse z-transform , we obtain

1
h(n) = δ(n) − δ(n − 1)
2
2. Difference equation representation of the overall system: From the overall system function H(z),

Y (z)
H(z) = = 1 − 0.5z −1 ⇒ y(n) = x(n) − 0.5x(n − 1)
X(z)

3. Causality and stability: Since h(n) = 0 for n < 0, the system is causal. Since h(n) is of finite duration
(only two samples), h(n) is
absolutely summable. Hence BIBO stable.
4. Frequency response H ejω of the overall system.
 

1 1
H ejω = F [h(n)] = F δ(n) − δ(n − 1) = 1 − e−jω
2 2

5. Frequency response over 0 ≤ ω ≤ π is shown in Figure 4.16.


P4.21 System representations and input/output calculations:
1. H(z) = (z + 1)/(z − 0.5), causal system. Consider

z+1 1 + z −1 1 z −1
H(z) = = = + , |z| > 0.5
z − 0.5 1 − 0.5z −1 1 − 0.5z −1 1 − 0.5z −1
i. The impulse response: Taking the inverse z-transform of H(z),

h(n) = Z −1 [H(z)] = (0.5)n u(n) + (0.5)n−1 u(n − 1)

ii. The difference equation representation: From H(z) above,

y(n) = x(n) + x(n − 1) + 0.5y(n − 1)

iii. The pole-zero plot is shown in Figure 4.17.

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
184 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

Magnitude Response Phase Response


45
1.5

30
Magnitude

Degrees
0.5 15

0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π ω/π

Figure 4.16: Problem P4.20 frequency-response plot

Pole−Zero plot
1
Imaginary Part

0.5

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.17: Problem P4.21.1 pole-zero plot

iv. The output y(n) for the input x(n) = 3 cos(πn/3)u(n): Taking the z-transform of x(n),
1 − [cos(π/3)]z −1 1 − 0.5z −1
X(z) = Z [3 cos(πn/3)u(n)] = 3 −1 −2
=3 , |z| > 1
1 − [2 cos(π/3)]z + z 1 − z −1 + z −2
Now the z-transform of y(n) is

1 + z −1 1 − 0.5z −1 1 + z −1
Y (z) = H(z)X(z) = −1
3 −1 −2
=3 , |z| > 1
1 − 0.5z 1−z +z 1 − z −1 + z −2

1 − 0.5z −1 + 1.5z −1 1 − 0.5z −1 √ 3 −1
2 z
=3 = 3 + 3 3 , |z| > 1
1 − z −1 + z −2 1 − z −1 + z −2 1 − z −1 + z −2
Hence

y(n) = 3 cos(πn/3)u(n) + 3 3 sin(πn/3)u(n)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 185

2. H(z) = (1 + z −1 + z −2 )/(1 + 0.5z −1 − 0.25z −2 ), stable system. Consider

1 + z −1 + z −2 0.9348 4.0652
H(z) = = −4 + + , |z| > 0.809
1 + 0.5z −1 − 0.25z −2 1 + 0.809z −1 1 − 0.309z −1
i. The impulse response: Taking the inverse z-transform of H(z),

h(n) = Z −1 [H(z)] = −4δ(n) + 0.9348(−0.809)n u(n) + 4.0652(0.309)n u(n)

ii. The difference equation representation: From H(z) above,

y(n) = x(n) + x(n − 1) + x(n − 2) − 0.5y(n − 1) + 0.25y(n − 2)

iii. The pole-zero plot is shown in Figure 4.18.

Pole−Zero plot
1
Imaginary Part

0.5

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.18: Problem P4.21.2 pole-zero plot

iv. The output y(n) for the input x(n) = 3 cos(πn/3)u(n): Taking the z-transform of x(n),

1 − [cos(π/3)]z −1 1 − 0.5z −1
X(z) = Z [3 cos(πn/3)u(n)] = 3 −1 −2
=3 , |z| > 1
1 − [2 cos(π/3)]z + z 1 − z −1 + z −2

Now the z-transform of y(n) is



1 + z −1 + z −2 1 − 0.5z −1
Y (z) = H(z)X(z) = 3 , |z| > 1
1 + 0.5z −1 − 0.25z −2 1 − z −1 + z −2
√ 

1.2055 0.9152 2.7097 1 − 12 z −1 3.3524 23 z −1


= − + + , |z| > 1
1 + 0.809z −1 1 − 0.309z −1 1 − z −1 + z −2 1 − z −1 + z −2
Hence

y(n) = 1.2055(−0.809)n u(n) − 0.9152(0.309)n u(n) + 2.7097 cos(πn/3)u(n)


+ 3.3524 sin(πn/3)u(n)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
186 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

3. H(z) = (z 2 − 1)/(z − 3)2 , anti-causal system. Consider

z2 − 1 1 − z −2 1 2/9 8z 3z −1
H(z) = = −1 −2
=− + −1
+ , |z| < 3
(z − 3) 2 1 − 6z + 9z 9 1 − 3z 27 (1 − 3z −1 )2

i. The impulse response: Taking the inverse z-transform of H(z),


1 2 8
h(n) = Z −1 [H(z)] = − δ(n) − 3n u(−n − 1) − (n + 1)3n+1 u(−n − 2)
9 9 27
ii. The difference equation representation: From H(z) above,

y(n) = x(n) − x(n − 2) + 6y(n − 1) − 9y(n − 2)

iii. The pole-zero plot is shown in Figure 4.19.

Pole−Zero plot
1.5

1
Imaginary Part

0.5
2
0

−0.5

−1

−1.5

−1 0 1 2 3
Real Part

Figure 4.19: Problem P4.21.3 pole-zero plot

iv. The output y(n) for the input x(n) = 3 cos(πn/3)u(n): Taking the z-transform of x(n),

1 − [cos(π/3)]z −1 1 − 0.5z −1
X(z) = Z [3 cos(πn/3)u(n)] = 3 = 3 , |z| > 1
1 − [2 cos(π/3)]z −1 + z −2 1 − z −1 + z −2

Now the z-transform of y(n) is



1 − z −2 1 − 0.5z −1
Y (z) = H(z)X(z) = 3 , 1 < |z| < 3
1 − 6z −1 + 9z −2 1 − z −1 + z −2
√ 
−36

193 3 −1
43/49 20z 3z −1 1 − 1 −1
z 1820 2 z
= + + 49 −1 2 −2 + , |z| > 1
1 − 3z −1 21 (1 − 3z −1 )2 1−z +z 1 − z −1 + z −2

Hence
43 n 20 36
y(n) = − 3 u(−n − 1) − (n + 1)3n+1 u(−n − 2) − cos(πn/3)u(n)
49 21 49
193
+ sin(πn/3)u(n)
1820

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 187

z 1 − 0.5z −1
4. H(z) = + , stable system. Consider
z − 0.25 1 + 2z −1

1 1 − 0.5z −1 2 + 54 z −1 + 18 z −2
H(z) = + =
1 − 0.25z −1 1 + 2z −1 1 + 74 z −1 − 12 z −2
1 1 5/4
=− + −1
+ , 0.25 < |z| < 2
4 1 − 0.25z 1 + 2z −1
i. The impulse response: Taking the inverse z-transform of H(z),
n
−1 1 1 5
h(n) = Z [H(z)] = − δ(n) + u(n) − 2n u(−n − 1)
4 4 4

ii. The difference equation representation: From H(z) above,


5 1 7 1
y(n) = 2x(n) + x(n − 1) − x(n − 2) − y(n − 1) + y(n − 2)
4 8 4 2
iii. The pole-zero plot is shown in Figure 4.20.

Pole−Zero plot

1
Imaginary Part

0.5

−0.5

−1

−2 −1.5 −1 −0.5 0 0.5 1


Real Part

Figure 4.20: Problem P4.21.4 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
188 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

iv. The output y(n) for the input x(n) = 3 cos(πn/3)u(n): Taking the z-transform of x(n),

1 − [cos(π/3)]z −1 1 − 0.5z −1
X(z) = Z [3 cos(πn/3)u(n)] = 3 −1 −2
=3 , |z| > 1
1 − [2 cos(π/3)]z + z 1 − z −1 + z −2

Now the z-transform of y(n) is



2 + 54 z −1 + 18 z −2 1 − 0.5z −1
Y (z) = H(z)X(z) = 3 , 1 < |z| < 3
1 + 74 z −1 − 12 z −2 1 − z −1 + z −2
√ 

323 3 −1
1 −1 z
364 1 − 2 z
1293
75/28 3/13 2553 2
= − 1 −1 + 1 − z −1 + z −2 − 1 − z −1 + z −2 , |z| > 1
1 + 2z −1 1 − 4z

Hence
n
75 n 3 1 1293
y(n) = − 2 u(−n − 1) − u(n) + cos(πn/3)u(n)
28 13 4 364
323
− sin(πn/3)u(n)
2553
5. H(z) = (1 + z −1 + z −2 )2 . Consider

H(z) = (1 + z −1 + z −2 )2 = 1 + 2z −1 + 3z −2 + 2z −3 + z −4 , |z| > 0

i. The impulse response: Taking the inverse z-transform of H(z),

h(n) = Z −1 [H(z)] = {1, 2, 3, 2, 1}


ii. The difference equation representation: From H(z) above,

y(n) = x(n) + 2x(n − 1) + 3x(n − 2) + 2x(n − 3) + x(n − 4)

iii. The pole-zero plot is shown in Figure 4.21.

Pole−Zero plot
1 2
Imaginary Part

0.5

4
0

−0.5
2
−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.21: Problem P4.21.5 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 189

iv. The output y(n) for the input x(n) = 3 cos(πn/3)u(n): Taking the z-transform of x(n),

1 − [cos(π/3)]z −1 1 − 0.5z −1
X(z) = Z [3 cos(πn/3)u(n)] = 3 −1 −2
=3 , |z| > 1
1 − [2 cos(π/3)]z + z 1 − z −1 + z −2

Now the z-transform of y(n) is





1 + 2z −1 + 3z −2 + 2z −3 + z −4 1 − 0.5z −1
Y (z) = H(z)X(z) = 3 , |z| > 1
1 − z −1 + z −2
√ 

328 3 −1
1 − 12 z −1 2 z
1293
3 3 3 2553
= 9 + z −1 − z −2 − z −3 + 364
− , |z| > 1
2 2 2 1− z −1 + z −2 1 − z −1 + z −2
Hence
3 3 3 1293
y(n) = 9δ(n) + δ(n − 1) − δ(n − 2) − δ(n − 3) + cos(πn/3)u(n)
2 2 2 364
328
− sin(πn/3)u(n)
2553

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
190 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

P4.22 System representations and input/output calculations:


1. y(n) = [x(n) + 2x(n − 1) + x(n − 3)] /4
i. The system function representation: Taking the z-transform of the above difference equation,

1 Y (z) 1 + 2z −1 + z −3
Y (z) = [X(z) + 2z −1 X(z) + z −3 X(z)] ⇒ H(z) = =
4 X(z) 4

ii. The impulse response: Taking the inverse z-transform of H(z),


1
h(n) = [δ(n) + 2δ(n − 1) + δ(n − 3)]
4
iii. The pole-zero plot is shown in Figure 4.22.

Pole−Zero plot

1
Imaginary Part

0.5
3
0

−0.5

−1

−2 −1.5 −1 −0.5 0 0.5 1


Real Part

Figure 4.22: Problem P4.22.1 pole-zero plot

iv. The output y(n) for the input x(n) = 2(0.9)n u(n): Taking the z-transform of x(n),
2
X(z) = Z [2(0.9)n u(n)] = , |z| > 0.9
1 − 0.9z −1
Now the z-transform of y(n) is

1 + 2z −1 + z −3 2
Y (z) = H(z)X(z) = , |z| > 0.9
4 1 − 0.9z −1
990
1310 50 −1 5 −2
=− − z − z + 431
, |z| > 0.9
729 81 9 1 − 0.9z −1
Hence
1310 50 5 990
y(n) = − δ(n) − δ(n − 1) − δ(n − 2) + (0.9)n u(n)
729 81 9 431

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 191

2. y(n) = x(n) + 0.5x(n − 1) − 0.5y(n − 1) + 0.25y(n − 2)


i. The system function representation: Taking the z-transform of the above difference equation,

Y (z) = X(z) + 0.5z −1 X(z) − 0.5z −1 Y (z) + 0.25z −2 Y (z)

or
Y (z) 1 + 0.5z −1 1 + 0.5z −1
H(z) = = = , |z| > 0.809
X(z) 1 + 0.5z −1 − 0.25z −2 (1 + 0.809z −1 ) (1 − 0.309z −1 )

ii. The impulse response: Taking the inverse z-transform of H(z),


   
−1 1 + 0.5z −1 −1 0.2764 0.7236
h(n) = Z =Z +
(1 + 0.809z −1 ) (1 − 0.309z −1 ) 1 + 0.809z −1 1 − 0.309z −1
= 0.2764(−0.809)n u(n) + 0.7236(0.308)n u(n)

iii. The pole-zero plot is shown in Figure 4.23.

Pole−Zero plot
1
Imaginary Part

0.5

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.23: Problem P4.22.2 pole-zero plot

iv. The output y(n) for the input x(n) = 2(0.9)n u(n): Taking the z-transform of x(n),
2
X(z) = Z [2(0.9)n u(n)] = , |z| > 0.9
1 − 0.9z −1
Now the z-transform of y(n) is

1 + 0.5z −1 2
Y (z) = H(z)X(z) = , |z| > 0.9
1 + 0.5z −1 − 0.25z −2 1 − 0.9z −1
0.2617 0.7567 2.495
= − + , |z| > 0.9
1 + 0.809z −1 1 − 0.309z −1 1 − 0.9z −1
Hence

y(n) = 0.2617(−0.809)n u(n) − 0.7567(0.309)n u(n) + 2.495(0.9)n u(n)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
192 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

3. y(n) = 2x(n) + 0.9y(n − 1)


i. The system function representation: Taking the z-transform of the above difference equation,

Y (z) = 2X(z) + 0.9z −1 Y (z)

or
Y (z) 2
H(z) = = , |z| > 0.9
X(z) 1 − 0.9z −1

ii. The impulse response: Taking the inverse z-transform of H(z),

h(n) = 2(0.9)n u(n)

iii. The pole-zero plot is shown in Figure 4.24.

Pole−Zero plot
1
Imaginary Part

0.5

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.24: Problem P4.22.3 pole-zero plot

iv. The output y(n) for the input x(n) = 2(0.9)n u(n): Taking the z-transform of x(n),
2
X(z) = Z [2(0.9)n u(n)] = , |z| > 0.9
1 − 0.9z −1
Now the z-transform of y(n) is

2 2
Y (z) = H(z)X(z) = , |z| > 0.9
1 − 0.9z −1 1 − 0.9z −1
40 0.9z −1
= z , |z| > 0.9
9 (1 − 0.9z −1 )2

Hence
40
y(n) = (n + 1)(0.9)n+1 u(n + 1)
9

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 193

4. y(n) = −0.45x(n) − 0.4x(n − 1) + x(n − 2) + 0.4y(n − 1) + 0.45y(n − 2)


i. The system function representation: Taking the z-transform of the above difference equation,

Y (z) = −0.45X(z) − 0.4z −1 X(z) + z −2 X(z) + 0.4z −1 Y (z) + 0.45z −2 Y (z)

or
Y (z) −0.45 − 0.4z −1 + z −2 −0.45 − 0.4z −1 + z −2
H(z) = = −1 −2
= , |z| > 0.9
X(z) 1 − 0.4z − 0.45z (1 + 0.5z −1 ) (1 − 0.9z −1 )

ii. The impulse response: Taking the inverse z-transform of H(z),


   
−0.45 − 0.4z −1 + z −2 20 1.5536 0.2187
h(n) = Z −1 = Z −1
− + +
(1 + 0.5z −1 ) (1 − 0.9z −1 ) 9 1 + 0.5z −1 1 − 0.9z −1
20
= − δ(n) + 1.5536(−0.5)n u(n) + 0.2187(0.9)n u(n)
9
iii. The pole-zero plot is shown in Figure 4.25.

Pole−Zero plot

1
Imaginary Part

0.5

−0.5

−1

−2 −1.5 −1 −0.5 0 0.5 1


Real Part

Figure 4.25: Problem P4.22.4 pole-zero plot

iv. The output y(n) for the input x(n) = 2(0.9)n u(n): Taking the z-transform of x(n),
2
X(z) = Z [2(0.9)n u(n)] = , |z| > 0.9
1 − 0.9z −1
Now the z-transform of y(n) is

−0.45 − 0.4z −1 + z −2 2
Y (z) = H(z)X(z) = , |z| > 0.9
1 − 0.4z −1 − 0.45z −2 1 − 0.9z −1
1.1097 2.4470 0.9z −1
= − + 0.4859z 2 , |z| > 0.9
1 + 0.5z −1 1 − 0.9z −1 (1 − 0.9z −1 )
Hence

y(n) = 1.1097(−0.5)n u(n) − 2.4470(0.9)n u(n) + 0.4859(n + 1)(0.9)n+1 u(n + 1)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
194 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

4 4
5. y(n) = m
m=0 (0.8) x(n − m) − 
=1 (0.9) y(n − )
i. The system function representation: Taking the z-transform of the above difference equation,


4 
4
Y (z) = (0.8)m z −m X(z) − (0.9) z − Y (z)
m=0 =1

or
4 m −m
Y (z) m=0 (0.8) z
H(z) = = 4
X(z) 1 + =1 (0.9) z −
1 + 0.8z −1 + 0.64 + z −2 + 0.512z −3 + 0.4096z −4
= , |z| > 0.9
(1 − 0.5562z −1 + 0.81z −2 ) (1 + 1.4562z −1 + 0.81z −2 )

ii. The impulse response: Taking the inverse z-transform of H(z),


 
−1 0.1873 + 0.0651z −1 0.1884 + 0.1353z −1
h(n) = Z 0.6243 + +
1 − 0.5562z −1 + 0.81z −2 1 + 1.4562z −1 + 0.81z −2
= 0.1884δ(n) + [0.1879(0.9)n cos(0.4πn + 4.63◦ ) + 0.1885(0.9)n cos(0.8πn + 1.1◦ )] u(n)

iii. The pole-zero plot is shown in Figure 4.26.

Pole−Zero plot
1
Imaginary Part

0.5

−0.5

−1
−1 −0.5 0 0.5 1
Real Part

Figure 4.26: Problem P4.22.5 pole-zero plot

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 195

iv. The output y(n) for the input x(n) = 2(0.9)n u(n): Taking the z-transform of x(n),
2
X(z) = Z [2(0.9)n u(n)] = , |z| > 0.9
1 − 0.9z −1
Now the z-transform of y(n) is

1 + 0.8z −1 + 0.64 + z −2 + 0.512z −3 + 0.4096z −4 2
Y (z) = H(z)X(z) =
1 + 0.9z −1 + 0.81 + z −2 + 0.279z −3 + 0.6561z −4 1 − 0.9z −1
0.2081 + 0.1498z −1 0.1896 + 0.1685z −1 1.6023
= −1 −2
+ + , |z| > 0.9
1 − 0.5562z + 0.81z 1 + 1.4562z −1 + 0.81z −2 1 − 0.9z −1
Hence

y(n) = 0.3197(0.9)n cos(0.4πn − 49.37◦ )u(n) + 0.1982(0.9)n cos(0.8πn − 16.9◦ )u(n)


+ 1.6023(0.9)n u(n)

P4.23 Separation of the total response y(n) into (i) the homogeneous part, (ii) the particular part, (iii) the tran-
sient response, and (iv) the steady-state response for each of the systems given in Problem P4.22.
1. y(n) = [x(n) + 2x(n − 1) + x(n − 3)] /4: The total response is
1310 50 5 990
y(n) = − δ(n) − δ(n − 1) − δ(n − 2) + (0.9)n u(n)
729 81 9 431
i. Homogeneous part: Since the system is an FIR filter, the homogeneous equation is y(n) = 0. Thus
yh (n) = 0.
ii. Particular part: Hence the total response is the particular part, or
1310 50 5 990
yp (n) = − δ(n) − δ(n − 1) − δ(n − 2) + (0.9)n u(n)
729 81 9 431
iii. Transient response: Since the entire response decays to zero,
1310 50 5 990
ytr (n) = − δ(n) − δ(n − 1) − δ(n − 2) + (0.9)n u(n)
729 81 9 431
iv. Steady-state response: Clearly, yss (n) = 0.
2. y(n) = x(n) + 0.5x(n − 1) − 0.5y(n − 1) + 0.25y(n − 2): The total response is

y(n) = 0.2617(−0.809)n u(n) − 0.7567(0.309)n u(n) + 2.495(0.9)n u(n)

i. Homogeneous part: The first two terms in y(n) are due to the system poles, hence

yh (n) = 0.2617(−0.809)n u(n) − 0.7567(0.309)n u(n)

ii. Particular part: The last term in y(n) is due to the input pole, hence

yp (n) = 2.495(0.9)n u(n)

iii. Transient response: Since all poles of Y (z) are inside the unit circle,

ytr (n) = 0.2617(−0.809)n u(n) − 0.7567(0.309)n u(n) + 2.495(0.9)n u(n)

iv. Steady-state response: Clearly, yss (n) = 0.

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
196 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

3. y(n) = 2x(n) + 0.9y(n − 1): The total response is


40
(n + 1)(0.9)n+1 u(n + 1)
y(n) =
9
i. Homogeneous part: Since the system pole and the input pole are the same and hence are indistin-
guishable. Therefore, the total response can be equally divided into two parts or
20
(n + 1)(0.9)n+1 u(n + 1)
yh (n) =
9
ii. Particular part: Since the system pole and the input pole are the same and hence are indistinguish-
able. Therefore, the total response can be equally divided into two parts or
20
yp (n) = (n + 1)(0.9)n+1 u(n + 1)
9
iii. Transient response: Since all poles of Y (z) are inside the unit circle,
40
ytr (n) = (n + 1)(0.9)n+1 u(n + 1)
9
iv. Steady-state response: Clearly, yss (n) = 0.
4. y(n) = −0.45x(n) − 0.4x(n − 1) + x(n − 2) + 0.4y(n − 1) + 0.45y(n − 2): The total response is
y(n) = 1.1097(−0.5)n u(n) − 2.4470(0.9)n u(n) + 0.4859(n + 1)(0.9)n+1 u(n + 1)
i. Homogeneous part: There are two system poles, p1 = −0.5 and p2 = 0.9. Clearly, p2 is also an
input pole. Hence the response due to p2 has to be divided to include in both parts. Hence
yh (n) = 1.1097(−0.5)n u(n) − 1.1135(0.9)n u(n) + 0.24295(n + 1)(0.9)n+1 u(n + 1)
ii. Particular part: from above,
yp (n) = −1.1135(0.9)n u(n) + 0.24295(n + 1)(0.9)n+1 u(n + 1)
iii. Transient response: Since all poles of Y (z) are inside the unit circle,
ytr (n) = 1.1097(−0.5)n u(n) − 2.4470(0.9)n u(n) + 0.4859(n + 1)(0.9)n+1 u(n + 1)
iv. Steady-state response: Clearly, yss (n) = 0.
4 4
5. y(n) = m=0 (0.8)m x(n − m) − =1 (0.9) y(n − ): The total response is
y(n) = 0.3197(0.9)n cos(0.4πn − 49.37◦ )u(n) + 0.1982(0.9)n cos(0.8πn − 16.9◦ )u(n)
+ 1.6023(0.9)n u(n)
i. Homogeneous part: The first two terms in y(n) are due to the system poles, hence
yh (n) = 0.3197(0.9)n cos(0.4πn − 49.37◦ )u(n) + 0.1982(0.9)n cos(0.8πn − 16.9◦ )u(n)
ii. Particular part: The last term in y(n) is due to the input pole, hence
yp (n) = 1.6023(0.9)n u(n)
iii. Transient response: Since all poles of Y (z) are inside the unit circle,
ytr (n) = 0.3197(0.9)n cos(0.4πn − 49.37◦ )u(n) + 0.1982(0.9)n cos(0.8πn − 16.9◦ )u(n)
+ 1.6023(0.9)n u(n)
iv. Steady-state response: Clearly, yss (n) = 0.

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 197

P4.24 A stable system has the following pole-zero locations:

zeros: ± 1, ±j1 Poles: ± 0.9, ±j0.9


jπ/4

It is also known that H e = 1.


1. The system function H(z) and its region of convergence: Consider
(z − 1)(z + 1)(z − j)(z + j) 1 − z −4
H(z) = K =K , |z| > 0.9
(z − 0.9)(z + 0.9)(z − j0.9)(z + j0/9) 1 − 0.6561z −4

Now at z = ejπ/4 , we have H ejπ/4 = 1. Hence


  1 − ejπ
1 = H ejπ/4 = K = K × 1.2077 ⇒ K = 0.8281
1 − 0.6561ejπ
or

0.8281 1 − z −4
H(z) = , |z| > 0.9
1 − 0.6561z −4
2. The difference equation representation: From

0.8281 1 − z −4 Y (z)
H(z) = =
1 − 0.6561z −4 X(z)
we have

y(n) = 0.8281x(n) − 0.8281x(n − 4) + 0.6561y(n − 4)

3. The steady-state response yss (n) for the input x(n) = cos(πn/4)u(n): From the z-transform table,

1 − [cos(π/4)]z −1 1 − √12 z −1
X(z) = = √
1 − [2 cos(π/4)]z −1 + z −2 1 − 2z −1 + z −2
Hence

  
0.8281 1 − z −4 1 − √12 z −1
Y (z) = H(z)X(z) = √
1 − 0.6561z −4 1 − 2z −1 + z −2
1 − √12 z −1 0.0351 0.0509 −0.0860 − 0.1358z −1
= √ − − + , |z| > 1
1 − 2z −1 + z −2 1 − 0.9z −1 1 + 0.9z −1 1 − 0.81z −2
The first term above has poles on the unit circle and hence gives the steady-state response

yss (n) = cos(πn/4)

4. The transient response ytr (n) for the input x(n) = cos(πn/4)u(n): The remaining terms in y(n) are
the transient response terms. Using the inv_CC_PP function we have
0.0351 0.0509 1 0.9z −1
Ytr (z) = − − − 0.0860 − 0.1509 , |z| > 1
1 − 0.9z −1 1 + 0.9z −1 1 − 0.81z −2 1 − 0.81z −2
Hence

ytr (n) = −0.0351(0.9)n u(n) − 0.0509(−0.9)n u(n) − 0.086(0.9)n cos(πn/2)u(n)


− 0.1509(0.9)n sin(πn/2)u(n)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
198 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

P4.25 Difference equation solution using the one-sided z-transform approach.

y(n) = 0.81y(n − 2) + x(n) − x(n − 1), n ≥ 0; y(−1) = 2, y(−2) = 2


x(n) = (0.7)n u(n + 1)

Notice that

(0.7)−1 , n = −1;
x(n) = (0.7)n u(n + 1) =
(0.7)n u(n), n ≥ 0.

After taking the one-sided z-transform of the above difference equation, we obtain
 
Y + (z) = 0.81 y(−2) + y(−1)z −1 + z −2 Y + (z) + X + (z) − x(−1) + z −1 X + (z)

= 0.81z −2 Y + (z) + 1 − z −1 X + (z) + [0.81y(−2) − x(−1)] + 0.81y(−1)z −1

or
1 − z −1 [0.81y(−2) − x(−1)] + 0.81y(−1)z −1
Y + (z) = −1
X + (z) +
1 − 0.81z 1 − 0.81z −1
1
After substituting the initial conditions and X + (z) = Z [0.7n u(n)] = , we obtain
1 − 0.7z −1

+ 1 − z −1 1 0.1914 + 1.62z −1
Y (z) = +
1 − 0.81z −1 1 − 0.7z −1 1 − 0.81z −1
−1 −2
1.1914 + 0.4860z − 1.1340z 0.4642 2.7273
= −1 −1
=2+ −1
+
(1 − 0.81z ) (1 − 0.7z ) 1 − 0.81z 1 − 0.7z −1

Hence upon inverse transformation

y(n) = 2δ(n) + 0.4642(0.81)n u(n) + 2.7273(0.7)n u(n)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E 199

M ATLAB verification:

clc; close all;


b1 = [1 -1]; nb1 = [0 1]; a11 = [1 0 -0.81]; na11 = [0 1 2]; a12 = [1 -0.7];
na12 = [0 1]; [a1,na1] = conv_m(a11,na11,a12,na12);
b2 = [0.1914 1.62]; nb2 = [0 1]; a2 = [1 0 -0.81]; na2 = [0 1 2];
[bnr1,nbnr1] = conv_m(b1,nb1,a2,na2); [bnr2,nbnr2] = conv_m(b2,nb2,a1,na1);
[b,nb] = sigadd(bnr1,nbnr1,bnr2,nbnr2); [a,na] = conv_m(a1,na1,a2,na2);
[R,p,k] = residuez(b,a);

R =

-0.2106-0.0000i
0.0000
0.7457+0.0000i
0.0000-0.0000i
0.6562

p =

-0.9000
-0.9000
0.9000+0.0000i
0.9000-0.0000i
0.7000

k = []

n = [0:20]; x = 0.7.^n; xic = [0.1914 1.62];


yb1 = filter(b1,a11,x,xic);
yb2 = R(1)*((p(1)).^n)+R(3)*((p(3)).^n)+R(5)*((p(5)).^n);
error = max(abs(yb1-yb2))
error =
6.2150e-008

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
200 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E

P4.26 Difference equation solution for y(n), n ≥ 0: Given


y(n) − 0.4y(n − 1) − 0.45y(n − 2) = 0.45x(n) + 0.4x(n − 1) − x(n − 2)

n
driven by the input x(n) = 2+ 12 u(n) and subject to y(−1) = 0, y(−2) = 3; x(−1) = x(−2) = 2.
Taking the one-sided z-transform of the difference equation, we obtain
Y + (z) − 0.4y(−1) − 0.4z −1 Y + (z) − 0.45y(−2) − 0.45y(−1)z −1 − 0.45z −2 Y + (z)
= 0.45X + (z) + 0.4x(−1) + 0.4z −1 X + (z) − x(−2) − x(−1)z −1 − z −2 X + (z)
or
0.45 + 0.4z −1 − z −2 +
Y + (z) = X (z)
1 − 0.4z −1 − 0.45z −2
[0.4y(−1) + 0.45y(−2) + 0.4x(−1) − x(−2)] + [0.45y(−1) − x(−1)]z −1
+
1 − 0.4z −1 − 0.45z −2

n 2 1
After substituting the initial conditions and X + (z) = Z [2 + 12 ]u(n) = −1
+ ,
1−z 1 − 0.5z −1
we obtain

0.45 + 0.4z −1 − z −2 2 1 0.15 − 2z −1
Y + (z) = −1 −2 −1
+ −1
+
1 − 0.4z − 0.45z 1−z 1 − 0.5z 1 − 0.4z −1 − 0.45z −2
1.35 + 0.3z −1 − 3.8z −2 + 2z −3 0.15 − 2z −1
= + (4.19)
(1 − 0.9z ) (1 + 0.5z ) (1 − z ) (1 − 0.5z ) 1 − 0.4z −1 − 0.45z −2
−1 −1 −1 −1

1.5 − 1.925z −1 − 0.725z −2 + z −3


=
1 − 1.9z −1 + 0.65z −2 + 0.475z −3 − 0.225z −4
−2 2.1116 1.7188 0.3304
= + + −
1 − z −1 1 − 0.9z −1 1 − 0.5z −1 1 + 0.5z −1
Hence after inverse transformation
y(n) = [−2 + 2.1116(0.9)n + 1.7188(0.5)n − 0.3303(−0.5)n ] u(n)
(a) Transient response: This response is due to the poles inside the unit circle or equivalently, the part of
y(n) that decays to zero as n  ∞. Thus
ytr (n) = [2.1116(0.9)n + 1.7188(0.5)n − 0.3303(−0.5)n ] u(n)
(b) Steady-state response: This response is due to poles on the unit circle. Hence yss (n) = −2.
(c) Zero input response: In (4.19), the last term on the right corresponds to the initial condition or zero-
input response. Hence
+ 0.15 − 2z −1 −1.3321 1.4821
YZI (z) = = +
1 − 0.4z −1 − 0.45z −2 1 − 0.9z −1 1 + 0.5z −1
or
yZI (n) = [−1.3321(0.9)n + 1.4821(−0.5)n ] u(n)
(d) Zero-state response: In (4.19), the first term on the right corresponds to the input excitation or is the
zero-state response. Hence
+ 1.35 + 0.3z −1 − 3.8z −2 + 2z −3
YZS (z) =
(1 − 0.9z −1 ) (1 + 0.5z −1 ) (1 − z −1 ) (1 − 0.5z −1 )
−2 3.4438 1.7187 1.8125
= −1
+ −1
+ −1

1−z 1 − 0.9z 1 − 0.5z 1 + 0.5z −1
or
yZS (n) = [−2 + 3.4438(0.9)n + 1.7187(0.5)n − 1.8125(−0.5)n ] u(n)

© 2012 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be
different from the U.S. Edition. May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.

You might also like