Clear Filters
Clear Filters

Inverse Z-transform mismatch

25 views (last 30 days)
Leroy Grob
Leroy Grob on 20 Jul 2017
Answered: Abhi Sundararaman on 28 Jul 2017
Hi everybody, I have been stuck on this problem for a while so I appreciate any help.
If you were to do the inverse Z-transform of H[z] the output should h[n] i.e. the original dicrete time function however that is not always the case. Has anyone seen this problem before? Attached below is my code:
%%2. Inverse Z-transform of H[z] =[(5/6)*sin(pi/3)*z^-1]/[1-(10/6)*cos(pi/3)*z^-1+(5/6)^2*z^-2]
syms z n % Create symbolic variables
H=((5/6)*sin(pi/3)*z^-1)/(1-(10/6)*cos(pi/3)*z^-1+(5/6)^2*z^-2);
H=simplify(H) %This outputs (15*3^(1/2)*z)/(36*z^2 - 30*z + 25)
h=iztrans(H,z,n); %Do the inverse Z-transform for H[z]
h=simplify(h) %This output should be (5/6)^n * sin(pi*n/3) but it is not
Fs = 100; % Fs sampling frequency in Hz/s
T = (1 / Fs)*pi; % P sampling period (time interval between samples)
L = 10*pi; % L length of signal duration in seconds
t= (0:T:(L-T)); % "t" time interval set
h=double(subs(h,n,t)); %Substitute the values of t into the double value h
figure; % Open a new figure
plot(t,(real(h))); % Plot the original response of the transfer function
% with time t
hold on
h2=((5/6).^t).*sin(pi.*t/3); % Give the original transfer function
plot(t,(h2));
hold off
xlabel('t / s'); % X-axis label
ylabel('h(t)'); % Y-axis label
title ('h[t] = (5/6)^t * sin(\pi*t/3) * u[t]'); % Title
The output of the code shows the attached figure. The blue trace is the inverse Z transformed function of H[z] which was obtained by firstly doing the Z transform of h[n] = ((5/6)^n)*sin(pi*n/3).
%%Z-transform
syms z n % Create symbolic variables
h=((5/6)^n)*sin(pi*n/3);
H=ztrans(h); % Z-transform opperation
simplify(H) % Simplify the Z-transform operation

Answers (1)

Abhi Sundararaman
Abhi Sundararaman on 28 Jul 2017
The above difference is because the z transform is only valid for non-negative integers. In fact, if you plot the two functions h and h2 for integer values only, you will see that they are identical. Alternatively, if you look at the plot you posted, you will see that for integer values, the two curves have the same values.
So in summary, when you take the inverse z of the z transform, you are taking the inverse z of the coefficients of a series, rather than a continuous function. That's why the inverse z of the z transform is also only valid for integer values.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!