1
$\begingroup$

I would like to express a Z-plane transfer function in a form of a difference equation so that I can implement it as an infinite impulse response filter.

Here is an example of a continuous time transfer function that I want to convert to a discrete time model using the bilinear transform method.

tfmodel = TransferFunctionModel[1/( a s^2 + b s + c), s]

I then convert this to a discrete time model:

discreteModel = ToDiscreteTimeModel[tfmodel, 1, z]

$\begin{array}{c|c}\frac{(z+1)^2}{4 a z^2-8 a z+4 a+2 b z^2-2 b+c z^2+2 c z+c}\\ \end{array}$

How can I then express it in the form of a difference equation? I need every exponent of Z to be negative on the numerator and denominator.

ANNEX: Dividing by the highest power of z doesn't work for me (becuase I am sure I am doing something wrong!)

FullSimplify[discreteModel / z^2]

The above command will not expand or factorise.

ANNEX: I tried the following:

ExpandAll[((1 + z)^2/(4 a - 2 b + c - 8 a z + 2 c z + 4 a z^2 + 2 b z^2 + c z^2)) / z^2]

And this gave me:

$\frac{z^2}{4 a z^4-8 a z^3+4 a z^2+2 b z^4-2 b z^2+c z^4+2 c z^3+c z^2}+\frac{2 z}{4 a z^4-8 a z^3+4 a z^2+2 b z^4-2 b z^2+c z^4+2 c z^3+c z^2}+\frac{1}{4 a z^4-8 a z^3+4 a z^2+2 b z^4-2 b z^2+c z^4+2 c z^3+c z^2}$

Which is not what I want, I would like only negative exponents

$\endgroup$
6
  • $\begingroup$ "I need every exponent of Z to be negative on the numerator and denominator." - why not divide the numerator and denominator by the appropriate power of $z$? $\endgroup$ Jan 18, 2017 at 12:15
  • $\begingroup$ I tried that but it wouldn't work. I added a bit to the end of my question to describe the problem. $\endgroup$
    – Hefaestion
    Jan 18, 2017 at 12:23
  • 4
    $\begingroup$ How about discreteModel = ToDiscreteTimeModel[tfmodel, 1, 1/z] ? $\endgroup$
    – Nasser
    Jan 18, 2017 at 12:28
  • $\begingroup$ Thank you @Nasser, that is now doing what I want! $\endgroup$
    – Hefaestion
    Jan 18, 2017 at 12:31
  • 1
    $\begingroup$ Simplify[discreteModel[z] == discreteModel2[z]] is True. $\endgroup$ Jan 18, 2017 at 16:23

0

Browse other questions tagged or ask your own question.