Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to rustfft 6.0 and Rust 2018 edition #1

Merged
merged 13 commits into from
Jun 22, 2023

Conversation

sunsided
Copy link
Owner

Heya! When I tried to use stft from crates.io it failed with an error related to nalgebra-0.5. I poked around in the forks and found YoshieraHuang/stft which adds some modernizations on which this PR is based:

The latter commit allows cargo bench and cargo criterion to be run with stable Rust.

From there, I updated the Cargo.toml to use edition = "2018" and updated the dependencies to rustfft = "6.0", num = "0.4" and apodize = "1.0". I made sure to sanitize the code using rustfmt and Clippy.

The newer rustfft version appears to do FFT in-place now, but has support for an externally allocated scratch buffer. I added this to the STFT struct - the benchmarks indicate a slight performance increase with that change.

The existing integration tests were lacking an assertion to actually ensure the correct results are calculated. I added a dev dependency on approx = "0.5" to do perform said comparisons; the calculations are now also performed twice to ensure that a call to compute_column() does not
corrupt the internal state.


This duplicates snd#6 as a merge into my own fork of the repo.

@sunsided sunsided self-assigned this Jun 22, 2023
@sunsided sunsided merged commit 9f90b72 into main Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants