Struct Real FftPlan
pub struct RealFftPlan { /* private fields */ }Expand description
Prepared real f64 transform with N/2+1 positive-frequency complex bins, DC first and Nyquist last (N=1 has only DC). N is power-of-two 1..=1048576. Internally uses the full complex FFT and N complex scratch values: this is a convenient half-spectrum API, not an optimized real-only algorithm. Construction allocates; forward/inverse reuse storage without heap work. No windowing, SIMD, nonfinite sanitization or native deadline is implicit.
Implementations§
§impl RealFftPlan
impl RealFftPlan
pub fn new(size: usize) -> Result<Self, RealFftError>
pub fn size(&self) -> usize
pub fn bins(&self) -> usize
pub fn forward(
&mut self,
input: &[f64],
output: &mut [Complex],
) -> Result<(), RealFftError>
pub fn forward( &mut self, input: &[f64], output: &mut [Complex], ) -> Result<(), RealFftError>
Unnormalized exp(-i*w). Endpoints’ imaginary components are explicitly zeroed, including nonfinite input. Other nonfinite values propagate.
pub fn inverse(
&mut self,
input: &[Complex],
output: &mut [f64],
) -> Result<(), RealFftError>
pub fn inverse( &mut self, input: &[Complex], output: &mut [f64], ) -> Result<(), RealFftError>
Reconstruct negative bins by conjugation, then exp(+i*w)/N. Requires exact zero imaginary endpoints (including rejecting NaN/Inf there); nonfinite real endpoints/interior bins propagate. Rejects before output mutation. Caller supplies N real output samples.
Trait Implementations§
§impl Clone for RealFftPlan
impl Clone for RealFftPlan
§fn clone(&self) -> RealFftPlan
fn clone(&self) -> RealFftPlan
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more