meow_fft icon indicating copy to clipboard operation
meow_fft copied to clipboard

Real DFT storage

Open xnoreq opened this issue 1 year ago • 1 comments

Hello,

why does an N-point real DFT need a storage size of sizeof(Meow_FFT_Complex) * N in your example? The point of a real DFT is that N real samples are converted into N/2 complex samples due to the symmetry around Nyquist. And for the inverse only N/2 complex samples can be used anyway since any asymmetry (different values for negative frequencies) would result in a complex time-domain output .. which is not possible in a real DFT.

Also, since this is an out-of-place implementation why does it need an additional temp with a sizeof(Meow_FFT_Complex) * N? With N=16384 the workset already requires a lot of memory, 556840 bytes to be precise.

xnoreq avatar Jun 19 '23 19:06 xnoreq

Oooh, thanks for asking those questions - I'll check what I did, and get back to you with an answer.

JodiTheTigger avatar Jun 19 '23 22:06 JodiTheTigger

A bit late - but you're correct. I'll see to making an update to the example and readme.

JodiTheTigger avatar Jun 27 '24 05:06 JodiTheTigger

Also, since this is an out-of-place implementation why does it need an additional temp

Due to the way it's implemented, the mixer stage of the inverse transform needs a temporary location before running the non-inplace fft stage. This is because the input array is treated as read only.

JodiTheTigger avatar Jun 27 '24 06:06 JodiTheTigger