DFT (Discrete Fourier Transform) Algorithm in Swift
I think your code is doing DFT (Discrete Fourier Transform) and not FFT. You are doing \$O(n^{2})\$ operations in the 2 for loops. The FFT is supposed to be \$n*\log(n)\$. 

First thing to do is remove repeated multiplications. The terms Double(n)*2*M_PI/Double(N) can be calculated (as initial step) for every \$n\$ in \$0:(N-1)\$. Make a map for each \$n\$ to this value and use it to calculate \$q\$.

Then, see if using properties of \$\sin(2x)\$, \$\sin(\frac{x}{2})\$, \$\cos(2x)\$, \$\cos(\frac{x}{2})\$, etc. are  faster than actually calling those functions.

For example:

$$\begin{align}
\sin(2x) &amp;= 2\sin(x)\cos(x) \\
\cos(2x) &amp;= \cos^{2}(x) - \sin^{2}(x)
\end{align}
$$

or

$$\begin{align}
\sin\left(\frac{x}{2}\right) &amp;= \sqrt{\frac{1-\cos(x)}{2}} \\
\cos\left(\frac{x}{2}\right) &amp;= \sqrt{\frac{1+\cos(x)}{2}}
\end{align}
$$

If these are faster, you will reduce the complexity significantly.