Excellent points, thanks.
-
I’m for sure only going as far as linking the existing CMSIS bits from libDaisy, without any modifications. Although I somewhat override it slightly to get rid of huge pre-initialized memory sections which I mentioned previously. I’m actually very close to sharing a draft version, so you’ll see for yourself soon what I’m talking about and whether it makes sense.
-
For the sake of experiment I’ve also added the previously mentioned portable FFT implementation. It worked out quite well, so I’m considering leaving it in place. One problem that I haven’t found a solution for yet is that different implementations have different data layouts and adding unifying wrappers would be very inefficient. In my accuracy/performance tests I use a pair of forward and inverse transforms and check against the input vector. This is guaranteed to work for both implementations, but as soon as you want to manipulate individual samples in the frequency domain you have to respect each implementation’s own layout. For convolution I only needed to multiply the frequency domain vectors, so I’ve added Multiply() methods to both FFT classes which take care of layout differences internally. That is of course only one way. Another would be to implement access functions like GetRe(i), GetIm(i) and hope the compiler does a good job of optimizing it out. But using ARM-optimized vector math operations would no longer be possible in this case though. The third way is to try and re-engineer the FFTReal to match the ARM FFT layout and hope the performance hit is not too big.
-
The good news is that the whole thing is indeed cross-platform. For my own convenience I’m also compiling everything on x64 Windows (using MSVC compiler) and it works perfectly with just small set of stub functions (like dsy_tim_get_ticks, seed.SetLed(), etc.). I have VS2019 projects for my test cases, let’s see how to share and make them reusable in the most convenient way.
I’ll keep thinking about the testing approach. For now I’m trying to take small successive steps to not get overwhelmed by too many things at once.