builtins: add fft and ifft via Cooley-Tukey#200
Merged
Conversation
90e75ad to
dc8e58e
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
dc8e58e to
3922af8
Compare
Signal-processing and frequency-domain analysis are weak spots for any language that lacks a built-in FFT. fft xs returns the complex spectrum as a list of [re, im] pairs, ifft inverts it. Both use iterative Cooley-Tukey, power-of-two only for now with a clear error on non-pow2 input. Opcodes allocated: fft, ifft. Implementation is allocation-light: in-place butterflies on a pre-sized scratch buffer.
3922af8 to
6fbf3b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signal-processing and frequency-domain work are weak spots without a built-in FFT.
Implementation:
Tests: cross-engine regression tests + examples/fft.ilo with -- run: directives.