# Understanding an alternative representation for the difference equation of a FIR filter?

I recently solved a problem which required that I compute the convolution of an input signal with the impulse response of a filter. I got the resulting discrete signal which is verified to be the correct answer:

$$2\delta[n] + 6\delta[n - 1] + 3\delta[n - 2] + 3\delta[n - 3] + \delta[n - 4] + 4\delta[n - 5] + 2\delta[n - 7]$$

This is apparently equivalent to:

$$2\delta[n] + 6\delta[n - 1] + 3u[n - 2] - 2\delta[n - 4] + \delta[n - 5] - 3u[n - 6] + 2\delta[n - 7]$$

Where $u$ is the unit-step.

I understand that the unit-step is zero when $u[n - k]$ has ($k > n$), and one when ($k \leq n$). But beyond that I can't understand why this representation is identical. How can I to transform my output to match this format, or to verify they are the same?

• Maybe this identity helps: $\delta[n-k]=u[n-k]-u[n-k-1]$. However, after a quick glance I'm not sure the two expressions, as written, are actually equal. – MBaz Mar 29 '17 at 21:52
• @MBaz The output I provided is given as: [2, 6, 3, 3, 1, 4, 0, 2] within the problem, and I rewrote it in terms of δ. Maybe there is a mistake in my translation, but if not then this is exactly what the problem solution states. – Micrified Mar 29 '17 at 22:02

Given that $$u[n-k_1] = \sum_{k=k_1}^\infty \delta[n-k]$$

you can take the difference between two steps with different shifts ($k_1 < k_2$) and obtain: $$u[n-k_1] - u[n-k_2] = \sum_{k=k_1}^{k_2-1} \delta[n-k]$$

Then the difference

$$3u[n-2] - 3u[n-6] = 3\left(\delta[n-2] + \delta[n-3] + \delta[n-4] + \delta[n-5]\right)$$

which appears in your second equation can be replaced to give: \begin{align} y[n] &= 2\delta[n] + 6\delta[n - 1] + 3u[n - 2] - 2\delta[n - 4] + \delta[n - 5] - 3u[n - 6] + 2\delta[n - 7] \\ &= 2\delta[n] + 6\delta[n - 1] - 2\delta[n - 4] + \delta[n - 5] + 2\delta[n - 7] + 3u[n-2]-3u[n-6] \\ &= 2\delta[n] + 6\delta[n - 1] - 2\delta[n - 4] + \delta[n - 5] + 2\delta[n - 7] + 3\left(\delta[n-2] + \delta[n-3] + \delta[n-4] + \delta[n-5]\right) \\ &= 2\delta[n] + 6\delta[n - 1] + 3\delta[n-2] +3\delta[n-3]+ \delta[n - 4] + 4\delta[n - 5] + 2\delta[n - 7] \end{align}

which corresponds to your first expression.

• This is correct -- very nice. – MBaz Mar 30 '17 at 0:41
• Thank you! This makes sense to me. I didn't think of it as a sum to be added that way. – Micrified Mar 30 '17 at 9:31