Initial values are lost (diff eq to Transfer function)?

196 Views Asked by At

I read eternal Julius O. Smith III and he says that

$$x_{n-m} = z^{-m}X(z)$$

Particularly, difference relation

$$y_{n} = y_{n-1} + x_{n}$$

is solved by by

$$Y = z^{-1}Y + X = {X \over (1-z^{-1})}$$

Applied impulse function $x[n] = [1,0,0,0,0,0]$ so that $ X = 1 + 0 z^{-1} + 0 z ^{-2} + \ldots = 1$, we can get the impulse response $Y = 1/(1-z^{-1}) = 1 + z^{-1} + z^{-2} + \ldots.$ This seems right. However, my generating functions and Laplace method (see how y'' is translated into $s^2Y$-sy(0) - y'(0)) suggest that we

$$y_1 + y_2 z^{-1} + y_3 z^{-2} + \ldots = z (y_1 z^{-1} + y_2 z^{-2} + \dots) = z^{-1} (y_0 + y_1 z^{-1} + y_2 z^{-2} + \dots - y_0) = z (Y - y_0)$$

and recurrence is translated into

$$z( Y - y_0) = Y + z(X -x_0)$$

whereupon

$$Y = z^{-1}Y + X -x_0 + y_0 = {X + y_0 - x_0 \over 1-z^{-1}} $$

I do not know what to do with $x_0$. It seems be able to conflict with definition of X or duplicate it. I mean that X already contains $x_0$. What does it mean? Anyway, is Julius Smith III right that we can solve the difference equations this way? Why should we ignore $y_0$?

1

There are 1 best solutions below

5
On BEST ANSWER

If I understand correctly you are asking two questions. The first is about an apparent issue because you are not using the fact that $y_0 = y_{-1} + x_0$. The second is if you can solve difference equations using the z-transform.

A few comments first:

My discussion ignores issues of convergence and existence of the z-transform. I assume that the relevant transforms are defined on $|z|>R$ for some $R$.

Given a sequence $x: \mathbb{Z} \to \mathbb{R}$, the unilateral z-transform of $x$ is given by $\hat{x}(z) = \sum_{n=0}^\infty x_n z^{-1}$. A sequence is called causal iff $x_n = 0$ for all $n <0$.

Define the right-shift $(Rx)_n = x_{n-1}$. Note that $(Rx)_0 = x_{-1}$. Then we have $\widehat{Rx} (z) = x_{-1}+ z^{-1} \hat{x}(z)$. If $x$ is causal (in fact, if $x_{-1} = 0$), then $(Rx)_0 = 0$ and $\widehat{Rx} (z) = z^{-1} \hat{x}(z)$.

If $x$ is causal, then it should be clear that $\widehat{R^kx} (z) = z^{-k} \hat{x}(z)$, where $R^k$ is $R\circ \cdots \circ R$ (that is, $k$ times).

Define the left-shift $(Lx)_n = x_{n+1}$. Note that if $x$ is causal , then $Lx$ is not necessarily causal because we have $(Lx)_{-1} = x_0$. In this case, we have $\widehat{Lx} (z) = z (\hat{x}(z)-x_0)$.

The point is that with causal sequences and the unilateral z-transform, a right shift corresponds to multiplication by $z^{-1}$, but a left shift needs to be modified slightly before multiplying by $z$.

Now for the first issue:

In the question above, the equation is $y_n = y_{n-1}+x_n$. Note that this can be written as $y_n = (Ry)_n + x_n$ or more succinctly as $y = Ry+x$. Furthermore, setting $n=0$ gives $y_0 = y_{-1} + x_0$.

Taking the transform gives $\hat{y}(z) = y_{-1} + z^{-1} \hat{y}(z) + \hat{x}(z)$. This gives $\hat{y}(z) = {y_{-1}+\hat{x}(z) \over 1- z^{-1}}$. If $y$ is causal, then $y_{-1} = 0$ and the formula simplifies to the formula above, that is, $\hat{y}(z) = {\hat{x}(z) \over 1- z^{-1}}$. So far, so good.

If I understand what it is that you did above (after the phrase "suggest that we"), you consider the equivalent equation $y_{n+1} = y_n + x_{n+1}$, which can be written as $Ly = y+Lx$. Taking transforms gives $z ( \hat{y}(z)-y_0) = \hat{y}(z) + z ( \hat{x}(z)-x_0)$, dividing across by $z$ gives $\hat{y}(z)-y_0 = z^{-1} \hat{y}(z) + \hat{x}(z)-x_0$, which simplifies to $\hat{y}(z) = {y_{0}-x_0+\hat{x}(z) \over 1- z^{-1}}$.

Since $y_0 = y_{-1} + x_0$, the two equations are equal.

Now the second question:

If two different sequences $x,y$ satisfy $x_n = y_n $ for all $n \ge 0$ then we have $\hat{x} = \hat{y}$, that is, the unilateral z-transform only 'cares' about the values of $x$ when $n \ge 0$. Hence if we use this transform to solve difference equations, at best it will tell us about solution behaviour for $n \ge 0$.

If $x,y$ are causal and $\hat{x} = \hat{y}$, then we have $x=y$. This is what allows us to find a solution to a difference equation.

Suppose you have a difference equation of the form (taken from the notes you referred to) $y_n = \sum_{k=0}^M b_k x_{n-k} - \sum_{k=0}^N a_k y_{n-k}$, and both $x,y$ are causal. Then this can be written as $y =\sum_{k=0}^M b_k R^k x - \sum_{k=0}^N a_k R^k y$, and taking transforms yields $\hat{y}(z) = \sum_{k=0}^M b_k z^{-k} \hat{x}(z) - \sum_{k=0}^N a_k z^{-k} \hat{y}(z)$, or equivalently, $\hat{y}(z) = \hat{h}(z) \hat{x}(z)$, where $\hat{h}(z) = { \sum_{k=0}^M b_k z^{-k} \over 1+\sum_{k=0}^N a_k z^{-k}}$.

Hence if one is given a suitable causal $x$, then to solve the equation one computes $\hat{x}$, multiplies it (pointwise) by $\hat{h}$ to get $\hat{y}$ and then computes the sequence that $y$ that corresponds to $\hat{y}$. Then this will be the unique causal solution to the difference equation.