0

Does anyone have a reference handy on how to convert poles and zeros of a system to differential/difference equations.

Here is a quick draft of math, but I am not sure if it's at all correct. First, solving the characteristic equation gives the eigen values (equal to poles). Applying rudimentary knowledge of differential equations, the solution regarding only the poles should be:

$$\text {Poles Diffrential}: p(t)= \sum_{i=1}^{n_1} c_ie^{t\times \text{p}_i} $$

$$\text {Poles Difference}:p[n]= \sum_{i=1}^{n_1} c_i\text{p}_i^n $$

Where the $p_i$ is the value of ith pole and C is some constant, possibly scaled to the inverse value of the number of poles, the index runs from 1 to $n_1$, the number of poles. I denote the solution that considers only poles/characteristic equation as $p(t)$. (To be exact, c is the input/initial value at time zero so we still have the denominator of characteristic equation as cz^0=c).

Next, zeros should be solved in respect to time/samples. This should be an easy task, considering that the input equation which zeros are solved from, directly outputs the signal. First solve the Y(z) (equivalent to the numerator of the transfer function):

$$Y[z]=\prod_{i=1}^{n_2}(z-q_i)$$

Where $q_i$ is the value of ith zero and $n_2$ the number of zeros. The function needs to still be converted to time doimain by converting each individual elements $az^{x}$ into $z[n(-x)]=a$. Things get more complicated when both elements are considered simultaneously. Unless my interpretation is incorrect, the input equation (used for zeros) acts as a signal that is fed into the recursive filter(poles portion). Thus the final interpretation can be had by simply convolving the equations (with $c_i=1$):

$$ \text {Zeros, Poles}: y[n] = p[n] * z[n] $$

Where the $p[n]$ and $z[n]$ from the preceding equations and $*$ is the convolution operator. To solve the differential equation variation, simply substitute $t$ in place of $n$ for zeros and the output.

