-
Notifications
You must be signed in to change notification settings - Fork 16
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 #6
base: master
Are you sure you want to change the base?
Conversation
This also adds explicit zero-padding of the input/output buffer to ensure that previous calculations don't "spill over".
In addition, the FFT calculation is now performed twice to ensure that the shared input/output buffer does not affect future calculations.
2542bda
to
bc09103
Compare
It seems like the author has abandoned this project, @sunsided would you be able to release your version under a new name on crates.io to ensure that it has a working build? Maybe it could be called |
@rohansatapathy Will do. I've reached out to @snd by mail first to see if he can add me as a maintainer, too. In that case we don't require the parallel crates. |
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:STFT::new_with_zero_padding()
(via YoshieraHuang@3695eb8)The latter commit allows
cargo bench
andcargo criterion
to be run with stable Rust.From there, I updated the
Cargo.toml
to useedition = "2018"
and updated the dependencies torustfft = "6.0"
,num = "0.4"
andapodize = "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 tocompute_column()
does notcorrupt the internal state.