Magnitude and phase of a complex function

complex-analysisfourier analysis

I did a Discrete time Fourier transform of the following signal:

$$x[1]=4\quad x[-1]=4$$

The result is
$$4e^{j\omega}-4e^{-j\omega}$$

We were supposed to draw the magnitude and phase graph of this complex function.

Firstly, I turned it into complex sine using $\sin(\alpha)=\frac{e^{j\alpha}-e^{-j\alpha}}{2j}$:

$$4e^{j\omega}-4e^{-j\omega} = 8j\sin(\omega)$$

I then turned it into magnitude and phase parts:

$$8j\sin(\omega) = 8\sin(\omega)\cdot e^{j\frac{\pi}{2}}$$

From this, it is apparent that the magnitude is:

$$8\sin(\omega)$$
And the phase is:
$$e^{j\frac{\pi}{2}} \implies\frac{\pi}{2}$$

I was able to draw the graphs of both of these but for some reason, both were incorrect. In the answer sheet, the magnitude was drawn in absolute value. And the phase was not on $\frac{\pi}{2}$ on the entire graph (as the function would suggest), but only on the positive part of the x axis. I don't know what I did wrong. The following image was in the answer sheet:enter image description here

Best Answer

Notice the real-valued sine function isn't positive for all real $\omega$.

$$|8j\sin{\omega}|=8 |\sin{\omega}|$$

Then,

$$8j\sin{\omega} = 8 |\sin{\omega}| e^{i \pi /2}$$

And then you can break it into cases: when $\sin{\omega}>0$, you get your answer, and when $\sin{\omega}<0$, $|\sin{\omega}|=-\sin{\omega}$, and that $(-1)$ gets the argument shifted by $\pi$ (remember to rewrite it in the principal argument later).