# Homework Help: Finding Impulse And Frequency Responses

Tags:
1. Feb 12, 2016

### Captain1024

1. The problem statement, all variables and given/known data
Consider a LTI system defined by the following difference equation: $\mathrm{y}[n]=-2x[n]+4x[n-1]-2x[n-2]$
a) Determine the impulse response of the system
b) Determine the frequency response of the system

2. Relevant equations
DTFT: $\mathrm{x}[n]=\frac{1}{2\pi}\int_{\pi}^{-\pi} \mathrm{X}(e^{j\omega})e^{j\omega n} d\omega \ \longleftrightarrow \ \mathrm{X}(e^{j\omega})=\sum_{n=-\infty}^{\infty} \mathrm{x}[n]e^{-j\omega n}$

3. The attempt at a solution
I started by finding the frequency response:
$\mathrm{Y}(e^{j\omega})=-2\mathrm{X}(e^{j\omega})+4e^{-j\omega}\mathrm{X}(e^{j\omega})-2e^{-2j\omega}\mathrm{X}(e^{j\omega})$
$=\mathrm{X}(e^{j\omega})(-2+4e^{-j\omega}-2e^{-2j\omega})$
Frequency response $\mathrm{H}(e^{j\omega})=-2+4e^{-j\omega}-2e^{-2j\omega}$

My work on impulse response:
$\mathrm{h}[n]=\frac{1}{2\pi}\int_{-\pi}^{\pi}(-2+4e^{-j\omega}-2e^{-2j\omega})e^{j\omega n}d\omega$
$=\frac{1}{2\pi}\int_{-\pi}^{\pi}-2e^{j\omega n}+4e^{-j\omega}e^{j\omega n}-2e^{-2j\omega}e^{j\omega n}d\omega$
$=\frac{1}{2\pi}\int_{-\pi}^{\pi}-2e^{j\omega n}+4e^{j\omega (n-1)}-2e^{j\omega (n-2)}d\omega$

I believe the answer is $\mathrm{h}[n]=\{-2, 4, -2\}$. Am i overthinking how to arrive at the answer or am I on the right track?

-Captain1024

2. Feb 14, 2016

### collinsmark

Yes, I believe you are correct.

Note: It's been awhile since I've done this. That said, your answers seem to be correct, as far as I can tell.

Regarding the impulse response: It's exceedingly easy to find the impulse response of a finite impulse response (FIR) filter. You merely send an impulse through and record what $y$ is at each offset. I assume that is how you obtained your result of $\mathrm{h}[n]=\{-2, 4, -2\}$, which is correct.

You could also find the impulse response by taking the inverse DTFT of the frequency response. You've already started that approach. That method is a bit tricky (and perhaps unnecessary since there are easier ways to do it), but is certainly possible.

It's a fun idea to do that at least once, if for no other reason to see how the math works out, and even to see where that $\frac{1}{2 \pi}$ comes from in the inverse-DTFT formula.

Here are some hints to help you evaluate that integral, and obtain the impulse response by taking the inverse-DTFT of the frequency response:
• Each term will be 0 for all values of n expect for a single value of n, which is specific to that term.
• That particular value of n will result in a 0 in the numerator, and also a 0 in the denominator, resulting in an undefined number.
• You can find what that number is by using L'Hôpital's[/PLAIN] [Broken] rule.
• And since that value is specific to a specific value of n, you can tack on a $\delta[n - \nu]$ on that term, where $\nu$ is a specific number 0, 1, 2, 3, ... etc., specific to that particular term. [Edit: In other words, you'll be tacking on a $\delta[n]$, $\delta[n - 1]$, or $\delta[n - 2]$, etc., on each term.]
• You might find the following relationships useful: $\frac{d}{dn}\{ (-1)^n \} = j \pi (-1)^n$ and $\frac{d}{dn} \{ (-1)^{-n} \} = - j \pi (-1)^{-n}$
[Edit: at least that's the way I did it.]

[Another edit: it also may be useful to recognize that $e^{j \pi n} = (-1)^n$, where $n$ = ... -3, -2, -1, 0, 1, 2, 3, ...]

[Still another edit: Rather than converting the exponentionals to the form of $(-1)^n$ you might instead prefer to take a different approach by recognizing that $\frac{e^{j \pi n} - e^{-j \pi n}}{2 j} = \sin(\pi n)$. This latter approach is perhaps technically better. (It's more rigorous, and doesn't require that n be an integer.)]

Last edited by a moderator: May 7, 2017