I'm having trouble to convert this transfer function $H(z)$ to $H(s)$ in MATLAB:
Ts = 12000; %sample time
z = tf('z',Ts);
H = (0.005276*z^-1) / (1- 2.912*z^-1 + 2.826*z^-2 -0.914*z^-3);
I tried with a built-in function as:
Hc = d2c(H)
But this gives the following error:
Error using DynamicSystem/d2c (line 100) The "zoh" and "foh" methods cannot be used for discrete models with poles near z=0.
How can I convert this $H(z)$ to $H(s)$? I want to produce Bode diagrams by using $H(s)$.
This is a result of the fact that matlab multiplies the numerator and denominator with $z^6$ (which is kind of stupid, but this is what Matlab does). This results in a transfer function with zeros and poles at $z=0$. $H(z)$ is not the minimal realization, i.e. you have zeros and poles which are the same, so there are two ways to fix this. One is by transforming your transfer function to a minimal realization using
minreal:The other option, which I prefer, is to define the transfer function in a different manner:
Now you should be able to compute the continuous transfer function with: