Closed adwodon closed 2 months ago
@adwodon You need to set the bit reverse argument to 1 when calling the FFT. It is set to 0 in your example:
arm_cfft_f64(&inst, reinterpret_cast<float64_t*>(arm_data.data()), 0, 1);
This argument is a bit legacy. There are indeed a few cases when you do FFT -> linear processing -> IFFT where you can avoid doing the bit reversing if the linear processing step is done differently.
But it is such an unfrequent case, that most FFT libraries are always doing the bit reversal.
When I was only comparing the raw output I did try bit reversal, but didn't look at it again when doing the analysis. It's all working as intended now, thankyou for the explanation, very helpful.
I'm relatively new to DSP so forgive me if I've missed something obvious. Currently use pocketfft and I am looking into CMSIS-DSP for a new platform and I can't seem to get the same results, this is with
v1.15.0
andv1.16.0
I've created a small C++ project which demonstrates the issue, using
-DHOST=ON
on a windows machine, it prints out the results fromarm_cfft_f64
(as well as pocketfft), I've attached in output.txt, which can be fed into Matlab.I've then tried to compare these results in Matlab:
I get the following figure, I've disabled the pocketfft output, but it matches the Matlab:
If I increase
kDataSize
to1024
(witharm_cfft_sR_f64_len1024
) I get:Any help would be greatly appreciated.