I need two functions fft and ifft in python to a 2d numpy matrix of dtype complex128.
Howevr, I checked possible solutions online:
Numba obviously is not supporting any fft. except numba.cuda
pyfft, was not downloadable in visual studio, and had only fft, on ifft. see examples here https://pypi.org/project/pyfft/0.3.3/#cuda
similiar reikna.fft does not have IFFT
(Basically from this post Improving FFT performance in Python)
from the introduction of pyfftw https://pypi.org/project/pyFFTW/ , it did not provide any advantage over numpy.
compare to numpy, scipy was around 5%-10% faster, and better.
there seemed a mention of nufft, see https://jakevdp.github.io/blog/2015/02/24/optimizing-python-with-numpy-and-numba/ , but again it's not download in visual studio.
The other option left to pycuda, yet, it seemed much complicated(even compare to pyfft, and I don't have the time right now to figure out basically another language.)
But notice that, since scipy's fft and ifft does not seem to implement parallel computation, it's much slower than matlab's fft and ifft, by around 2 to 2.5 times.
So the only option left seem to write fft and use numba to translate it into paralla c code: (algorithm)2D Fourier Transformation in C and (amplitude)amplitude of numpy's fft results is to be multiplied by sampling period? . Also, see Matlab's formulas: https://www.mathworks.com/help/matlab/ref/fft2.html and https://www.mathworks.com/help/matlab/ref/ifft2.html .
Question 1: What's the best way to utilize cpu or gpu to calculate fft AND ifft(in 2D and 3D)? Like that of pyfft's Plan(gpu), or paralla cpu computation?
Question 2: Could you provide some links to papers or algorithms, or is there existing packages that's is easy to use(for visual studio)? like pseudocode: https://en.wikipedia.org/wiki/Cooley%E2%80%93Tukey_FFT_algorithm#Pseudocode