FFT support for arbitrary size matrices
Currently, math.fft and math.ifft only deal with arrays with power-of-two size. However, there are other algorithms such as Bluestein's algorithm that work with the compound- and/or prime-sized arrays which will make evaluating the FFT on any data size.
Originally posted by @HanchaiN in https://github.com/josdejong/mathjs/issues/46#issuecomment-1136624658
Thanks for opening this feature request 👍
hello, I have implemented a Chirp-z Transform function inside fft.js to calculate non-power-of-2 FFT. I have also added test cases in fft.test.js ( I used scipy.fft and scipy.fft2 to compare results)
I was able to run npm run test and npm run build. Do I just go ahead to create a pull request? thanks
the fork is here:
https://github.com/cyavictor88/mathjs/tree/non-power-of-2-FFT
That sounds promising @cyavictor88 , thanks! Yes please open a PR with your implementation.
Addressed via #2900.
Published now in v11.6.0.