0% found this document useful (0 votes)
54 views5 pages

Maulina Putri Lestari - M0220052 - Tugas 1

1. The document provides problems 4.1 and 4.23 from a digital signal processing course. Problem 4.1 involves determining z-transforms of 5 sequences and verifying them in MATLAB. Problem 4.23 involves solving a difference equation using the one-sided z-transform approach, generating the first 20 samples in MATLAB, and comparing the results. 2. The document provides the answers and MATLAB scripts for problems 4.1 and 4.23. For problem 4.1, it gives the z-transform expressions for each sequence and verifies them in MATLAB. For problem 4.23, it solves the difference equation using a one-sided z-transform and compares the generated samples to the solution. 3.
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)
54 views5 pages

Maulina Putri Lestari - M0220052 - Tugas 1

1. The document provides problems 4.1 and 4.23 from a digital signal processing course. Problem 4.1 involves determining z-transforms of 5 sequences and verifying them in MATLAB. Problem 4.23 involves solving a difference equation using the one-sided z-transform approach, generating the first 20 samples in MATLAB, and comparing the results. 2. The document provides the answers and MATLAB scripts for problems 4.1 and 4.23. For problem 4.1, it gives the z-transform expressions for each sequence and verifies them in MATLAB. For problem 4.23, it solves the difference equation using a one-sided z-transform and compares the generated samples to the solution. 3.
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/ 5

SIGNAL PENGOLAH DIGITAL

(Digital Signal Processing)


Problem 4.1 dan 4.23

TUGAS

Disusun Oleh:
Maulina Putri Lestari (M0220052)

FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM


UNIVERSITAS SEBELAS MARET
SURAKARTA
2023
Problem 4.1
Determine the z-transform of the following sequences using the definition (4.1). Indicate the
region of convergence for each sequence and verify the z-transform expression using
MATLAB.
1. x(n) = {3, 2, 1 , −2, −3}.

2. x(n) = (0.8)n u(n − 2). Verify the z-transform expression using MATLAB.
3. x(n) = [(0.5)n + (−0.8)n]u(n). Verify the z-transform expression using MATLAB.
4. x(n)=2n cos(0.4πn)u(−n).
5. x(n)=(n + 1)(3)n u(n). Verify the z-transform expression using MATLAB.
Answer
1. 𝓍 (𝑛) = {3 ,2, 1, −2, −3} ∶ Then 𝑋 (𝓏) = 3𝓏 2 + 2𝓏 + 1 − 2𝓏 −1 + 3𝓏 −2 , 0 < |𝓏| < ∞.

Script matlab
% P0401a.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. 𝓍 (𝑛) = (0.8)𝑛 𝑢(𝑛 − 2): Then

∞ ∞
𝑛 −𝑛 2 −2
0.64𝓏 −2
𝑋 (𝓏) = ∑(0.8) 𝓏 = (0.8) 𝓏 ∑(0.8)𝑛 𝓏 −1 = ; |𝓏| < 0.8
1 − 0.8𝓏 −1
𝑛=2 𝑛=0

Script matlab
% P0401b.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. 𝓍 (𝑛) = [(0.5)𝑛 𝑢(𝑛)] + (−0.8)𝑛 ]𝑢(𝑛): Then

1 1
𝑋(𝓏) = 𝒵 [(0.5)𝑛 𝑢(𝑛)] + 𝒵[(−0.8)𝑛 𝑢(𝑛)] = −1
+ ; {|𝓏| > 0.5} ∩ {|𝓏| > 0.8}
1 − 0.5𝓏 1 + 0.8𝓏 −1

2 + 0.3𝓏 −1
= ; |𝓏| > 0.8
1 + 0.3𝓏 −1 − 0.4𝓏 −2
Script matlab
% P0401c.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

4. 𝓍(𝑛) = 2𝑛 cos(0.4𝜋𝑛)𝑢(−𝑛): Consider

∞ 0 ∞
𝑛 −1 𝑛 −𝑛
𝑋(𝓏) = ∑ 2 cos(0.4𝜋𝑛)𝑢(−𝑛)𝓏 = ∑ 2 cos(0.4𝜋𝑛)𝓏 = ∑ 2−𝑛 cos(0.4𝜋𝑛)𝓏 𝑛
𝑛=−∞ 𝑛=−∞ 𝑛=0

