Tried the juce supplied FFT, and the result is not what I was expecting.
Looking at AppleFFT::performRealOnlyForwardTransform() there a multiple issues:
void performRealOnlyForwardTransform (float* inoutData, bool ignoreNegativeFreqs) const noexcept override
{
auto size = (1 << order);
auto* inout = reinterpret_cast<Complex<float>*> (inoutData);
auto splitInOut (toSplitComplex (inout));
//writes behind buffer. Also unclear what this is supposed to do.
inoutData[size] = 0.0f;
//good
vDSP_fft_zrip (fftSetup, &splitInOut, 2, order, kFFTDirection_Forward);
//with (size << 1), this scales twice as many elements as allowed
vDSP_vsmul (inoutData, 1, &forwardNormalisation, inoutData, 1, static_cast<size_t> (size << 1));
//this is just nonsense.
mirrorResult (inout, ignoreNegativeFreqs);
}
Other functions of AppleFFT have similar issues.
