Skip to main content

R2cPlan

Trait R2cPlan 

Source
pub trait R2cPlan {
    // Required methods
    fn n_fft(&self) -> usize;
    fn output_len(&self) -> usize;
    fn process(
        &mut self,
        input: &[f64],
        output: &mut [Complex<f64>],
    ) -> SpectrogramResult<()>;
}
Expand description

A planned real-to-complex FFT for a fixed transform length.

Plans must:

  • own any internal scratch buffers
  • be reusable across many calls
  • perform no heap allocation during process

Required Methods§

Source

fn n_fft(&self) -> usize

Source

fn output_len(&self) -> usize

Source

fn process( &mut self, input: &[f64], output: &mut [Complex<f64>], ) -> SpectrogramResult<()>

Process real input to complex output.

§Arguments
  • input - Real time domain input
  • output - Complex frequency domain output
§Returns

Ok(()) if successful, or SpectrogramError if dimensions are invalid.

§Errors

Returns SpectrogramError::dimension_mismatch if input or output lengths do not match expected sizes.

Implementors§