I'm trying to calculate the Fourier transform of the Haar function, which is given by:
$\psi:\mathbb{R} \rightarrow [-1, 1], \;\psi(t) = \begin{cases} 1, & 0 \leq t < \frac{1}{2} \\ -1, & \frac{1}{2} \leq t<1 \\ 0, & else.\end{cases}$
My textbook says that the solution is $\widehat{\psi}(\omega)=\frac{i}{\sqrt{2\pi}} e^{-i \frac{\omega}{2}} sin(\frac{\omega}{4}) sinc(\frac{\omega}{4})$, with $sinc(\omega)=\frac{sin(\omega)}{\omega}$.
If I try to calculate it I would put it in the formula of the Fourier transformation:
$
\begin{split}\widehat{\psi}(\omega) &= \frac{1}{\sqrt{2\pi}} \int_{\mathbb{R}} \psi(t)e^{-i\omega t}dt \\
&= \frac{1}{\sqrt{2\pi}} \left( \int_{-1}^0 0dt+ \int_{0}^{\frac{1}{2}} 1e^{-i\omega t}dt + \int_{\frac{1}{2}}^1 (-1)e^{-i\omega t}dt \right) \\
&= \frac{i}{\omega \sqrt{2\pi}} \left( (e^{- \frac{i\omega}{2}} - 1) - (e^{-i\omega} - e^{-\frac{i\omega}{2}}) \right).
\end{split}
$
If I look at this and compare it to the solution of my textbook, it doesn't look the same. Even if I rewrite it in terms of $sin$ and $cos$. Or am I missing something?
Even if I plug it into WolframAlpha it won't give me the same result (https://www.wolframalpha.com/input/?i=%28int_%7B0%7D%5E%281%2F2%29e%5E%28-iwt%29dt%29+%2B+int_%7B1%2F2%7D%5E1+%28-1%29e%5E%28-iwt%29dt)
I would be happy for any help or advise.
Factor out $e^{-i\frac{\omega}{2}}$ then the inside becomes
$$2 - e^{i\frac{\omega}{2}} - e^{-i\frac{\omega}{2}} = \left(\frac{e^{i\frac{\omega}{4}}-e^{-i\frac{\omega}{4}}}{i}\right)^2 = 4\sin^2\left(\frac{\omega}{4}\right)$$