Linear Constant Coefficient Discrete Difference Equations
Contents
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:
To find the impulse response $$h[n]$$ we want to solve:
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:
As the pattern continues, it looks like we have:
or in other words:
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:
To find the impulse response $$h[n]$$ we want to solve:
Substituting in $$h[n]=y_h[n]=C\,\gamma^n$$ for the $$n>0$$ equation gives:
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:
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 1: Fits Basic Case
Imagine you want to solve for the impulse response of
- 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]$$
Example 2: Fits Basic Case After Scaling and Shifting
Imagine you want to solve for the impulse response of
- Adjust the equation so that all the $$y$$ are on the left, all the $$x$$ are on the right, all the shifts are $$n-k$$ where $$k\geq 0$$ (the system is LTI so we can shift everything by the same amount), and $$x[n]$$ has a coefficient of 1:
- At this point, this perfectly fits the basic case again where $$x[n]$$ is alone on the right and unshifted relative to the unshifted $$y[n]$$ on the right.
- As above, $$h[n] =\frac{1}{3}\left(\frac{2}{3}\right)^n\,u[n]$$
More Complicated Forcing Function
All the cases above could be re-written to have a single $$x[n]$$ on the right, and at that point, all the $$y[n-k]$$ had $$k\geq 0$$ meaning, among other things, the system was causal. If the right-hand-side ends up more complicated than $$x[n]$$, it turns out that you can still solve the problem by re-writing things such that the left side still contains $$y[n-k]$$ with all $$k\geq 0$$, solving as if the right side at that point were merely $$z[n]$$, and then relating $$z[n]$$ to the more complicated right side using scaling and shifting.
Reminder: Scaled Convolutions with Impulses
Recall that $$z[n]\ast a\,\delta[n-k]=a\,z[n-k]$$. That means that something like $$3\,x[n]-4\,x[n-2]$$ could also be written as $$x[n]\ast\left(3\,\delta[n]-4\,\delta[n-2]\right)$$
Back to Basics
Let's start with a relatively simple case:
All the $$y$$ shifts are 0 or more to the right so that part is all good. The issue now is the complicated right side - even if we divide by 3 to get the $$x[n]$$ alone there will be more than just $$x[n]$$ over there. So let's start by just replacing all that with $$z[n]$$:
and then solve for the impulse response of this new system, which we can call $$h'[n]$$. We can solve for that using the methods above and get $$h'[n]=\frac{1}{2}\left(\frac{2}{3}\right)^{n}\,u[n]$$
Hooray for Math!
Since we know the relationship between $$x[n]$$ and $$z[n]$$:
we also know the relationship between $$h[n]$$ and $$h'[n]$$: