pub struct Fft {
pub n: usize,
pub window: Vec<f32>,
pub mag_scale: f32,
/* private fields */
}Expand description
A planned forward/inverse real FFT pair with scratch buffers.
Fields§
§n: usize§window: Vec<f32>§mag_scale: f32Scale that maps |X| to the dBFS-sine magnitude scale.
Implementations§
Source§impl Fft
impl Fft
pub fn new(n: usize) -> Fft
pub fn bins(&self) -> usize
Sourcepub fn forward(&mut self, frame: &[f32], spec: &mut [Complex32])
pub fn forward(&mut self, frame: &[f32], spec: &mut [Complex32])
Window frame (length n) and transform it into spec (length n/2+1).
Sourcepub fn forward_split(&mut self, a: &[f32], b: &[f32], spec: &mut [Complex32])
pub fn forward_split(&mut self, a: &[f32], b: &[f32], spec: &mut [Complex32])
Forward transform of a frame given as two pieces (ring-buffer order).
Sourcepub fn inverse_windowed(&mut self, spec: &mut [Complex32]) -> &[f32]
pub fn inverse_windowed(&mut self, spec: &mut [Complex32]) -> &[f32]
Inverse transform spec (modified in place as scratch) and return the windowed,
overlap-add normalized time frame. Summing these at hop n/4 reconstructs the input.
Auto Trait Implementations§
impl !RefUnwindSafe for Fft
impl !UnwindSafe for Fft
impl Freeze for Fft
impl Send for Fft
impl Sync for Fft
impl Unpin for Fft
impl UnsafeUnpin for Fft
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more