%% Equalize Transfer Function Numerator and Denominator Lengths
% Consider the following discrete-time SISO transfer function model:
% H(z) = \frac{2z^{-2}}{4 + 3z^{-2} - z^{-3}}.
%
% Equalize the numerator and denominator polynomial lengths. Determine the polynomial orders.

num = [0 0 2];
den = [4 0 3 -1];

[b,a,n,m] = eqtflength(num,den)

%
% Visualize the poles and zeros of the transfer function.

zplane(b,a)

% Convert the transfer function with equalized numerator and denominator to state-space form. b and a must have equal lengths to find the state-space representation of the discrete-time transfer function.

[A,B,C,D] = tf2ss(b,a)

%
% Copyright 2020 The MathWorks, Inc.