So, I started to roll out my own fftw wrapper module this morning and now I got the message, that the new DSP module is available. Had a quick overview and saw that the new FFT class has the possibility to act as an fftw wrapper, among some other implementations.
While this is a VERRY nice thing, I’m missing some options to really use the horsepower of fftw.
Normally, an fftw transformation is initiated with some call like
plan = fftwf_plan_dft_r2c (n, inArray, outArray, FFTW_ESTIMATE);
where there is the option to pass various other flags like FFTW_MEASURE, FFTW_PATIENT & FFTW_EXHAUSTIVE. While FFTW_ESTIMATE just estimates which arithmetic tricks it should use to perform the fft, the other flags instruct fftw to try out some different options on how to perform the fft and measure which one is the fastest on the given hardware - which is one of the main features that makes fftw that fast.
Furthermore, fftw offers some functionality to perform perfectly aligned memory allocation, so that a maximum number of SIMD instructions could be used, another feature that makes fftw fast.
However in the constructor of the JUCE DSP module’s fftw wrapper functions I find
c2cForward = fftw.plan_dft_fftw (n, in.getData(), out.getData(), -1, unaligned | estimate);
c2cInverse = fftw.plan_dft_fftw (n, in.getData(), out.getData(), +1, unaligned | estimate);
r2c = fftw.plan_r2c_fftw (n, (float*) in.getData(), in.getData(), unaligned | estimate);
c2r = fftw.plan_c2r_fftw (n, in.getData(), (float*) in.getData(), unaligned | estimate);
which basically creates four fftw plans for the “worst” options that could be chosen. So under these circumstances, I don’t think fftw offers any great benefits (correct me if I’m wrong).
So while the DSP module just came out, are there any plans of adding the possibility to maybe simply pass an externally generated fftw plan to the constructor, that makes use of the extended fftw features? I assume this shouldn’t be that tricky?
And please don’t get me wrong, I really like the new module and can’t wait to get my hands on it ![]()


I was also confused by the description of the flag so I stepped into the source code of fftw and it definitly uses avx2 on the input on my machine - so it must somehow check for alignment. But I should probably double check with fftw devs…