Dole
  • 348
  • 1
  • 17
  • 2
    if i were you, i would adopt a semantic that is recognizable to electrical engineers. your "$p(t)$" should be (dirac) impulse response $h(t)$. "$p(n)$" should be discrete-time (kronecker) impulse response $h[n]$. better not use "$n$" as the top limit of your summation to avoid confusion with the other $n$. you should express your poles and zeros (i would use the semantic $p_i$ and $q_i$) in terms of your transfer function $H(s)$ or $H(z)$. such as $$ H(z) = H_0 \frac{(z-q_1)(z-q_2)...(z-q_M)}{(z-p_1)(z-p_2)...(z-p_N)} $$ where $M \le N$. – robert bristow-johnson Jun 28 '16 at 18:38
  • to add what @robertbristow-johnson said: it's really bad style to use $words$ as variable names, because things get ambiguous ($words\overset?= w\cdot o\cdot r\cdot d\cdot s$). Also, avoid $*$, because that operator is commonly used for convolution. Simply use nothing or the multiplication dot $\cdot$. Same goes for $\times$ - that commonly is used to mark multi-dimensional spaces (as in $\mathbb R^{N\times N}$), but never to denote multiplication! – Marcus Müller Jun 28 '16 at 21:45
  • @MarcusMüller Thanks for the feedback, I will try to tidy things a bit. The * is the convolution operator! (not multiplication). – Dole Jun 29 '16 at 00:38
  • i still can't recognize the mathematics as anything i am familiar with regarding poles and zeros in linear, time-invariant systems. (particularly the $z(t)$ equation; where is "$t$" in the right-hand side of that equation?) – robert bristow-johnson Jun 29 '16 at 02:44
  • @robertbristow-johnson I made some more edits. The idea behind that equation is to convert the zeros back into the transfer function input representation (that is the equation $Y[z]$). Then convert that into the time domain by using the exponent of z (in reverse order) as the time index and the preceding coefficient of z as the amplitudes for each respective time index. I also changed this to the discrete manifestation, because I am not sure how this would work with continuous signals. By the way, why is M<=N? – Dole Jun 29 '16 at 03:08
  • for a discrete-time filter FIR or IIR, that is causal, the number of poles must be at least as many as the number of zeros. otherwise the impulse response $h[n]$ would begin before $n=0$. for a causal filter, $h[n]=0$ for all $n<0$. – robert bristow-johnson Jun 29 '16 at 05:41
  • @robertbristow-johnson Do you mean causal and minimum phase? – Dole Jun 29 '16 at 05:54
  • i mean only what i said. – robert bristow-johnson Jun 29 '16 at 06:53
  • @robertbristow-johnson That can't possibly be right. Consider a causal FIR filter, it has no poles (unless a coefficient happens to be infinite). I would say that it's wrong to consider such filter anti-causal, because it isn't. This is unless I am really missing something obvious here. Perhaps the issue is that the transfer function can be multiplied by z (thus time shifting), without affecting the zeros themselves at all. Thus the timing can't be determined. I will have to study how you inverted the transform in detail though. – Dole 6 secs ago edit – Dole Jun 29 '16 at 08:12
  • no, FIR filters have as many poles as they have zeros. it's just that all of the poles are at the origin ($z=0$). the math below spells it out. the math is quite simple. if the number of zeros exceed the number of poles, your filter is acausal. stability happens when all of the poles are inside the unit circle and minimum phase happens when all of the poles and all of the zeros are inside the unit circle. – robert bristow-johnson Jun 29 '16 at 15:07
  • @robertbristow-johnson This would probably warrant a new question... I see what you mean FIR has pole where-ever one of the coefficients is infinite. I think people are abusing the standard notation which leads to the "no poles" interpretation. Anyway, what is important is that you can have any amount of singular delay taps in the filter and still have it causal. – Dole Jun 29 '16 at 17:08
  • i didn't say anything about any coefficient being infinite. any causal discrete-time filter has at least as many poles as it has zeros. causal FIR filters have poles at the origin. and people have commonly mistakenly said that "FIR filters have no poles." which is not true. but you need not design for poles in an FIR because they are all at the origin and do not contribute to the magnitude frequency response. – robert bristow-johnson Jun 29 '16 at 17:28

1 Answers1

3

Okay, I'm gonna attempt an answer to this while I am still convinced the question is ill-formed. I am answering the title of the question without really referring to the text of the question, which I don't understand.

First, for discrete-time: A general IIR (or even FIR in which all of the poles are at the origin, where $z=0$) transfer function is:

$$\begin{align} H(z) \triangleq \frac{Y(z)}{X(z)} & = H_0 \frac{(z-q_1)(z-q_2)(z-q_3)...(z-q_M)}{(z-p_1)(z-p_2)(z-p_3)...(z-p_N)} \\ \\ & = H_0 \frac{z^M (1-q_1 z^{-1})(1-q_2 z^{-1})(1-q_3 z^{-1})...(1-q_M z^{-1})}{z^N (1-p_1 z^{-1})(1-p_2 z^{-1})(1-p_3 z^{-1})...(1-p_N z^{-1})} \\ \\ & = z^{M-N} \ \frac{H_0 \ (1-q_1 z^{-1})(1-q_2 z^{-1})(1-q_3 z^{-1})...(1-q_M z^{-1})}{(1-p_1 z^{-1})(1-p_2 z^{-1})(1-p_3 z^{-1})...(1-p_N z^{-1})} \\ \\ & = z^{M-N} \ \frac{b_0 + b_1 z^{-1} + b_2 z^{-2} + b_3 z^{-3} + ... + b_M z^{-M} }{ 1 + a_1 z^{-1} + a_2 z^{-2} + a_3 z^{-3} + ... + + a_N z^{-N} } \end{align}$$

$N$ is the number of poles, $p_i$, and $M$ is the number of zeros, $q_i$.

The difference equation comes from moving a few of the above things around.

