This question already has an answer here:
- Computational complexity of the FFT in n dimensions 1 answer
I'm trying to write a bit of code that will predict the time taken to perform a discrete Fourier transform on a given n-dimensional array, but I'm struggling to get my head around the computational complexity of n-dimensional FFTs.
As I understand it:
The 1D FFT of a vector of length
N
should takek*(N*log(N))
wherek
is some timing constantFor an
M*N
matrix, the 2D FFT should take:N*(k*M*log(M)) + M*(k*N*log(N)) = k*M*N*(log(M)+log(N))
since it requires taking 1D FFTs in each row and column
How does this generalize to the ND case? Does it follow that it should be k*prod(dimensions)*sum(log(dimensions))
?