Expand description
Real FFT planner with trait object support
This module provides trait object interfaces for real-to-complex and complex-to-real FFT operations, matching the API patterns used by realfft crate for easier migration.
§Features
RealToComplex
trait for forward real-to-complex FFT operationsComplexToReal
trait for inverse complex-to-real FFT operationsRealFftPlanner
for creating and caching FFT plans- Support for both f32 and f64 precision
- Thread-safe plan caching with Arc
§Examples
use scirs2_fft::real_planner::{RealFftPlanner, RealToComplex, ComplexToReal};
use std::sync::Arc;
// Create a planner
let mut planner = RealFftPlanner::<f64>::new();
// Plan forward FFT
let forward_fft = planner.plan_fft_forward(1024);
// Plan inverse FFT
let inverse_fft = planner.plan_fft_inverse(1024);
// Use in struct (common VoiRS pattern)
struct AudioProcessor {
forward: Arc<dyn RealToComplex<f64>>,
backward: Arc<dyn ComplexToReal<f64>>,
}
Structs§
- Real
FftPlanner - Real FFT planner for creating and managing FFT plans
Traits§
- Complex
ToReal - Trait for complex-to-real FFT operations
- Real
ToComplex - Trait for real-to-complex FFT operations