Module real_planner

Module real_planner 

Source
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 operations
  • ComplexToReal trait for inverse complex-to-real FFT operations
  • RealFftPlanner 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§

RealFftPlanner
Real FFT planner for creating and managing FFT plans

Traits§

ComplexToReal
Trait for complex-to-real FFT operations
RealToComplex
Trait for real-to-complex FFT operations