Discrepancy when calculating LTI system output using inverse z-Transform - Signal Processing Stack Exchange most recent 30 from dsp.stackexchange.com 2019-07-21T03:34:22Z https://dsp.stackexchange.com/feeds/question/25336 http://www.creativecommons.org/licenses/by-sa/3.0/rdf https://dsp.stackexchange.com/q/25336 0 Discrepancy when calculating LTI system output using inverse z-Transform Westerley https://dsp.stackexchange.com/users/16901 2015-08-20T03:53:23Z 2015-08-20T21:04:58Z <p>I'm given a difference equation, $y[n]-0.4y[n-1]=x[n]$, and asked to find the natural response $y_n[n]$, forced response $y_f[n]$ and complete response $y[n]$ if $x[n]=4 (0.25)^nu[n]$ and $y=0$.</p> <p>By one approach I've read, $$\text{characteristic equation:}\quad z-0.4=0 \quad\therefore y_n[n]=A(0.4)^n \\ \\ y_f[n]=B(0.25)^n \quad\text{substitute back into diffeq:}\\ B(0.25)^n -0.4B(0.25)^{n-1}=B(0.25)^n - \frac{0.4}{0.25}B(0.25)^n= 4(0.25)^nu[n]\\ \therefore B=-\frac{20}{3}, \quad y_f[n]=-\frac{20}{3}(0.25)^nu[n]\\ \therefore y[n] = A(0.4)^n-\frac{20}{3}(0.25)^nu[n]\\ y=0 \rightarrow A=\frac{20}{3} \\ y[n]= \frac{20}{3}(0.4)^n-\frac{20}{3}(0.25)^nu[n]\\$$ Great! Alternatively, I should be able to determine $y[n]$ by taking the inverse z Transform of $Y(z)=H(z)X(z)$, which in this case is (I'm pretty sure) Y(z)= \frac{z}{z-0.4}\cdot 4 \frac{z}{z-0.25}\\ \begin{align} \frac{Y(z)}{z} &amp;= \frac{4z}{(z-0.4)(z-0.25)}=\frac{C}{z-0.4}+\frac{D}{z-0.25}\\ &amp;=\frac{32}{3} \frac{1}{z-0.4} - \frac{20}{3}\frac{1}{z-0.25}\\ \end{align}\\ \therefore Y(z)=\frac{1}{3} \left[\frac{32z}{z-0.4} - \frac{20z}{z-0.25}\right]\\ \therefore y[n]= \left[ \frac{32}{3}(0.4)^n - \frac{20}{3}(0.25)^n \right] u[n] which is almost the same, but not quite. </p> <p>Where did I go wrong? Also, in the second approach, how do you take into account the initial condition of $y=0$? And thirdly, in the first approach, is the first term of $y[n]$ multiplied by $u[n]$ or not? If so, how do you show this?</p> <p>(for anyone wondering, this is not homework for a course, just self study...)</p> https://dsp.stackexchange.com/questions/25336/-/25342#25342 1 Answer by Hilmar for Discrepancy when calculating LTI system output using inverse z-Transform Hilmar https://dsp.stackexchange.com/users/3997 2015-08-20T13:02:43Z 2015-08-20T13:02:43Z <p>As Matt L pointed out, your initial condition is wrong. y is NOT 0, it's 4. This is obvious from the difference equation. Once you use y = 4, both results come out to be the same.</p> https://dsp.stackexchange.com/questions/25336/-/25355#25355 0 Answer by Matt L. for Discrepancy when calculating LTI system output using inverse z-Transform Matt L. https://dsp.stackexchange.com/users/4298 2015-08-20T21:04:58Z 2015-08-20T21:04:58Z <p>The way to solve such problems is to use the unilateral $\mathcal{Z}$-transform, which allows you to take initial conditions into account. Note that the unilateral $\mathcal{Z}$-transform of $y[n-1]$ is</p> <p>$$\mathcal{Z}\{y[n-1]\}(z)=z^{-1}Y(z)+y[-1]\tag{1}$$</p> <p>where $Y(z)$ is the $\mathcal{Z}$-transform of $y[n]$. Using $(1)$ you can transform the given difference equation $y[n]-\frac25 y[n-1]=x[n]$, resulting in</p> <p>$$Y(z)=\frac{X(z)}{1-\frac{2}{5}z^{-1}}+\frac{\frac{2}{5}\cdot y[-1]}{1-\frac{2}{5}z^{-1}}\tag{2}$$</p> <p>With $X(z)$ given by</p> <p>$$X(z)=\frac{4}{1-\frac14z^{-1}}\tag{3}$$</p> <p>Eq. $(2)$ becomes (after partial fraction expansion)</p> <p>$$Y(z)=\left(\frac{32}{3}+\frac{2y[-1]}{5}\right)\frac{1}{1-\frac{2}{5}z^{-1}}-\frac{20}{3}\frac{1}{1-\frac14z^{-1}}\tag{4}$$</p> <p>From $(4)$, the resulting output sequence is</p> <p>$$y[n]=\left(\frac{32}{3}+\frac{2y[-1]}{5}\right)\left(\frac25\right)^nu[n]-\frac{20}{3}\left(\frac14\right)^nu[n]\tag{5}$$</p> <p>Eq. $(5)$ is the general form of the output sequence of the given system with the given input sequence. The value $y[-1]$ is the initial condition of the system, i.e. the state the system is in right before the input signal starts. With $y[-1]=0$ you obtain the same solution as you obtained using the inverse $\mathcal{Z}$-transform (neglecting any initial conditions by using $y[n-1]\Longleftrightarrow z^{-1}Y(z)$).</p> <p>With the given constraint $y=0$, you can obtain the required value of $y[-1]$ by considering the difference equation at $n=0$:</p> <p>$$y-\frac25 y[-1]=x=4$$</p> <p>which gives $y[-1]=-10$. Plugging that value into Eq. $(5)$ finally gives the result</p> <p>$$y[n]=\frac{20}{3}\left(\frac25\right)^nu[n]-\frac{20}{3}\left(\frac14\right)^nu[n]\tag{6}$$</p>