Ex 3
Ex 3
Ex 3
where z is a complex variable. The set of z values for which X(z) exists is called the region of
convergence (ROC) and is given by Rx−< |z| < Rx+ for some non-negative numbers Rx− and
Rx+.
The inverse z-transform of a complex function X(z) is given by
where C is a counterclockwise contour encircling the origin and lying in the ROC.
Aim: To understand the Z-transform operations and solve the differential equations.
1. Let X1(z) = 2 + 3z−1 + 4z−2 and X2(z) = 3 + 4z−1 + 5z−2 + 6z−3. Determine X3(z) =
X1(z)X2(z).
2. num1 = [ 2 3 4 ]; % Numerator: s
3. den1 = [ 1 0 0 ]; % Denominator: s^2 + 2 s + 10
4. H = tf(num1,den1);
5. num2 = [ 3 4 5 6]; % Numerator: s
6. den2 = [ 1 0 0 0]; % Denominator: s^2 + 2 s + 10
7. I = tf(den2,num2);
8. V = 3*H*I;
pzmap(H)
bode(H)
% MATLAB CODE (WITH INITIAL CONDITIONS):
% To clear all variables from the current workspace
clear all
clc
disp("Solving 2nd Order Homogeneous Difference Equations in MATLAB |
GeeksforGeeks")
% Initial conditions
y0=IC(1);y1=IC(2);
eq1=subs(yn,n,0)-y0;
eq2=subs(yn,n,1)-y1;
% Finding C1 & C2
[c1,c2]=solve(eq1,eq2);
yn=simplify(subs(yn));
disp ('The solution of the difference equation yn=')
disp(yn)