% Program 6_6
% Power Series Expansion of a Rational z-Transform
%% e.g. first 11 coefficients
%     H(z) = (1+2Z-1)/(1+0.4Z-1 -0.12Z-2)
%
% Read in the number of inverse z-transform coefficients
% to be computed
N = input('Type in the length of output vector = ');
% Read in the numerator and denominator coefficients of
% the z-transform
% num = input('Type in the numerator coefficients = ');
% den = input('Type in the denominator coefficients = ');
num = [1 2];
den = [1 0.4 -0.12];
% Compute the desired number of inverse transform
% coefficients
x = [1 zeros(1, N-1)];
y = filter(num, den, x);
disp('Coefficients of the power series expansion');
stem(y);