Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the recommended Python module for fast Fourier transforms (FFT)?

Taking speed as an issue it may be better to choose another language, but what is your library/module/implementation of choice for doing a 1D fast Fourier transform (FFT) in Python?

like image 476
proportional Avatar asked Aug 06 '09 22:08

proportional


People also ask

How do you fast Fourier transform in Python?

Use the FFT function to calculate the Fourier transform of the above signal. Plot the amplitude spectrum for both the two-sided and one-side frequencies. TRY IT! Generate a simple signal for length 2048, and time how long it will run the FFT and compare the speed with the DFT.

Which library is used to solve Fourier transform in Python?

Python Code To begin, we import the numpy library. Next, we define a function to calculate the Discrete Fourier Transform directly.

What is FFT in Scipy?

Fourier Transforms ( scipy.fft ) Fast Fourier transforms. 1-D discrete Fourier transforms. 2- and N-D discrete Fourier transforms.


2 Answers

I would recommend numpy library, I not sure if it's the fastest implementation that exist but but surely it's one of best scientific module on the "market".

like image 79
Chris Ciesielski Avatar answered Sep 27 '22 21:09

Chris Ciesielski


FFTW would probably be the fastest implementation, if you can find a python binding that actually works.

The easiest thing to use is certainly scipy.fft, though. Plus, you get all the power of numpy/scipy to go along with it.

I've only used it for a toy project (a basic music visualization) but it was fast enough to process bog standard audio at 44khz at 60fps, as far as I can remember.

like image 26
Nicolas Lefebvre Avatar answered Sep 27 '22 22:09

Nicolas Lefebvre