The - Transform: X 2z 4z 2z
The - Transform: X 2z 4z 2z
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
© 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
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=−∞
as expected.
2. Proof using the convolution property:
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
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
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
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
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
© 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
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
© 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
π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
© 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
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
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
© 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
© 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
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=−∞
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
∞
∞
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
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
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
© 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)
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
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
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
© 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
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
© 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
© 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
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
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
© 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
© 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
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
(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
© 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
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.
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
ω/π ω/π
© 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, . . . }
↑
2
x(n)
−2
−4
−6
2
y(n)
−1
−2
0 20 40 60 80 100 120 140 160 180 200
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.
174 S OLUTIONS M ANUAL FOR E SSENTIALS OF D IGITAL S IGNAL P ROCESSING U SING MATLAB 3 E
1 + e−j4ω
H(ejω ) =
1 − 0.8145e−j4ω
1 + z −4
H(z) =
1 − 0.8145z −4
2. The magnitude and phase response plots are shown in Figure 4.9.
90
Magnitude
Degree
0
5
−90
0 −180
0 0.25 0.5 0.75 1 0 0.25 0.5 0.75 1
ω/π ω/π
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)
The bottom plot of Figure 4.10 shows that both sinusoidal sequences have the scaling of 10.78 and no
delay distortion.
2
x(n)
−2
−4
−6
40
20
y(n)
−20
−40
−60
© 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
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)
Pole−Zero plot
1
Imaginary Part
0.5
−0.5
−1
−1 −0.5 0 0.5 1
Real Part
© 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
Hence
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
© 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
Hence
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,
© 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
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
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
© 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
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
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),
© 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
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
ω/π ω/π
Pole−Zero plot
1
Imaginary Part
0.5
−0.5
−1
−1 −0.5 0 0.5 1
Real Part
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
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),
Pole−Zero plot
1
Imaginary Part
0.5
−0.5
−1
−1 −0.5 0 0.5 1
Real Part
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
© 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
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
Pole−Zero plot
1.5
1
Imaginary Part
0.5
2
0
−0.5
−1
−1.5
−1 0 1 2 3
Real Part
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
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
Pole−Zero plot
1
Imaginary Part
0.5
−0.5
−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.
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
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
Pole−Zero plot
1 2
Imaginary Part
0.5
4
0
−0.5
2
−1
−1 −0.5 0 0.5 1
Real Part
© 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
© 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
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
Pole−Zero plot
1
Imaginary Part
0.5
3
0
−0.5
−1
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
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 )
Pole−Zero plot
1
Imaginary Part
0.5
−0.5
−1
−1 −0.5 0 0.5 1
Real Part
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
© 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
or
Y (z) 2
H(z) = = , |z| > 0.9
X(z) 1 − 0.9z −1
Pole−Zero plot
1
Imaginary Part
0.5
−0.5
−1
−1 −0.5 0 0.5 1
Real Part
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
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 )
Pole−Zero plot
1
Imaginary Part
0.5
−0.5
−1
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
© 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 )
Pole−Zero plot
1
Imaginary Part
0.5
−0.5
−1
−1 −0.5 0 0.5 1
Real Part
© 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
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
i. Homogeneous part: The first two terms in y(n) are due to the system poles, hence
ii. Particular part: The last term in y(n) is due to the input pole, hence
iii. Transient response: Since all poles of Y (z) are inside the unit circle,
© 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
© 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
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
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
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
© 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
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
© 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:
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 = []
© 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
© 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.