# This is from the question
from scipy.fftpack import fft
# Number of samplepoints
N = 600
# Sample spacing
T = 1.0 / 800.0
x = np.linspace(0.0, N*T, N)
y = np.sin(50.0 * 2.0*np.pi*x) + 0.5*np.sin(80.0 * 2.0*np.pi*x)
yf = fft(y)
fft ) Fourier analysis is a method for expressing a function as a
sum of periodic components, and for recovering the signal from those components.
When both the function and its Fourier transform are replaced with
discretized counterparts, it is called the discrete Fourier transform (DFT).