# Phase spectrum of a Fourier transform

I am trying to compute the phase spectrum of the signal $$s(t)=\frac{A}{\pi}\left[H\left(t+\frac{\tau}{2}\right)-H\left(t-\frac{\tau}{2}\right)\right]$$

The Fourier transform is $$S(j\omega)=\frac{A\tau}{\pi}\cdot\frac{\sin\left(\omega\displaystyle\frac{\tau}{2}\right)}{\omega\displaystyle\frac{\tau}{2}}$$

My answer for this would be $\phi_s(\omega)=0$, since the imaginary part of $S(j\omega)$ is zero, but according to my textbook, the answer is

$$\phi_s(\omega)=\begin{cases}0&S(j\omega)>0\\\pm\pi&S(j\omega)<0\end{cases}$$

How can I get to this answer and interpret it correctly?

A real-valued negative number has a phase of $\pm\pi$, because $e^{\pm j\pi}=-1$. So for all frequencies for which the real-valued spectrum is negative, the corresponding phase angle equals $\pm \pi$:
$$S(j\omega)=\begin{cases}|S(j\omega)|,&&S(j\omega)\ge 0\\ |S(j\omega)|e^{\pm j\pi},&&S(j\omega)<0\end{cases}$$