### Perform a forward FFT with FftPlannerSse Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerSse.html Example demonstrating how to initialize a planner, plan a forward FFT, and process a buffer. ```rust // Perform a forward Fft of size 1234 use std::sync::Arc; use rustfft::{FftPlannerSse, num_complex::Complex}; if let Ok(mut planner) = FftPlannerSse::new() { let fft = planner.plan_fft_forward(1234); let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1234]; fft.process(&mut buffer); // The FFT instance returned by the planner has the type `Arc>`, // where T is the numeric type, ie f32 or f64, so it's cheap to clone let fft_clone = Arc::clone(&fft); } ``` -------------------------------- ### Perform a forward FFT with FftPlannerWasmSimd Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerWasmSimd.html Example demonstrating how to create a planner, plan a forward FFT, and process a buffer. ```rust // Perform a forward Fft of size 1234 use std::sync::Arc; use rustfft::{FftPlannerWasmSimd, num_complex::Complex}; if let Ok(mut planner) = FftPlannerWasmSimd::new() { let fft = planner.plan_fft_forward(1234); let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1234]; fft.process(&mut buffer); // The FFT instance returned by the planner has the type `Arc>`, // where T is the numeric type, ie f32 or f64, so it's cheap to clone let fft_clone = Arc::clone(&fft); } ``` -------------------------------- ### Perform a forward FFT using FftPlannerNeon Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerNeon.html Example demonstrating how to initialize a planner, plan a forward FFT, and process a buffer. ```rust // Perform a forward Fft of size 1234 use std::sync::Arc; use rustfft::{FftPlannerNeon, num_complex::Complex}; if let Ok(mut planner) = FftPlannerNeon::new() { let fft = planner.plan_fft_forward(1234); let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1234]; fft.process(&mut buffer); // The FFT instance returned by the planner has the type `Arc>`, // where T is the numeric type, ie f32 or f64, so it's cheap to clone let fft_clone = Arc::clone(&fft); } ``` -------------------------------- ### Perform an AVX-accelerated FFT Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerAvx.html Example demonstrating how to instantiate the planner and perform a forward FFT. The planner returns an error if AVX is not supported or enabled. ```rust // Perform a forward Fft of size 1234, accelerated by AVX use std::sync::Arc; use rustfft::{FftPlannerAvx, num_complex::Complex}; // If FftPlannerAvx::new() returns Ok(), we'll know AVX algorithms are available // on this machine, and that RustFFT was compiled with the `avx` feature flag if let Ok(mut planner) = FftPlannerAvx::new() { let fft = planner.plan_fft_forward(1234); let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1234]; fft.process(&mut buffer); // The FFT instance returned by the planner has the type `Arc>`, // where T is the numeric type, ie f32 or f64, so it's cheap to clone let fft_clone = Arc::clone(&fft); } ``` -------------------------------- ### Perform a forward FFT Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlanner.html Example demonstrating how to use FftPlanner to create a forward FFT instance and process a buffer. ```rust // Perform a forward Fft of size 1234 use std::sync::Arc; use rustfft::{FftPlanner, num_complex::Complex}; let mut planner = FftPlanner::new(); let fft = planner.plan_fft_forward(1234); let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1234]; fft.process(&mut buffer); // The FFT instance returned by the planner has the type `Arc>`, // where T is the numeric type, ie f32 or f64, so it's cheap to clone let fft_clone = Arc::clone(&fft); ``` -------------------------------- ### Compute FFT with GoodThomasAlgorithmSmall Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.GoodThomasAlgorithmSmall.html Example demonstrating how to initialize and process a forward FFT of size 56 using GoodThomasAlgorithmSmall with factors 7 and 8. ```rust // Computes a forward FFT of size 56 using GoodThomasAlgorithmSmall use std::sync::Arc; use rustfft::algorithm::GoodThomasAlgorithmSmall; use rustfft::algorithm::butterflies::{Butterfly7, Butterfly8}; use rustfft::{Fft, FftDirection}; use rustfft::num_complex::Complex; let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 56]; // we need to find an n1 and n2 such that n1 * n2 == 56 and GCD(n1, n2) == 1 // n1 = 7 and n2 = 8 satisfies this let inner_fft_n1 = Arc::new(Butterfly7::new(FftDirection::Forward)); let inner_fft_n2 = Arc::new(Butterfly8::new(FftDirection::Forward)); // the good-thomas FFT length will be inner_fft_n1.len() * inner_fft_n2.len() = 56 let fft = GoodThomasAlgorithmSmall::new(inner_fft_n1, inner_fft_n2); fft.process(&mut buffer); ``` -------------------------------- ### Initialize and Process Radix4 FFT Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Radix4.html Example showing how to create a Radix4 instance for a specific size and direction, then process a buffer of complex numbers. ```rust // Computes a forward FFT of size 4096 use rustfft::algorithm::Radix4; use rustfft::{Fft, FftDirection}; use rustfft::num_complex::Complex; let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 4096]; let fft = Radix4::new(4096, FftDirection::Forward); fft.process(&mut buffer); ``` -------------------------------- ### Compute forward FFT using MixedRadix Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.MixedRadix.html Example demonstrating how to factor a size 1200 FFT into 30 and 40 using the MixedRadix algorithm. ```rust // Computes a forward FFT of size 1200, using the Mixed-Radix Algorithm use rustfft::algorithm::MixedRadix; use rustfft::{Fft, FftPlanner}; use rustfft::num_complex::Complex; let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1200]; // we need to find an n1 and n2 such that n1 * n2 == 1200 // n1 = 30 and n2 = 40 satisfies this let mut planner = FftPlanner::new(); let inner_fft_n1 = planner.plan_fft_forward(30); let inner_fft_n2 = planner.plan_fft_forward(40); // the mixed radix FFT length will be inner_fft_n1.len() * inner_fft_n2.len() = 1200 let fft = MixedRadix::new(inner_fft_n1, inner_fft_n2); fft.process(&mut buffer); ``` -------------------------------- ### Compute FFT with GoodThomasAlgorithm Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.GoodThomasAlgorithm.html Example demonstrating how to compute a forward FFT of size 1200 using the Good-Thomas Algorithm by providing two coprime factors. ```rust // Computes a forward FFT of size 1200, using the Good-Thomas Algorithm use rustfft::algorithm::GoodThomasAlgorithm; use rustfft::{Fft, FftPlanner}; use rustfft::num_complex::Complex; use rustfft::num_traits::Zero; let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1200]; // we need to find an n1 and n2 such that n1 * n2 == 1200 and GCD(n1, n2) == 1 // n1 = 48 and n2 = 25 satisfies this let mut planner = FftPlanner::new(); let inner_fft_n1 = planner.plan_fft_forward(48); let inner_fft_n2 = planner.plan_fft_forward(25); // the good-thomas FFT length will be inner_fft_n1.len() * inner_fft_n2.len() = 1200 let fft = GoodThomasAlgorithm::new(inner_fft_n1, inner_fft_n2); fft.process(&mut buffer); ``` -------------------------------- ### FftPlannerNeon::new Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerNeon.html Creates a new instance of FftPlannerNeon. Returns Ok if the machine supports the required instruction sets, otherwise returns Err. ```APIDOC ## pub fn new() -> Result ### Description Creates a new `FftPlannerNeon` instance. Returns `Ok(planner_instance)` if this machine has the required instruction sets. Returns `Err(())` if some instruction sets are missing. ``` -------------------------------- ### FftPlannerSse::new Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerSse.html Creates a new instance of FftPlannerSse. Returns Ok if the current CPU supports SSE4.1 and the feature is enabled, otherwise returns Err. ```APIDOC ## pub fn new() -> Result ### Description Creates a new `FftPlannerSse` instance. Returns `Ok(planner_instance)` if compiling for X86_64 with SSE support enabled and the CPU supports `sse4.1`. Returns `Err(())` if SSE support is unavailable. ``` -------------------------------- ### Initialize and process a Radix3 FFT Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Radix3.html Demonstrates how to create a Radix3 instance for a power-of-three size and perform an in-place forward FFT. ```rust // Computes a forward FFT of size 2187 use rustfft::algorithm::Radix3; use rustfft::{Fft, FftDirection}; use rustfft::num_complex::Complex; let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 2187]; let fft = Radix3::new(2187, FftDirection::Forward); fft.process(&mut buffer); ``` -------------------------------- ### Radix4::new Source: https://docs.rs/rustfft Directly initializes a Radix4 FFT algorithm instance, bypassing the planner. ```APIDOC ## Radix4::new(len: usize, direction: FftDirection) ### Description Directly creates an instance of the Radix4 FFT algorithm. This bypasses the planner and disables SIMD optimizations. ### Usage ```rust use rustfft::{Fft, FftDirection, num_complex::Complex, algorithm::Radix4}; let fft = Radix4::new(4096, FftDirection::Forward); let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 4096]; fft.process(&mut buffer); ``` ``` -------------------------------- ### Initialize and process a naive DFT Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Dft.html Demonstrates how to create a new Dft instance of a specific size and direction, then process a buffer of complex numbers. ```rust // Computes a naive DFT of size 123 use rustfft::algorithm::Dft; use rustfft::{Fft, FftDirection}; use rustfft::num_complex::Complex; let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 123]; let dft = Dft::new(123, FftDirection::Forward); dft.process(&mut buffer); ``` -------------------------------- ### FftPlanner::new() Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlanner.html Creates a new FftPlanner instance. The planner will automatically detect available CPU features like AVX, SSE, or Neon to optimize FFT planning. ```APIDOC ## pub fn new() -> Self ### Description Creates a new `FftPlanner` instance. The planner will detect available CPU features and set itself up to plan FFTs with the fastest available instruction set. ``` -------------------------------- ### Initialize and execute a forward FFT with FftPlannerScalar Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerScalar.html Demonstrates creating a planner, planning a forward FFT of a specific size, and processing a buffer. The returned FFT instance is an Arc, making it safe to clone. ```rust // Perform a forward Fft of size 1234 use std::sync::Arc; use rustfft::{FftPlannerScalar, num_complex::Complex}; let mut planner = FftPlannerScalar::new(); let fft = planner.plan_fft_forward(1234); let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1234]; fft.process(&mut buffer); // The FFT instance returned by the planner has the type `Arc>`, // where T is the numeric type, ie f32 or f64, so it's cheap to clone let fft_clone = Arc::clone(&fft); ``` -------------------------------- ### FftPlannerWasmSimd::new Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerWasmSimd.html Creates a new instance of the FftPlannerWasmSimd. Returns Ok if the machine supports the required instruction sets, otherwise returns Err. ```APIDOC ### pub fn new() -> Result Creates a new `FftPlannerWasmSimd` instance. Returns `Ok(planner_instance)` if this machine has the required instruction sets. Returns `Err(())` if some instruction sets are missing. ``` -------------------------------- ### Compute a prime-sized FFT using Rader's Algorithm Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.RadersAlgorithm.html Demonstrates initializing and executing a prime-sized FFT by wrapping an inner FFT of size N-1. ```rust // Computes a forward FFT of size 1201 (prime number), using Rader's Algorithm use rustfft::algorithm::RadersAlgorithm; use rustfft::{Fft, FftPlanner}; use rustfft::num_complex::Complex; let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1201]; // plan a FFT of size n - 1 = 1200 let mut planner = FftPlanner::new(); let inner_fft = planner.plan_fft_forward(1200); let fft = RadersAlgorithm::new(inner_fft); fft.process(&mut buffer); ``` -------------------------------- ### Compute a forward FFT using Bluestein's Algorithm Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.BluesteinsAlgorithm.html Demonstrates initializing and executing a forward FFT of size 1201 using an inner FFT of size 2401. ```rust // Computes a forward FFT of size 1201, using Bluestein's Algorithm use rustfft::algorithm::BluesteinsAlgorithm; use rustfft::{Fft, FftPlanner}; use rustfft::num_complex::Complex; let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1201]; // We need to find an inner FFT whose size is greater than 1201*2 - 1. // The size 2401 (7^4) satisfies this requirement, while also being relatively fast. let mut planner = FftPlanner::new(); let inner_fft = planner.plan_fft_forward(2401); let fft = BluesteinsAlgorithm::new(1201, inner_fft); fft.process(&mut buffer); ``` -------------------------------- ### Perform a forward FFT using Radix4 algorithm Source: https://docs.rs/rustfft/6.4.1/rustfft/index.html Directly instantiate a specific algorithm to avoid planner overhead. Note that bypassing the planner disables all SIMD optimizations. ```rust // Computes a forward FFT of size 4096 use rustfft::{Fft, FftDirection, num_complex::Complex, algorithm::Radix4}; let fft = Radix4::new(4096, FftDirection::Forward); let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 4096]; fft.process(&mut buffer); ``` -------------------------------- ### Compute a forward FFT of size 40 Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.MixedRadixSmall.html Demonstrates initializing and executing a MixedRadixSmall FFT by combining two smaller butterfly FFTs. ```rust // Computes a forward FFT of size 40 using MixedRadixSmall use std::sync::Arc; use rustfft::algorithm::MixedRadixSmall; use rustfft::algorithm::butterflies::{Butterfly5, Butterfly8}; use rustfft::{Fft, FftDirection}; use rustfft::num_complex::Complex; let len = 40; let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; len]; // we need to find an n1 and n2 such that n1 * n2 == 40 // n1 = 5 and n2 = 8 satisfies this let inner_fft_n1 = Arc::new(Butterfly5::new(FftDirection::Forward)); let inner_fft_n2 = Arc::new(Butterfly8::new(FftDirection::Forward)); // the mixed radix FFT length will be inner_fft_n1.len() * inner_fft_n2.len() = 40 let fft = MixedRadixSmall::new(inner_fft_n1, inner_fft_n2); fft.process(&mut buffer); ``` -------------------------------- ### FftPlanner::plan_fft_forward Source: https://docs.rs/rustfft/6.4.1/rustfft/index.html The FftPlanner is the recommended way to perform FFTs. It automatically selects the best algorithm for a given size and enables SIMD optimizations if supported by the hardware. ```APIDOC ## FftPlanner::plan_fft_forward(size) ### Description Creates a plan for a forward FFT of the specified size. The planner automatically chooses the most efficient algorithm and initializes necessary buffers. ### Parameters - **size** (usize) - Required - The length of the FFT to perform. ### Example ```rust use rustfft::{FftPlanner, num_complex::Complex}; let mut planner = FftPlanner::new(); let fft = planner.plan_fft_forward(1234); let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 1234]; fft.process(&mut buffer); ``` ``` -------------------------------- ### FftPlannerScalar::new Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerScalar.html Creates a new instance of FftPlannerScalar. ```APIDOC ## pub fn new() -> Self ### Description Creates a new `FftPlannerScalar` instance. ``` -------------------------------- ### fn process(&self, buffer: &mut [Complex]) Source: https://docs.rs/rustfft/6.4.1/rustfft/trait.Fft.html Computes a Fast Fourier Transform (FFT) in-place on the provided buffer. This is a convenience method that automatically allocates the necessary scratch space. ```APIDOC ## fn process(&self, buffer: &mut [Complex]) ### Description Computes a FFT in-place. This is a convenience method that allocates a `Vec` with the required scratch space and performs the computation. ### Parameters - **buffer** (&mut [Complex]) - Required - The buffer containing the complex numbers to transform. ### Panics This method panics if: - `buffer.len() % self.len() > 0` - `buffer.len() < self.len()` ``` -------------------------------- ### FftPlannerAvx::new() Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerAvx.html Constructs a new FftPlannerAvx instance. Returns Ok if the current CPU supports AVX and FMA and the library was compiled with the avx feature flag, otherwise returns Err. ```APIDOC ### pub fn new() -> Result Constructs a new `FftPlannerAvx` instance. Returns `Ok(planner_instance)` if the environment supports AVX/FMA and the feature is enabled, otherwise returns `Err(())`. ``` -------------------------------- ### FftPlannerSse::plan_fft Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerSse.html Returns an FFT instance for a specified length and direction using SSE4.1 instructions. ```APIDOC ## pub fn plan_fft(&mut self, len: usize, direction: FftDirection) -> Arc> ### Description Returns an `Fft` instance configured to compute FFTs of size `len` using SSE4.1 instructions. The `direction` parameter determines whether to compute a forward or inverse FFT. ``` -------------------------------- ### RadersAlgorithm::new Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.RadersAlgorithm.html Creates a new instance of RadersAlgorithm. This constructor is computationally expensive as it performs an internal FFT calculation. ```APIDOC ## pub fn new(inner_fft: Arc>) -> Self ### Description Creates a FFT instance which will process inputs/outputs of size `inner_fft.len() + 1`. Note that this constructor is quite expensive to run as it must compute a FFT using `inner_fft` within the constructor. ### Parameters - **inner_fft** (Arc>) - Required - The inner FFT instance to use, which must have a length of N-1 where N is the desired prime size. ### Panics Panics if `inner_fft.len() + 1` is not a prime number. ``` -------------------------------- ### FftPlannerNeon::plan_fft Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerNeon.html Returns an FFT instance configured for a specific size and direction using Neon instructions. ```APIDOC ## pub fn plan_fft(&mut self, len: usize, direction: FftDirection) -> Arc> ### Description Returns a `Fft` instance which uses Neon instructions to compute FFTs of size `len`. If the provided `direction` is `FftDirection::Forward`, the returned instance will compute forward FFTs. If it’s `FftDirection::Inverse`, it will compute inverse FFTs. ``` -------------------------------- ### FftPlanner::plan_fft_forward() Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlanner.html Returns an FFT instance specifically for forward FFT computations. ```APIDOC ## pub fn plan_fft_forward(&mut self, len: usize) -> Arc> ### Description Returns a `Fft` instance which computes forward FFTs of size `len`. The planner attempts to re-use internal data between calls to reduce memory usage and initialization time. ``` -------------------------------- ### FftPlannerNeon::plan_fft_forward Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerNeon.html Returns an FFT instance configured for forward FFTs of a specific size using Neon instructions. ```APIDOC ## pub fn plan_fft_forward(&mut self, len: usize) -> Arc> ### Description Returns a `Fft` instance which uses Neon instructions to compute forward FFTs of size `len`. ``` -------------------------------- ### FftPlanner::plan_fft() Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlanner.html Returns an FFT instance for a specified length and direction. Reusing the planner for multiple calls allows for internal data reuse. ```APIDOC ## pub fn plan_fft(&mut self, len: usize, direction: FftDirection) -> Arc> ### Description Returns a `Fft` instance which computes FFTs of size `len`. If the provided `direction` is `FftDirection::Forward`, the returned instance will compute forward FFTs; if `FftDirection::Inverse`, it will compute inverse FFTs. ``` -------------------------------- ### FftPlannerAvx::plan_fft() Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerAvx.html Returns an FFT instance configured for the specified length and direction using AVX instructions. ```APIDOC ### pub fn plan_fft(&mut self, len: usize, direction: FftDirection) -> Arc> Returns an `Fft` instance that uses AVX instructions to compute FFTs of size `len` in the specified `direction` (Forward or Inverse). ``` -------------------------------- ### GoodThomasAlgorithmSmall::new Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.GoodThomasAlgorithmSmall.html Creates a new instance of GoodThomasAlgorithmSmall. The total FFT size is the product of the lengths of the provided width_fft and height_fft, which must be coprime. ```APIDOC ## pub fn new(width_fft: Arc>, height_fft: Arc>) -> Self ### Description Creates a FFT instance which will process inputs/outputs of size `width_fft.len() * height_fft.len()`. Note that `GCD(width_fft.len(), height_fft.len())` must be equal to 1. ``` -------------------------------- ### FftPlannerAvx::plan_fft_forward() Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerAvx.html Returns an FFT instance configured for forward FFTs of the specified length using AVX instructions. ```APIDOC ### pub fn plan_fft_forward(&mut self, len: usize) -> Arc> Returns an `Fft` instance optimized for forward FFTs of size `len` using AVX instructions. ``` -------------------------------- ### Fft Trait Methods Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.GoodThomasAlgorithmSmall.html Methods for performing FFT computations and querying scratch buffer requirements. ```APIDOC ## Fft Trait Methods ### process_immutable_with_scratch(&self, input: &[Complex], output: &mut [Complex], scratch: &mut [Complex]) Computes a FFT on chunks of size `self.len()` while keeping the input buffer untouched. ### process_outofplace_with_scratch(&self, input: &mut [Complex], output: &mut [Complex], scratch: &mut [Complex]) Computes a FFT on chunks of size `self.len()` using separate input and output buffers. ### process_with_scratch(&self, buffer: &mut [Complex], scratch: &mut [Complex]) Computes a FFT in-place on chunks of size `self.len()`. ### get_inplace_scratch_len(&self) -> usize Returns the required size of the scratch buffer for in-place processing. ### get_outofplace_scratch_len(&self) -> usize Returns the required size of the scratch buffer for out-of-place processing. ### get_immutable_scratch_len(&self) -> usize Returns the required size of the scratch buffer for immutable processing. ### process(&self, buffer: &mut [Complex]) Computes a FFT in-place. ``` -------------------------------- ### FftPlannerNeon::plan_fft_inverse Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerNeon.html Returns an FFT instance configured for inverse FFTs of a specific size using Neon instructions. ```APIDOC ## pub fn plan_fft_inverse(&mut self, len: usize) -> Arc> ### Description Returns a `Fft` instance which uses Neon instructions to compute inverse FFTs of size `len`. ``` -------------------------------- ### FftPlanner::plan_fft_inverse() Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlanner.html Returns an FFT instance specifically for inverse FFT computations. ```APIDOC ## pub fn plan_fft_inverse(&mut self, len: usize) -> Arc> ### Description Returns a `Fft` instance which computes inverse FFTs of size `len`. The planner attempts to re-use internal data between calls to reduce memory usage and initialization time. ``` -------------------------------- ### Radix4::new Source: https://docs.rs/rustfft/6.4.1/rustfft/index.html Advanced users can bypass the planner to use specific FFT algorithms directly, though this disables automatic SIMD optimizations. ```APIDOC ## Radix4::new(size, direction) ### Description Directly instantiates a Radix4 FFT algorithm instance. This is useful for specific performance requirements when the FFT size is known. ### Parameters - **size** (usize) - Required - The length of the FFT. - **direction** (FftDirection) - Required - The direction of the FFT (Forward or Inverse). ### Example ```rust use rustfft::{Fft, FftDirection, num_complex::Complex, algorithm::Radix4}; let fft = Radix4::new(4096, FftDirection::Forward); let mut buffer = vec![Complex{ re: 0.0f32, im: 0.0f32 }; 4096]; fft.process(&mut buffer); ``` ``` -------------------------------- ### FftPlannerAvx::plan_fft_inverse() Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerAvx.html Returns an FFT instance configured for inverse FFTs of the specified length using AVX instructions. ```APIDOC ### pub fn plan_fft_inverse(&mut self, len: usize) -> Arc> Returns an `Fft` instance optimized for inverse FFTs of size `len` using AVX instructions. ``` -------------------------------- ### FftPlannerSse::plan_fft_forward Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerSse.html Returns an FFT instance for computing forward FFTs of a specified length. ```APIDOC ## pub fn plan_fft_forward(&mut self, len: usize) -> Arc> ### Description Returns an `Fft` instance that uses SSE4.1 instructions to compute forward FFTs of size `len`. ``` -------------------------------- ### Radix4::new Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Radix4.html Constructs a new Radix4 instance for a specified length and direction. ```APIDOC ## Radix4::new(len: usize, direction: FftDirection) -> Self ### Description Preallocates necessary arrays and precomputes data to efficiently compute a power-of-two FFT. ### Parameters - **len** (usize) - The size of the FFT to compute. - **direction** (FftDirection) - The direction of the FFT (Forward or Inverse). ``` -------------------------------- ### Butterfly23::new Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly23.html Creates a new instance of the Butterfly23 FFT algorithm with the specified direction. ```APIDOC ## pub fn new(direction: FftDirection) -> Self ### Description Creates a new instance of the Butterfly23 algorithm configured for either forward or inverse FFT operations. ### Parameters - **direction** (FftDirection) - Required - The direction of the FFT (Forward or Inverse). ``` -------------------------------- ### Butterfly4::new Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly4.html Creates a new instance of the Butterfly4 algorithm for the specified FFT direction. ```APIDOC ## Butterfly4::new ### Description Creates a new instance of the Butterfly4 algorithm, configured to perform either forward or inverse FFTs based on the provided direction. ### Signature `pub fn new(direction: FftDirection) -> Self` ``` -------------------------------- ### Dft::process Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Dft.html Computes a FFT in-place on the provided buffer. ```APIDOC ## pub fn process(&self, buffer: &mut [Complex]) ### Description Computes the FFT in-place on the provided buffer of complex numbers. ### Parameters - **buffer** (&mut [Complex]) - The data buffer to process. ``` -------------------------------- ### FftPlannerWasmSimd::plan_fft_forward Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerWasmSimd.html Returns an FFT instance configured for forward FFTs of a specific size using WASM SIMD instructions. ```APIDOC ### pub fn plan_fft_forward(&mut self, len: usize) -> Arc> Returns a `Fft` instance which uses WebAssembly SIMD instructions to compute forward FFTs of size `len`. ``` -------------------------------- ### FftPlannerWasmSimd::plan_fft Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerWasmSimd.html Returns an FFT instance configured for a specific size and direction using WASM SIMD instructions. ```APIDOC ### pub fn plan_fft(&mut self, len: usize, direction: FftDirection) -> Arc> Returns a `Fft` instance which uses WebAssembly SIMD instructions to compute FFTs of size `len`. If the provided `direction` is `FftDirection::Forward`, the returned instance will compute forward FFTs. If it’s `FftDirection::Inverse`, it will compute inverse FFTs. ``` -------------------------------- ### FftPlannerSse::plan_fft_inverse Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerSse.html Returns an FFT instance for computing inverse FFTs of a specified length. ```APIDOC ## pub fn plan_fft_inverse(&mut self, len: usize) -> Arc> ### Description Returns an `Fft` instance that uses SSE4.1 instructions to compute inverse FFTs of size `len`. ``` -------------------------------- ### Dft::new Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Dft.html Creates a new instance of the Dft struct with a specified length and direction. ```APIDOC ## pub fn new(len: usize, direction: FftDirection) -> Self ### Description Preallocates necessary arrays and precomputes data to efficiently compute a Discrete Fourier Transform of the specified length. ### Parameters - **len** (usize) - The size of the DFT. - **direction** (FftDirection) - The direction of the transform (Forward or Inverse). ``` -------------------------------- ### FftPlannerScalar::plan_fft_forward Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerScalar.html Returns an FFT instance for computing forward FFTs. ```APIDOC ## pub fn plan_fft_forward(&mut self, len: usize) -> Arc> ### Description Returns a `Fft` instance which computes forward FFTs of size `len`. ``` -------------------------------- ### Radix4::process Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Radix4.html Computes an in-place FFT on the provided buffer. ```APIDOC ## Radix4::process(&self, buffer: &mut [Complex]) ### Description Computes a Fast Fourier Transform in-place on the provided buffer. ### Parameters - **buffer** (&mut [Complex]) - The data buffer to process. ``` -------------------------------- ### MixedRadix::new Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.MixedRadix.html Creates a new FFT instance that processes inputs and outputs of size width_fft.len() * height_fft.len(). ```APIDOC ## MixedRadix::new ### Description Creates a new FFT instance which will process inputs/outputs of size `width_fft.len() * height_fft.len()`. ### Signature `pub fn new(width_fft: Arc>, height_fft: Arc>) -> Self` ``` -------------------------------- ### MixedRadixSmall::new Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.MixedRadixSmall.html Creates a new instance of the MixedRadixSmall FFT algorithm, which processes inputs and outputs of size width_fft.len() * height_fft.len(). ```APIDOC ## pub fn new(width_fft: Arc>, height_fft: Arc>) -> Self ### Description Creates a FFT instance which will process inputs/outputs of size `width_fft.len() * height_fft.len()`. ### Parameters - **width_fft** (Arc>) - Required - The first inner FFT instance. - **height_fft** (Arc>) - Required - The second inner FFT instance. ``` -------------------------------- ### GoodThomasAlgorithm Structure Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.GoodThomasAlgorithm.html The internal structure definition for the GoodThomasAlgorithm. ```rust pub struct GoodThomasAlgorithm { /* private fields */ } ``` -------------------------------- ### Define FftPlanner struct Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlanner.html The definition of the FftPlanner struct. ```rust pub struct FftPlanner { /* private fields */ } ``` -------------------------------- ### FftPlannerWasmSimd::plan_fft_inverse Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerWasmSimd.html Returns an FFT instance configured for inverse FFTs of a specific size using WASM SIMD instructions. ```APIDOC ### pub fn plan_fft_inverse(&mut self, len: usize) -> Arc> Returns a `Fft` instance which uses WebAssembly SIMD instructions to compute inverse FFTs of size `len`. ``` -------------------------------- ### MixedRadixSmall::process Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.MixedRadixSmall.html Computes a Fast Fourier Transform (FFT) in-place on the provided buffer. ```APIDOC ## pub fn process(&self, buffer: &mut [Complex]) ### Description Computes a FFT in-place on the provided buffer. ### Parameters - **buffer** (&mut [Complex]) - Required - The data buffer to process. ``` -------------------------------- ### FftPlannerScalar::plan_fft_inverse Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerScalar.html Returns an FFT instance for computing inverse FFTs. ```APIDOC ## pub fn plan_fft_inverse(&mut self, len: usize) -> Arc> ### Description Returns a `Fft` instance which computes inverse FFTs of size `len`. ``` -------------------------------- ### FftPlannerScalar::plan_fft Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerScalar.html Returns an FFT instance for a specified length and direction. ```APIDOC ## pub fn plan_fft(&mut self, len: usize, direction: FftDirection) -> Arc> ### Description Returns a `Fft` instance which computes FFTs of size `len`. If `direction` is `FftDirection::Forward`, it computes forward FFTs; if `FftDirection::Inverse`, it computes inverse FFTs. ``` -------------------------------- ### Define FftPlannerSse struct Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerSse.html The definition of the FftPlannerSse struct. ```rust pub struct FftPlannerSse { /* private fields */ } ``` -------------------------------- ### MixedRadix::process Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.MixedRadix.html Computes a FFT in-place on the provided buffer. ```APIDOC ## MixedRadix::process ### Description Computes a FFT in-place on the provided buffer. ### Signature `fn process(&self, buffer: &mut [Complex])` ``` -------------------------------- ### Define Butterfly13 struct Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly13.html The structure definition for the Butterfly13 algorithm. ```rust pub struct Butterfly13 { /* private fields */ } ``` -------------------------------- ### Define FftPlannerAvx struct Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerAvx.html The definition of the FftPlannerAvx struct. ```rust pub struct FftPlannerAvx { /* private fields */ } ``` -------------------------------- ### Butterfly23 FFT Processing Methods Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly23.html Methods for performing FFT computations using the Butterfly23 algorithm. ```APIDOC ## FFT Processing Methods ### process(buffer: &mut [Complex]) Computes an in-place FFT on the provided buffer. ### process_with_scratch(buffer: &mut [Complex], _scratch: &mut [Complex]) Divides the buffer into chunks of size self.len() and computes an FFT on each chunk using a scratch buffer. ### process_outofplace_with_scratch(input: &mut [Complex], output: &mut [Complex], _scratch: &mut [Complex]) Computes an out-of-place FFT, dividing input and output into chunks of size self.len(). ### process_immutable_with_scratch(input: &[Complex], output: &mut [Complex], _scratch: &mut [Complex]) Computes an FFT on chunks of the input while keeping the original input buffer untouched. ``` -------------------------------- ### Length and Direction Traits Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.GoodThomasAlgorithmSmall.html Utility methods to retrieve the FFT size and the processing direction. ```APIDOC ## Trait Methods ### len(&self) -> usize Returns the FFT size that this algorithm can process. ### fft_direction(&self) -> FftDirection Returns `FftDirection::Forward` if this instance computes forward FFTs, or `FftDirection::Inverse` for inverse FFTs. ``` -------------------------------- ### Define FftPlannerWasmSimd struct Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerWasmSimd.html The definition of the FftPlannerWasmSimd struct. ```rust pub struct FftPlannerWasmSimd { /* private fields */ } ``` -------------------------------- ### Define FftPlannerNeon struct Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerNeon.html The definition of the FftPlannerNeon struct. ```rust pub struct FftPlannerNeon { /* private fields */ } ``` -------------------------------- ### Define Radix3 struct Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Radix3.html The internal structure definition for the Radix3 algorithm. ```rust pub struct Radix3 { /* private fields */ } ``` -------------------------------- ### GoodThomasAlgorithmSmall Struct Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.GoodThomasAlgorithmSmall.html The internal structure definition for GoodThomasAlgorithmSmall. ```rust pub struct GoodThomasAlgorithmSmall { /* private fields */ } ``` -------------------------------- ### Fft Trait Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/trait.Fft.html The core trait definition for FFT algorithms, requiring implementation of processing methods and scratch buffer size queries. ```rust pub trait Fft: Length + Direction + Sync + Send { // Required methods fn process_with_scratch( &self, buffer: &mut [Complex], scratch: &mut [Complex], ); fn process_outofplace_with_scratch( &self, input: &mut [Complex], output: &mut [Complex], scratch: &mut [Complex], ); fn process_immutable_with_scratch( &self, input: &[Complex], output: &mut [Complex], scratch: &mut [Complex], ); fn get_inplace_scratch_len(&self) -> usize; fn get_outofplace_scratch_len(&self) -> usize; fn get_immutable_scratch_len(&self) -> usize; // Provided method fn process(&self, buffer: &mut [Complex]) { ... } } ``` -------------------------------- ### Radix4 Struct Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Radix4.html The internal structure definition for the Radix4 algorithm. ```rust pub struct Radix4 { /* private fields */ } ``` -------------------------------- ### Dft struct definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Dft.html The definition of the Dft struct. ```rust pub struct Dft { /* private fields */ } ``` -------------------------------- ### Butterfly17 Struct Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly17.html The internal structure definition for the Butterfly17 algorithm. ```rust pub struct Butterfly17 { /* private fields */ } ``` -------------------------------- ### Dft::len Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.Dft.html Returns the FFT size that this algorithm instance is configured to process. ```APIDOC ## pub fn len(&self) -> usize ### Description Returns the FFT size that this algorithm can process. ``` -------------------------------- ### Define the Length trait Source: https://docs.rs/rustfft/6.4.1/rustfft/trait.Length.html The trait requires implementing the len method to return the FFT size as a usize. ```rust pub trait Length { // Required method fn len(&self) -> usize; } ``` -------------------------------- ### Butterfly12 struct definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly12.html The definition of the Butterfly12 struct. ```rust pub struct Butterfly12 { /* private fields */ } ``` -------------------------------- ### Butterfly24 Struct Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly24.html The definition of the Butterfly24 struct. ```rust pub struct Butterfly24 { /* private fields */ } ``` -------------------------------- ### FftNum Implementor Blanket Implementation Source: https://docs.rs/rustfft/6.4.1/rustfft/trait.FftNum.html The blanket implementation for any type T that satisfies the trait bounds. ```rust impl FftNum for T where T: Copy + FromPrimitive + Signed + Sync + Send + Debug + 'static, ``` -------------------------------- ### Define Butterfly7 struct Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly7.html The definition of the Butterfly7 struct with private fields. ```rust pub struct Butterfly7 { /* private fields */ } ``` -------------------------------- ### Butterfly1 struct definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly1.html The definition of the Butterfly1 struct. ```rust pub struct Butterfly1 { /* private fields */ } ``` -------------------------------- ### Define Butterfly29 struct Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly29.html The definition of the Butterfly29 struct. ```rust pub struct Butterfly29 { /* private fields */ } ``` -------------------------------- ### Define MixedRadix struct Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.MixedRadix.html The internal structure definition for the MixedRadix algorithm. ```rust pub struct MixedRadix { /* private fields */ } ``` -------------------------------- ### FftPlannerScalar struct definition Source: https://docs.rs/rustfft/6.4.1/rustfft/struct.FftPlannerScalar.html The definition of the FftPlannerScalar struct. ```rust pub struct FftPlannerScalar { /* private fields */ } ``` -------------------------------- ### Butterfly27 Struct Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly27.html The definition of the Butterfly27 struct. ```rust pub struct Butterfly27 { /* private fields */ } ``` -------------------------------- ### opposite_direction Source: https://docs.rs/rustfft/6.4.1/rustfft/enum.FftDirection.html Returns the opposite direction of the current FftDirection instance. If the current direction is Forward, it returns Inverse, and vice versa. ```APIDOC ## pub fn opposite_direction(&self) -> FftDirection ### Description Returns the opposite direction of the current `FftDirection` instance. ### Signature `pub fn opposite_direction(&self) -> FftDirection` ### Returns - **FftDirection** - The opposite direction (Forward becomes Inverse, Inverse becomes Forward). ``` -------------------------------- ### Define the Direction trait Source: https://docs.rs/rustfft/6.4.1/rustfft/trait.Direction.html The trait requires implementation of the fft_direction method to return the current FftDirection. ```rust pub trait Direction { // Required method fn fft_direction(&self) -> FftDirection; } ``` -------------------------------- ### Butterfly19 Struct Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly19.html The definition of the Butterfly19 struct. ```rust pub struct Butterfly19 { /* private fields */ } ``` -------------------------------- ### Butterfly23 Struct Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly23.html The definition of the Butterfly23 struct. ```rust pub struct Butterfly23 { /* private fields */ } ``` -------------------------------- ### FftNum Trait Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/trait.FftNum.html The trait definition specifying the required supertraits for any type implementing FftNum. ```rust pub trait FftNum: Copy + FromPrimitive + Signed + Sync + Send + Debug + 'static { } ``` -------------------------------- ### MixedRadix::len Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/struct.MixedRadix.html Returns the FFT size that this algorithm can process. ```APIDOC ## MixedRadix::len ### Description Returns the FFT size that this algorithm can process. ### Signature `fn len(&self) -> usize` ``` -------------------------------- ### Butterfly8 Struct Definition Source: https://docs.rs/rustfft/6.4.1/rustfft/algorithm/butterflies/struct.Butterfly8.html The definition of the Butterfly8 struct, which is generic over type T. ```rust pub struct Butterfly8 { /* private fields */ } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.