# How to find the difference equation from system response or primitive equation?

If I have a system response or the primitive equation , how can i find its difference equation by mathematica?

eg:

h[n] = b0 a^n u[n] + b1 a^n-1 u[n-1]
H[z] = b0 + b1 z^-1 / (1- a z^-1), |z| > |a|


expect:

y[n] - a y[n-1] = b0 x[n] + b1 x[n-1]

• Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, Mar 1 at 5:09
• 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. Mar 1 at 5:09
• Please try to be a bit clearer in your example. This will help others in understanding and solving your problem Mar 1 at 5:10

tfm = TransferFunctionModel[(b0 + b1 z^-1)/(1 - a z^-1), 1/z, SamplingPeriod -> 1];
ControlDEqnsioEqnsForm[tfm][[1, 1]]