# Inverse $z$-transform of a transfer function in MATLAB

I have designed a Butterworth highpass filter (HPF) of 4th order with cutoff frequency high enough to give a gain of $3$ at high frequencies. I want to find the inverse $z$-transform using MATLAB.

L=4;
OSR = 16;
[b,a] = butter(L,0.259,'high');
b = b/b(1);
fvtool(b,a);
H = tf(b,a,[],'variable','z^-1');


iztrans doesn't seem to support tf or zpk.

• Can you please rephrase this question because the way it is put at the moment is more about doing things in MATLAB and less about DSP. In the meantime, if you were aware of the z-transform's poles and zero locations, how would you go about finding the inverse? – A_A Jan 5 '17 at 15:04

The function iztrans only supports symbolic expressions. This should do the trick:
[num,den] = tfdata(H); syms z H_sym = poly2sym(cell2mat(num),z)/poly2sym(cell2mat(den),z); h_inv = iztrans(H_sym);
• First, you store in two different variables (num and den) the coefficientes of the numerator and the denominator, respectively, of your transfer function. Then, using the function poly2sym you use those coefficientes to create a symbolic polynomial with the previously declared symbolic variable z. So now you are all set to pass this function to iztrans, which only accepts symbolic expressions as inputs. Don't use the Workspace to see h_inv, just write h_inv and press Enter in the commandline and you'll see the result (or use MuPAD for a more friendly visualization). – Tendero Jan 5 '17 at 12:59