Improving FFT performance in Python

You could certainly wrap whatever FFT implementation that you wanted to test using Cython or other like-minded tools that allow you to access external libraries. GPU-based If you’re going to test FFT implementations, you might also take a look at GPU-based codes (if you have access to the proper hardware). There are several: reikna.fft, scikits.cuda. … Read more

FFTW vs Matlab FFT

A few observations rather than a definite answer since I do not know any of the specifics of the MATLAB FFT implementation: Based on the code you have, I can see two explanations for the speed difference: the speed difference is explained by differences in levels of optimization of the FFT the while loop in … Read more

Why is FFT of (A+B) different from FFT(A) + FFT(B)?

I solved it!! The problem was the calculation of the Nonl term: Nonl[i*Ny+j][0] = dh[i*Ny+j][0]*dh[i*Ny+j][0]*dh[i*Ny+j][0]; Nonl[i*Ny+j][1] = 0.0; That needs to be changed to: Nonl[i*Ny+j][0] = dh[i*Ny+j][0]*dh[i*Ny+j][0]*dh[i*Ny+j][0] -3.0*dh[i*Ny+j][0]*dh[i*Ny+j][1]*dh[i*Ny+j][1]; Nonl[i*Ny+j][1] = -dh[i*Ny+j][1]*dh[i*Ny+j][1]*dh[i*Ny+j][1] +3.0*dh[i*Ny+j][0]*dh[i*Ny+j][0]*dh[i*Ny+j][1]; In other words: I need to consider dh as a complex function (even though it should be real). Basically, because of stupid rounding … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)