Skip to main content

R2cPlan

Trait R2cPlan 

Source
pub trait R2cPlan<T = f64> {
    // Required methods
    fn n_fft(&self) -> usize;
    fn output_len(&self) -> usize;
    fn process(
        &mut self,
        input: &[T],
        output: &mut [Complex<T>],
    ) -> 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: &[T], output: &mut [Complex<T>], ) -> 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§