Discrete Fourier Transform (DFT) matrix and inverse

Even more simply, fft(I(n), dims=1) fft(I(n), 1)

What’s slowing down the comprehension approach is recomputing the exponential for every element. There are various ways to speed it up, but I suspect that brevity is the priority here.

Of course, computing the matrix explicitly, as opposed to using an FFT as a linear operator, is usually unnecessary. I’m curious to know what the OP’s application is.

6 Likes