#include #include #define POCKETFFT_CACHE_SIZE (16*1024*1024) #define POCKETFFT_NO_MULTITHREADING // MT doesn't seem to help at small sizes #include void fft_mag(std::complex* in, float* out, size_t len) { pocketfft::shape_t shape{len}; pocketfft::stride_t stride(1); stride[0] = sizeof(std::complex); pocketfft::shape_t axes; axes.push_back(0); std::vector> out_rev(len); pocketfft::c2c(shape, stride, stride, axes, pocketfft::FORWARD, in, out_rev.data(), 1.0f); // negative frequencies first for(size_t i=0;i