$$\begin{align} Y(z) & \left( 1 + a_1 z^{-1} + a_2 z^{-2} + ... + a_N z^{-N} \right) \\ & \quad = X(z) z^{M-N} \left( b_0 + b_1 z^{-1} + b_2 z^{-2} + ... + b_M z^{-M} \right) \end{align}$$

$$\begin{align} Y(z) = \ & b_0 z^{M-N} X(z) + b_1 z^{M-N-1} X(z) + b_2 z^{M-N-2} X(z) + ... \\ & \quad ... + b_M z^{-N} X(z) - a_1 z^{-1}Y(z) - a_2 z^{-2}Y(z) - ... - a_N z^{-N}Y(z) \end{align}$$

Inverting the Z Transform, this becomes

$$\begin{align} y[n] = \ & b_0 \ x[n+M-N] + b_1 \ x[n+M-N-1] + b_2 \ x[n+M-N-2] + ... \\ & \quad ... + b_M \ x[n-N] - a_1 \ y[n-1] - a_2 \ y[n-2] - ... - a_N \ y[n-N] \end{align}$$

For a causal system or filter, we cannot look into the future for any input sample $x[n]$. That means $M \le N$ so that there is no negative delays on the $x[n+M-N]$ term.

Often $M=N$ (the numbers of poles and zeros are the same) and you get the more familiar

$$\begin{align} y[n] = \ & b_0 \ x[n] + b_1 \ x[n-1] + b_2 \ x[n-2] + ... + b_N \ x[n-N] \\ & \quad - a_1 \ y[n-1] - a_2 \ y[n-2] - ... - a_N \ y[n-N] \end{align}$$

and the more familiar transfer function

$$\begin{align} H(z) & = H_0 \frac{(z-q_1)(z-q_2)(z-q_3)...(z-q_N)}{(z-p_1)(z-p_2)(z-p_3)...(z-p_N)} \\ \\ & = \frac{H_0 \ (1-q_1 z^{-1})(1-q_2 z^{-1})(1-q_3 z^{-1})...(1-q_N z^{-1})}{(1-p_1 z^{-1})(1-p_2 z^{-1})(1-p_3 z^{-1})...(1-p_N z^{-1})} \\ \\ & = \frac{b_0 + b_1 z^{-1} + b_2 z^{-2} + b_3 z^{-3} + ... + b_N z^{-N} }{ 1 + a_1 z^{-1} + a_2 z^{-2} + a_3 z^{-3} + ... + + a_N z^{-N} } \end{align}$$

That demonstrates where the difference equation (and the feedforward, $b_i$, and feedback, $-a_i$, coefficients) come from the poles, $p_i$, and zeros, $q_i$.

The problem remaining, which is the hard problem, is that I didn't bother to multiply it out. So you have to blast this out:

$$\begin{align} H_0 \ & (1-q_1 z^{-1})(1-q_2 z^{-1})(1-q_3 z^{-1})...(1-q_M z^{-1}) \\ & \quad = b_0 + b_1 z^{-1} + b_2 z^{-2} + b_3 z^{-3} + ... + b_M z^{-M} \end{align}$$

and

$$\begin{align} & (1-p_1 z^{-1})(1-p_2 z^{-1})(1-p_3 z^{-1})...(1-p_N z^{-1}) \\ & \quad = 1 + a_1 z^{-1} + a_2 z^{-2} + a_3 z^{-3} + ... + a_N z^{-N} \end{align}$$

You can see right away that $b_0 = H_0$ and that $a_0=1$ (I never really had an "$a_0$" term anyway), but you have to blast out the multiplication of the binomials to get the polynomials. You can also see that $b_M = (-1)^M H_0 q_1 q_2 q_3 ... q_M$ and $a_N = (-1)^N p_1 p_2 p_3 ... p_N$ That's not a simple expression, but I hope you understand what you must do here.

robert bristow-johnson
  • 20,661
  • 4
  • 38
  • 76