Fast Fourier transform function