If I remember correctly, the z-transform of theDirac delta funciton is 1, so:
syms x n x(n) z
x(n) = 2*dirac(n-2) + 3*heaviside(n-3)
X = ztrans(x, n, z)
X = subs(X, {ztrans(dirac(n), n, z)}, {1})
producing:
X =
3/(z^3*(z - 1)) + 2/z^2
Continuing:
Xe = expand(X);
[num,den] = numden(Xe);
num = simplify(num, 'Steps',10)
den = simplify(den, 'Steps',10)
nd = sym2poly(num);
dd = sym2poly(den);
Ts = 0.1;
H = tf(nd, dd, Ts)
figure
bode(H)
figure
pzmap(H)
creates the Control System Toolbox ‘H’ system object, and the plots.
Best Answer