Skip to content
UPEEC

Fourier Transforms in Python

Compute frequency spectra with numpy.fft / scipy.fft.

Intermediate
Comments 0
X = np.fft.rfft(signal)
f = np.fft.rfftfreq(len(signal), d=1 / fs)
peak = f[np.argmax(np.abs(X))]

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.