Linear Constant Coefficient Discrete Difference Equations

From PrattWiki
Revision as of 18:31, 23 September 2024 by DukeEgr93 (talk | contribs) (Created page with "== Introduction == This is a step-by-step guide for finding the impulse response for Linear Constant Coefficient Discrete Difference Equations (LCCDDE). Once you find the imp...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

This is a step-by-step guide for finding the impulse response for Linear Constant Coefficient Discrete Difference Equations (LCCDDE). Once you find the impulse response, you can find the response to any other input signal.

Basic First Difference

Let's start with a very simple case:

\( a_0\,y[n]+a_1\,y[n-1]=x[n] \)

To find the impulse response $h[n]$ we want to solve:

\( a_0\,h[n]+a_1\,h[n-1]=\delta[n] \)

where $$\delta[n]$$ is the discrete impulse, which is 1 when $$n=0$$ and 0 everywhere else. Assuming $$y[n]=0$$ for all $$n<0$$, we could make a table to see how the impulse response progresses:

\( \begin{array}{cccc} n & h[n-1] & \delta[n] & h[n]=\frac{\delta[n]-a_1\,h[n-1]}{a_0}\\ -1 & 0 & 0 & 0 \\ 0 & 0 & 1 & \frac{1}{a_0} \\ 1 & \frac{1}{a_0} & 0 & \frac{0-a_1\frac{1}{a_0}}{a_0} = \frac{1}{a_0}\left(-\frac{a_1}{a_0}\right) \\ 2 & \frac{1}{a_0}\left(-\frac{a_1}{a_0}\right) & 0 & \frac{0-a_1\frac{1}{a_0}\left(-\frac{a_1}{a_0}\right)}{a_0} = \frac{1}{a_0}\left(-\frac{a_1}{a_0}\right)^2 \\ \end{array} \)

As the pattern continues, it looks like we have:

\( h[n]=\begin{cases} n\lt 0, & 0 \\n\geq 0 & \frac{1}{a_0}\left(-\frac{a_1}{a_0}\right)^n\end{cases} \)

or in other words:

\( h[n]=\frac{1}{a_0}\left(-\frac{a_1}{a_0}\right)^n\,u[n] \)

General Homogeneous Solution

For LCCDDE problems, we can use a general homogeneous solution of $$y_h[n]=C\,\gamma^n$$, where $$\gamma$$ is some constant based on the coefficients. The impulse response for the basic first difference will generally be the same as the homogeneous response except for the $$h[0]=1$$ time. We can treat that more like an initial condition than a forcing function as follows:

\( a_0\,y[n]+a_1\,y[n-1]=x[n] \)

To find the impulse response $$h[n]$$ we want to solve:

\( \begin{align*} a_0\,h[n]+a_1\,h[n-1] &= 0, n\gt 0\\ h[n] &= 0, n\lt 0\\ h[n] &= \frac{1}{a_1}, n=0 \end{align*} \)

Substituting in $$h[n]=y_h[n]=C\,\gamma^n$$ for the $$n>0$$ equation gives:

\( \begin{align*} a_0\,C\,\gamma^n+a_1\,C\,\gamma^{n-1} &= 0\\ C\,\gamma^{n}\,\left(a_0+a_1\gamma^{-1}\right) &=0 \end{align*} \)

For that second equation to work, we either need $$C=0$$ (trivial case), $$\gamma^n=0$$ impossible for all $$n$$ unless $$\gamma=0$$, or $$\gamma=-\frac{a_1}{a_0}$$.

To figure out $$C$$, we can look at the $$n=0$$ case: $$y_h[0] = C = \frac{1}{a_1}$$. Since $$h[n]=0$$ for $$n<0$$ we can put the homogeneous solution together with a step function to get:

\( h_n=\frac{1}{a_1}\left(-\frac{a_1}{a_0}\right)^n\,u[n] \)

From this point forward, we can use a technique that is very similar to using $$y_h(t)=C\,e^{st}$$ for differential equations; instead of getting a characteristic polynomial by replacing $$\frac{d^ky(t)}{dt^k}$$ with $$s^k$$, we will replace $$y[n-k]$$ with $$\gamma^{-k}$$. Instead of solving for $$s$$ as an exponent, we will solve for $$\gamma$$ as a geometric constant.

Example

Imagine you want to solve for the impulse response of

\( 3\,y[n]-2y[n-1]=x[n] \)
  • Find $$\gamma$$ but replace all $$x[n]$$ with 0 and all $$y[n-k]$$ with $$\gamma^{-k}$$:
    \(\begin{align*}3-2\gamma^{-1}&=0\\ \gamma&=\frac{2}{3}\end{align*}\)
  • Find $$C$$ by putting $$C\,\gamma^n\,u[n]$$ in for $$n=0$$ case:
    \(\begin{align*}3\,C\,\left(\frac{2}{3}\right)^0\,u[0]-2\,C\,\left(\frac{2}{3}\right)^{-1}\,u[-1]&=1\\ 3\,C+0&=1\\ C&=\frac{1}{3}\end{align*}\)
  • $$h[n] =\frac{1}{3}\left(\frac{2}{3}\right)^n\,u[n]$$