I think I understand mostly everything until this sentence:

"The directions in which the impulses are pointing show the relative phases of the spectral components".

Please, note that I understand (and tested in Matlab) that the DFT of a pure sine wave of frequency f has a negative peak at the positive freq f and a positive peak at freq -f in the imaginary part Im(fft(x)) and no peaks in Re(fft(x)). Cosine has only positive peaks in Re(.) and nothing in Im(.) etc.

However, I have trouble understanding this story about phases, can someone help me understand this sentence:

"The directions in which the impulses are pointing show the relative phases of the spectral components".

This is basically just about the phase of a complex number. If you have a sinusoid

$$x(t)=\cos(\omega_0t+\phi)\tag{1}$$

then it can be written in terms of complex exponentials:

$$x(t)=\frac{e^{j\omega_0t}e^{j\phi}+e^{-j\omega_0t}e^{-j\phi}}{2}\tag{2}$$

So the signal has two components, one spectral line at frequency $$\omega_0$$ with phase $$\phi$$, and another spectral line at $$-\omega_0$$ with phase $$-\phi$$.

Note that if you had a pure cosine, i.e., if $$\phi=0$$ in $$(1)$$ then you would get two spectral lines with a real-valued and positive weight. If you had a pure sinusoid, i.e., $$\phi=-\pi/2$$ in $$(1)$$, then you would get two purely imaginary weights with opposite signs. These are the two special cases that you've already figured out by yourself.

• In DFT, when referring to phase, we always say phase relative to the cosine wave of the real part yes? E.g. -pi/2 and pi/2 for the 2 complex weights fot the DFT of a sine wave. Correct.? – Machupicchu Jul 29 '19 at 21:05
• @Machupicchu: Yes, simply because $\cos(x)=\frac12 (e^{jx}+e^{-jx})$. – Matt L. Jul 29 '19 at 21:15
• Sorry but why "because" of this equality? I can imagine another "reference" could be used. Is it not arbitrary?(sorry if the question is a bit strange) – Machupicchu Jul 29 '19 at 22:01
• @Machupicchu: Because you see that there are no complex weights (other than $1$) in the definition of the cosine. For the sine you need to divide by $j$, and the second term gets a negative sign. – Matt L. Jul 29 '19 at 22:03