pub struct BatchedRealFftProcessor { /* private fields */ }Expand description
Batched wrapper around realfft for independent real FFTs that share the
same FFT size.
Buffers are stored flat in channel-major order:
time_buffers:[channel][sample]freq_buffers:[channel][bin]
This keeps each channel contiguous for realfft, avoids one allocation per
channel, and reuses the same FFT plans and scratch buffers across all
channels. The FFTs are still computed sequentially; this type is a portable
baseline rather than a platform-specific batched FFT backend.
Implementations§
Source§impl BatchedRealFftProcessor
impl BatchedRealFftProcessor
Sourcepub fn new_forward_only(channels: usize, fft_size: usize) -> Self
pub fn new_forward_only(channels: usize, fft_size: usize) -> Self
Create a forward-only batched FFT processor.
Sourcepub fn new_bidirectional(channels: usize, fft_size: usize) -> Self
pub fn new_bidirectional(channels: usize, fft_size: usize) -> Self
Create a bidirectional batched FFT processor.
pub fn channels(&self) -> usize
pub fn fft_size(&self) -> usize
pub fn spectrum_size(&self) -> usize
pub fn time_buffers(&self) -> &[f32]
pub fn time_buffers_mut(&mut self) -> &mut [f32]
pub fn freq_buffers(&self) -> &[Complex<f32>]
pub fn freq_buffers_mut(&mut self) -> &mut [Complex<f32>]
pub fn time_channel(&self, ch: usize) -> &[f32]
pub fn time_channel_mut(&mut self, ch: usize) -> &mut [f32]
pub fn freq_channel(&self, ch: usize) -> &[Complex<f32>]
pub fn freq_channel_mut(&mut self, ch: usize) -> &mut [Complex<f32>]
Sourcepub fn forward_all(&mut self)
pub fn forward_all(&mut self)
Perform forward FFTs for all channels. The caller should fill each time-domain channel buffer before calling this.
Sourcepub fn inverse_all(&mut self)
pub fn inverse_all(&mut self)
Perform inverse FFTs for all channels.
Panics if this processor was created with new_forward_only.
Auto Trait Implementations§
impl Freeze for BatchedRealFftProcessor
impl !RefUnwindSafe for BatchedRealFftProcessor
impl Send for BatchedRealFftProcessor
impl Sync for BatchedRealFftProcessor
impl Unpin for BatchedRealFftProcessor
impl UnsafeUnpin for BatchedRealFftProcessor
impl !UnwindSafe for BatchedRealFftProcessor
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.