PsdStage

Trait PsdStage 

Source
pub trait PsdStage {
    // Required methods
    fn process<'a>(&mut self, x: &[f32], y: &'a mut [f32]) -> &'a mut [f32];
    fn spectrum(&self) -> &[f32];
    fn gain(&self) -> f32;
    fn count(&self) -> u32;
    fn buf(&self) -> &[f32];
}

Required Methods§

Source

fn process<'a>(&mut self, x: &[f32], y: &'a mut [f32]) -> &'a mut [f32]

Process items

Unused items are buffered. Full FFT blocks are processed. Overlap is kept. Decimation is performed on fully processed input items.

Note: When feeding more than ~N*1e6 items expect loss of accuracy due to rounding errors on accumulation.

Note: Also be aware of the usual accuracy limitation of the item data type

§Args
  • x: input items
  • y: output items
§Returns

number if items written to y

Source

fn spectrum(&self) -> &[f32]

Return the positive frequency half of the spectrum

Source

fn gain(&self) -> f32

PSD normalization factor

one-sided

Source

fn count(&self) -> u32

Number of averages

Source

fn buf(&self) -> &[f32]

Currently buffered input items

Implementors§

Source§

impl<const N: usize> PsdStage for Psd<N>