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]
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]
There is an undocumented internal function that does this.
tfm = TransferFunctionModel[(b0 + b1 z^-1)/(1 - a z^-1), 1/z, SamplingPeriod -> 1];
Control`DEqns`ioEqnsForm[tfm][[1, 1]]