∞ ∞ ∞
−𝑛
𝑒𝑗 0.4𝜋𝑛 + 𝑒 −𝑗0.4𝜋𝑛 1 1
= ∑2 ( ) 𝓏 𝑛 = ∑(2−1 𝑒 𝑗0.4𝜋𝓏 )𝑛 + ∑(2−1 𝑒 𝑗0.4𝜋𝓏. )𝑛
2 2 2
𝑛=0 𝑛=0 𝑛=0

1 1 1 1
= ( 1 )+ ( 1 ) ; |𝓏| < 2
2 1 − 2𝑒 −𝑗0.4𝜋𝓏 2 1 − 2 𝑒 −𝑗0.4𝜋𝓏.

1 − [0.5 cos(0.4𝜋)]𝓏 1 − [0.5 cos(0.4𝜋)]𝓏


= 2
= ; |𝓏| < 2
1 − 2[cos(0.4𝜋)]𝓏 + 0.25𝓏 1 − [cos(0.4𝜋)]𝓏 + 0.25𝓏 2
Script matlab
% P0401d.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

5. 𝓍(𝑛) = (𝑛 + 1)(3)𝑛 𝑢(𝑛): Consider

𝓍(𝑛) = (𝑛 + 1)(3)𝑛 𝑢(𝑛) = 𝑛3𝑛 𝑢(𝑛) + 3𝑛 𝑢(𝑛)

Hence

𝑑 1 1
X(𝓏) = 𝒵[𝑛3𝑛 𝑢(𝑛)] + 𝒵[3𝑛 𝑢(𝑛)] = −𝓏 𝑑𝓏 (1−3𝓏 −1 ) + 1−3𝓏 −1 ; |𝓏| > 3

3𝓏 −1 1 1 − 3𝓏 −1
= + = ; |𝓏| > 3
1 − 6𝓏 −1 + 9𝓏 −2 1 − 3𝓏 −1 1 − 9𝓏 −1 + 27𝓏 −2 − 27𝓏 −3

Script matlab
% P0401e.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

Problem 4.23
Solve the following difference equation for y(n) 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)nu(n + 1)
Generate the first 20 samples of y(n) using MATLAB, and compare them with your answer
Answer
Difference equation solution using the one – sided 𝓏- transfrom approach.
𝑦(𝑛) = 0.8𝑦(𝑛 − 2) + 𝑥(𝑛) − 𝑥(𝑛 − 1), 𝑛 ≥ 0; 𝑦(−1) = 2, 𝑦(−2) = 2
𝑥(𝑛) = (0.7)𝑛 𝑢(𝑛 + 1)
Notice that
(0.7)−1 𝑛 = −1;
𝓍(𝑛) = (0.7)𝑛 𝑢 (𝑛 + 1) = {
(0.7)𝑛 𝑢(𝑛) 𝑛 ≥ 0,

After taking the one – sided 𝓏-transfrom of the above difference equation, we obtion
𝑌 + (𝓏) = 0.81[𝑦(−2) + 𝑦(−1)𝓏 −1 + 𝓏 −2 𝑌 + (𝓏)] + 𝑋 + (𝓏) − [𝑥(−1) + 𝓏 −1 𝑋 + (𝓏)]

= 0.81𝓏 −2 𝑌 + (𝓏) + [1 − 𝓏 −1 ]𝑋 + (𝓏) + [0.18𝑦(−2) − 𝑥(−1) + 0.18𝑦(−1)𝓏 −1

Or

1 − 𝓏 −1 [0.18𝑦(−2) − 𝑥(−1) + 0.18𝑦(−1)𝓏 −1


𝑌 + (𝓏) = 𝑋 + (𝓏)
+
1 − 0.18𝓏 −1 1 − 0.18𝓏 −1

1
After substituting the initial conditions and 𝑋 + (𝓏) = 𝒵[0. 7𝑛 𝑢(𝑛)] = 1−0.81𝓏 −1′ we obtain

1 − 𝓏 −1 1 0.1914 + 1.62𝓏 −1
𝑌 + (𝓏) = ( ) ( ) +
1 − 0.81𝓏 −1 1 − 0.7𝓏 −1 1 − 0.81𝓏 −1

1.1914 + 0.4862𝓏 −1 − 1.1340𝓏 −2 0.4642 2.7273


= = 2 + +
(1 − 0.81𝓏 −1 )(1 − 0.7𝓏 −1 ) 1 − 0.81𝓏 −1 1 − 0.7𝓏 −1
Hence upon inverse transformation
𝑦(𝑛) = 2𝛿(𝑛) + 0.4642(0.81)𝑛 𝑢(𝑛) + 2.7273(0.7)𝑛 𝑢(𝑛)
Script matlab
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

You might also like