RustFFT is a high-performance FFT library written in pure Rust. See the documentation for more details.
This is an experimental release of RustFFT that enables AVX acceleration. It currently requires a nightly compiler,
mainly for the min_specialization
feature. The eventual plan is to release this experimental version as version 5.0 of RustFFT,
but that will not happen until it compiles on stable Rust.
No special code is needed to activate AVX: Simply plan a FFT using the FftPlanner on a machine that supports the avx
and fma
features.
// Perform a forward FFT of size 1234
use rustfft::{FftPlanner, num_complex::Complex};
let mut planner = FftPlanner::new(false);
let fft = planner.plan_fft(1234);
let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1234];
fft.process_inplace(&mut buffer);
If you're looking for the experimental AVX-accelerated release, check out the SIMD branch.
// Perform a forward FFT of size 1234
use rustfft::{FFTplanner, num_complex::Complex};
let mut planner = FFTplanner::new(false);
let fft = planner.plan_fft(1234);
let mut input: Vec<Complex<f32>> = vec![Complex{ re: 0.0, im: 0.0 }; 4096];
let mut output: Vec<Complex<f32>> = vec![Complex{ re: 0.0, im: 0.0 }; 4096];
fft.process(&mut input, &mut output);
This experimental version of rustfft
crate requires nightly Rust.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Before submitting a PR, please make sure to run cargo fmt
.