Professional Documents
Culture Documents
Group-9(119 150 153) lab6
Group-9(119 150 153) lab6
Group-9(119 150 153) lab6
In Lab:
Task 1:
Using MATLAB we determine the partial-fraction expansion of the z-transform X(z) given by
18𝑧3
𝑋 ( 𝑧) =
18𝑧3 + 3𝑧2 − 4𝑧 − 1
Sol:
Code:
syms z
num = [18 0 0 0]
den = [18 3 -4 -1]
[r,p,k] = residuez(num,den)
x =
((r(1)*z)/(z+p(1)))+((r(2)*z)/(z+p(2)))+((r(3)*z)/(z+p(3)))
x = vpa(x)
disp('Partial fraction:')
pretty(x)
Result:
Task 2:
Determine the inverse z-transform of the 11 terms of following equation
1 − 2𝑧−1
𝐻(𝑧) =
(1 − 0.2𝑧−1)(1 + 0.6𝑧−1)
Sol:
Code:
syms z
l = 11;
num = [1 -2 0];
den = [1 0.4 -0.12];
[x,n] = impz(num,den,l)
stem(n,x,'linewidth',2)
xlabel('n')
ylabel('Amplitude')
title('Inverse z transform')
grid on
Plot:
Task 3:
Determine the Inverse z-transform of the following sequences, using partial fraction expansion
method.
1 − 𝑧−1 − 4𝑧−2 + 4𝑧−3
𝑥 ( 𝑧) =
1 − 2.75𝑧−1 + 1.625𝑧−2 + 0.25𝑧−3
Sol:
Code:
syms z
num = [1 -1 -4 4];
den = [1 -2.75 1.625 -0.25];
[r,p,k] = residuez(num,den)
x =
((r(1)*z)/(z+p(1)))+((r(2)*z)/(z+p(2)))+((r(3)*z)/(z+p(3)))
x = vpa(x)
disp('Partial fraction:')
pretty(x)
X = iztrans(x)
[num,den] = residuez(R,P,K)
X = vpa(X)
disp('Inverse z Transform:')
pretty(X)
Results:
Task 4:
A digital filter is described by the difference equation,
𝑌(𝑛) = 𝑥(𝑛) + 𝑥(𝑛 − 1) + 0.9𝑦(𝑛 − 1) − 0.81𝑦(𝑛 − 2)
Using the freqz function, plot the magnitude and phase of the frequency response of the filter.
Sol:
Code:
num = [1 1];
den = [1 -0.9 0.81];
fs = [0:1:500]*pi/500;
H=freqz(num,den,fs);
magH = abs(H);
phaH = angle(H)*180/pi;
subplot(2,1,1);
plot(fs/pi,magH,'LineWidth',3);
title('Magnitude');
xlabel('Frequency ');
ylabel('Magnitude of H');
grid on
subplot(2,1,2);
plot(fs/pi,phaH,'LineWidth',3);
title('Phase');
xlabel('Frequency');
ylabel('Degrees');
grid on
Plot:
Post Lab:
Conclusion/Critical Analysis:
In this lab we learned about Z-Transform and Inverse Z-Transform. The z transform is for the
discrete time signals as counter part of laplace transform for continuous time signals. In this lab
we learned about different commands of MATLAB that is used to compute frequency response,
plot zeros and poles etc. In this lab we perform four lab tasks:
In first task we determine the partial fraction of a given z transform. In second and third task we
perform inverse z transform of a given function and in last task we plot magnitude and phase of
the frequency response of the given filter.
With these tools and techniques at our disposal, we are now able to perform z and inverse z
transform. These skills are essential for many applications in signal processing, and can help us
to extract valuable information from complex datasets.