Compute the onedimensional discrete Fourier Transform.
This function computes the onedimensional npoint discrete Fourier Transform (DFT) with the efficient Fast Fourier Transform (FFT) algorithm [CT].
Parameters:  a : array_like
n : int, optional
axis : int, optional


Returns:  out : complex ndarray

Raises:  IndexError :

See also
Notes
FFT (Fast Fourier Transform) refers to a way the discrete Fourier Transform (DFT) can be calculated efficiently, by using symmetries in the calculated terms. The symmetry is highest when n is a power of 2, and the transform is therefore most efficient for these sizes.
The DFT is defined, with the conventions used in this implementation, in the documentation for the numpy.fft module.
References
[CT]  Cooley, James W., and John W. Tukey, 1965, “An algorithm for the machine calculation of complex Fourier series,” Math. Comput. 19: 297301. 
Examples
>>> np.fft.fft(np.exp(2j * np.pi * np.arange(8) / 8))
array([ 3.44505240e16 +1.14383329e17j,
8.00000000e+00 5.71092652e15j,
2.33482938e16 +1.22460635e16j,
1.64863782e15 +1.77635684e15j,
9.95839695e17 +2.33482938e16j,
0.00000000e+00 +1.66837030e15j,
1.14383329e17 +1.22460635e16j,
1.64863782e15 +1.77635684e15j])
>>> import matplotlib.pyplot as plt
>>> t = np.arange(256)
>>> sp = np.fft.fft(np.sin(t))
>>> freq = np.fft.fftfreq(t.shape[1])
>>> plt.plot(freq, sp.real, freq, sp.imag)
>>> plt.show()
In this example, real input has an FFT which is Hermitian, i.e., symmetric in the real part and antisymmetric in the imaginary part, as described in the numpy.fft documentation.
Output