Finding Impulse And Frequency Responses

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 replies · 2K views
Captain1024
Messages
44
Reaction score
2

Homework Statement


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

Homework 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}##

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
 
on Phys.org
Captain1024 said:

Homework Statement


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

Homework 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}##

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
Yes, I believe you are correct. :smile:

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 [itex]y[/itex] is at each offset. I assume that is how you obtained your result of [itex]\mathrm{h}[n]=\{-2, 4, -2\}[/itex], 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 [itex]\frac{1}{2 \pi}[/itex] 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] rule.
  • And since that value is specific to a specific value of n, you can tack on a [itex]\delta[n - \nu][/itex] on that term, where [itex]\nu[/itex] is a specific number 0, 1, 2, 3, ... etc., specific to that particular term. [Edit: In other words, you'll be tacking on a [itex]\delta[n][/itex], [itex]\delta[n - 1][/itex], or [itex]\delta[n - 2][/itex], etc., on each term.]
  • You might find the following relationships useful: [itex]\frac{d}{dn}\{ (-1)^n \} = j \pi (-1)^n[/itex] and [itex]\frac{d}{dn} \{ (-1)^{-n} \} = - j \pi (-1)^{-n}[/itex]
[Edit: at least that's the way I did it.]

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

[Still another edit: Rather than converting the exponentionals to the form of [itex](-1)^n[/itex] you might instead prefer to take a different approach by recognizing that [itex]\frac{e^{j \pi n} - e^{-j \pi n}}{2 j} = \sin(\pi n)[/itex]. 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:
  • Like
Likes   Reactions: Captain1024