kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.65k stars 253 forks source link

dft temp buffer #99

Closed mipac closed 4 years ago

mipac commented 4 years ago

Hi,

could you give some details about "temp" working buffer in dft excecute call? is possible to ignore it? must we pass a buffer using dft_plan temp size? we must use a buffer by thread I suppose?

regards

samuelriddle commented 4 years ago

Hi,

DFT algorithm requires a temporary buffer in most cases for optimizing memory copying especially for in-place variants.

must we pass a buffer using dft_plan temp size?

Yes, it must be a 32-bytes aligned memory of temp_size size (in bytes). You may use aligned_allocate for this or univector<u8> tmp(dft.temp_size). You don't have to save the content of the buffer. You may allocate the buffer with dft_plan or allocate it for every execute call. The latter requires more cpu but reduces memory allocated between calls.

Best regards