Hacker News new | ask | show | jobs
by keurrr 2090 days ago
Not by hand, but the FFT I wrote for the spectral analyzer is compiled with -ffast-math and gcc vectorizes it (verified with objdump). Same thing with the functions that change the filter parameters.
2 comments

> is compiled with -ffast-math and gcc vectorizes it

Automatic vectorization is extremely limited, in all compilers.

Check this out, feel free to merge if it works in reality not just in the test: https://github.com/Const-me/prettyeq/tree/master

Thanks. I actually found your repo before seeing this post and sent you an email. Definitely going to port it back to C and merge it in. Thanks so much for this. Hand vectorizing this was on my TODO.
fftw3 is extremely fast and vectorized well. Why write your own FFT implementation?

Did you test against pulseeffects cpu usage?

I can't link with fftw3 since it's GPL. The other libraries that were permissive licensed had confusing APIs and the output binaries were almost as large as my entire project. CPU usage is high but because of one poorly designed part of the GUI (eqhover.cpp)
Surely there's one in here that would be acceptable. https://community.vcvrack.com/t/complete-list-of-c-c-fft-lib...
I'm not sure I understand, why can't you use GPL code?
I can’t statically link with it because I would need to release my own software under the GPL.
Why not license your software under the GPL? For end-user applications like these, there's no reason software shouldn't be GPL, and if fact it would be better for you since it prevents companies from exploiting your work that you intended to serve the greater good for purposes of their own profit.
> Why not license your software under the GPL?

If OP did that, I probably wouldn’t bother to improve their code: https://github.com/Const-me/prettyeq/tree/master

While my primary motivation was “for lulz”, possibility to reuse the code whenever I need a fast 1D FFT also contributed.