pub struct WgslFftPlan { /* private fields */ }Expand description
A host-side plan for a power-of-two radix-2 Cooley-Tukey FFT of length n.
Precomputes the bit-reversal permutation and the twiddle-factor table so the WGSL kernel can be a pure butterfly with no transcendental calls.
Implementations§
Source§impl WgslFftPlan
impl WgslFftPlan
Sourcepub fn new(n: u32, direction: FftDirection) -> Result<Self, String>
pub fn new(n: u32, direction: FftDirection) -> Result<Self, String>
Build a plan for transform length n (must be a power of two >= 1).
§Errors
Returns an error string if n is zero or not a power of two.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the transform length is zero (always false for a built plan).
Sourcepub fn num_stages(&self) -> u32
pub fn num_stages(&self) -> u32
Number of FFT stages, log2(n).
Sourcepub fn direction(&self) -> FftDirection
pub fn direction(&self) -> FftDirection
Transform direction.
Sourcepub fn bit_reversal(&self) -> &[u32]
pub fn bit_reversal(&self) -> &[u32]
The bit-reversal permutation: bit_reversal()[i] is the source index
that lands at position i after the reorder.
Sourcepub fn inverse_scale(&self) -> f32
pub fn inverse_scale(&self) -> f32
The normalisation scale the host applies after an inverse transform
(1/n for FftDirection::Inverse, 1.0 for forward).
Sourcepub fn stage_half_size(&self, stage: u32) -> u32
pub fn stage_half_size(&self, stage: u32) -> u32
The half_size (m/2) uniform value for stage stage (0-based).
Stage s operates on butterfly groups of size m = 2^(s+1); its half
size is 2^s. Returns 0 if stage >= num_stages.
Trait Implementations§
Source§impl Clone for WgslFftPlan
impl Clone for WgslFftPlan
Source§fn clone(&self) -> WgslFftPlan
fn clone(&self) -> WgslFftPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more