2
$\begingroup$

$$h[n] = 2( \delta[n-2]-\delta[n-1]-\delta[n-3])$$

i computed my frequency response and i have this now: $$H[e^{j \omega}] = 2[ e^{-2 j \omega} - e^{-j \omega}-e^{-3 j \omega}]$$

$$H[e^{j \omega}] = 2[ \cos(2\omega) -i \sin(2\omega)-\cos(\omega)+i\sin(\omega)-\cos(3\omega)+i\sin(3\omega)]$$

And i need to compute magnitude and phase. But how can i simplify that? there was a hint given to use trigonometric identities but i can't find some that suit my example.

  • 0
    typo in last formula, $\omega$ instead of $x$?2011-04-22
  • 3
    $|2e^{-i2ω}(1-e^{iω}-e^{-iω})| = |2e^{-i2ω}||1-e^{iω}-e^{-iω}|$ $=2|1-e^{iω}-e^{-iω}|$2011-04-22
  • 0
    Out of that i get $2[1-2*cos(x)]$. But it differs from the other solution from samanwita. What's correct now?2011-04-22
  • 0
    detailed computation is in my answer.2011-04-22

3 Answers 3

2

Expanding my comment above. From

$$H\left[ e^{-\mathrm{i}\omega }\right] =2\left[ \mathrm{e}^{-\mathrm{i}\left( 2\omega \right) }-\mathrm{e}^{-\mathrm{i}\omega }-\mathrm{e}^{-\mathrm{i}\left( 3\omega \right) }\right] =2\mathrm{e}^{-\mathrm{i}\left( 2\omega \right) }% \left[ 1-\mathrm{e}^{\mathrm{i}\omega }-\mathrm{e}^{-\mathrm{i}\omega }% \right]$$

we get the following

$$\begin{eqnarray*} \left\vert H\left[ e^{-\mathrm{i}\omega }\right] \right\vert &=&\left\vert 2\mathrm{e% }^{-\mathrm{i}\left( 2\omega \right) }\left[ 1-\mathrm{e}^{\mathrm{i}\omega }-\mathrm{e}^{-\mathrm{i}\omega }\right] \right\vert \\ &=&\left\vert 2\right\vert \left\vert \mathrm{e}^{-\mathrm{i}\left( 2\omega \right) }\right\vert \left\vert 1-\mathrm{e}^{\mathrm{i}\omega }-\mathrm{e}% ^{-\mathrm{i}\omega }\right\vert \\ &=&2\cdot 1\cdot \left\vert 1-\cos \omega -\mathrm{i}\sin \omega -\cos \omega +\mathrm{i}\sin \omega \right\vert \\ &=&2\left\vert 1-2\cos \omega \right\vert \\ \end{eqnarray*}$$

1

Expanding upon Américo and samanwita's answers:

$$H[e^{-j\omega }] =2e^{-j 2\omega}\left(1-2\cos(\omega)\right) \; ,$$

from which Américo deduced the magnitude to be

$$|H[e^{-j\omega }]| =2\left|1-2\cos(\omega)\right| \; .$$

The phase is then simply

$$e^{j\phi[\omega]}=e^{-j 2\omega}\frac{\left(1-2\cos(\omega)\right)}{\left|1-2\cos(\omega)\right| }$$

or

$$\phi[\omega] = \begin{cases} -2\omega \; , \text{ if } \omega \in \left]\frac{\pi}{3}+2k\pi,\frac{5\pi}{3}+2k\pi\right[\\ -2\omega + \pi \; , \text{ if } \omega \in \left]-\frac{\pi}{3}+2k\pi,\frac{\pi}{3}+2k\pi\right[\end{cases} \text{ for } k \in \mathbb{Z} \; .$$

  • 0
    @Raskolnikov: Please check the intervals limits. For instance, from $1-2\cos\omega=0$, i.e. $\cos \omega=1/2$ you get $\arccos(1/2)= \frac{1}{3}\pi$2011-04-23
  • 0
    @Americo So the answer is incorrect?2011-04-23
  • 1
    @Américo,@madmax: sorry about that,I was a bit careless there. It's fixed now.2011-04-23
  • 0
    @Raskolnikov: Shouldn't the intervals be open, e.g. $]\pi/3+2k\pi,5\pi/3+2k\pi[$? It seems to me that at the limits of both intervals, the argument of $1-2\cos (\omega)$ is undefined, since $1-2\cos (\omega)=0$. Moreover, if you look at samanwita's last link, the graph is rather complicated. I have no explanation for it!2011-04-23
  • 0
    @Américo: Yes, technically there is a "jump" at the singularities. The reason it looks complicated is because one wants to have the phase in the interval $[0,2\pi[$, so one should take the result modulo $2\pi$.2011-04-24
  • 0
    @Américo: Actually, wolframalpha seems to restrict the phase to the interval $[-\pi,\pi[$ in samanwita's calculation. Anyway, it's a matter of convention really. It probably depends on the application field, maybe madmax knows what convention he should adopt.2011-04-24
  • 0
    @Raskolnikov Well, it does not say which convention i should use. It just says compute and sketch qualitatively magnitude and phase of $H(e^{j\phi})$. Aside from possible phase jumps, is the phase response linear? if yes, what does this imply for the impulse response?2011-04-24
  • 0
    In my opinion the answer of @samanwita looks like the phase is linear but it looks also a bit weird with this absent vertical line.2011-04-24
  • 1
    @madmax: vertical lines are where jumps occur, it seems wolframalpha does not always render them. But they are not important. So basically, the response is indeed linear, except fo jumps at the points corresponding to the edges of the intervals defined in my answer.2011-04-24
  • 0
    @Raskolnikov: To me your explanation makes sense. @madmax: By the way may $\omega$ be either positive or negative? I had thought it was always positive.2011-04-24
0

It's a bit confusing here so to sum it up:

The frequency response is $ H[e^{j \omega}] = 2[ \cos(2\omega) -i \sin(2\omega)-\cos(\omega)+i\sin(\omega)-\cos(3\omega)+i\sin(3\omega)] $

$$ H[e^{j \omega}] = 2[1-2*cos(\omega)] $$

To get magnitude and phase i need real and imaginary parts: $$ H_R[e^{j \omega}] = 2[ \cos(2\omega) -\cos(\omega)-\cos(3\omega)] $$ $$ H_I[e^{j \omega}] = 2[ -\sin(2\omega)+\sin(\omega)+\sin(3\omega)] $$ $$ |H[e^{j \omega}]| = (H_R[e^{j \omega}]^2 + H_I[e^{j \omega}]^2)^{\frac{1}{2}} $$

And that is $$|H[e^{j \omega}]| = \sqrt{(2 \cos \omega - 1)^2}$$

PLOTS

  • 1
    You should have entered sqrt((2(cos 2x - cos 3x - cos x))^2 +(2 (sin 3x - sin 2x + sin x ))^2) in Wolfram alpha.2011-04-23
  • 0
    Because it is the magnitude and therefore i need to take the square root of it?2011-04-23
  • 0
    yes, the square root of the sum of the squares of the real and imaginary parts. The modulus of the complex $z=a+ib$ is $|z|=\sqrt{a^2+b^2}$.2011-04-23