Fourier transform algorithm