pub struct EmbFft<'a, T, const N: usize> { /* private fields */ }Expand description
Decimation in frequency fast Fourier transform
This structure contains a reference to the input / output data, as well as information related to the internal state.
Implementations§
Source§impl<'a, T: Float<N>, const N: usize> EmbFft<'a, T, N>
impl<'a, T: Float<N>, const N: usize> EmbFft<'a, T, N>
Sourcepub fn new(data: &'a mut [(T, T); N]) -> Self
pub fn new(data: &'a mut [(T, T); N]) -> Self
Initializes a new FFT conversion
Use this function whenever a new conversion is required.
Sourcepub fn fft_iterate(&mut self)
pub fn fft_iterate(&mut self)
Non-blocking FFT computation
Use this together with the EmbFft::is_done() function.
For example:
let mut data = [
(1.0f32, 1.0), (2.0, 2.0),
(3.0f32, 3.0), (4.0, 4.0),
(5.0f32, 5.0), (6.0, 6.0),
(7.0f32, 7.0), (8.0, 8.0)
];
let mut fft = embfft::EmbFft::new(&mut data);
while !fft.is_done() {
fft.fft_iterate();
// Other actions can be performed here between two iterations
}Sourcepub fn fft(&mut self)
pub fn fft(&mut self)
Blocking FFT computation
For example:
let mut data = [
(1.0f32, 1.0), (2.0, 2.0),
(3.0f32, 3.0), (4.0, 4.0),
(5.0f32, 5.0), (6.0, 6.0),
(7.0f32, 7.0), (8.0, 8.0)
];
embfft::EmbFft::new(&mut data).fft();Sourcepub fn is_done(&self) -> bool
pub fn is_done(&self) -> bool
Checks if the conversion is complete
Use this together with the EmbFft::fft_iterate() function.
Auto Trait Implementations§
impl<'a, T, const N: usize> Freeze for EmbFft<'a, T, N>
impl<'a, T, const N: usize> RefUnwindSafe for EmbFft<'a, T, N>where
T: RefUnwindSafe,
impl<'a, T, const N: usize> Send for EmbFft<'a, T, N>where
T: Send,
impl<'a, T, const N: usize> Sync for EmbFft<'a, T, N>where
T: Sync,
impl<'a, T, const N: usize> Unpin for EmbFft<'a, T, N>
impl<'a, T, const N: usize> UnsafeUnpin for EmbFft<'a, T, N>
impl<'a, T, const N: usize> !UnwindSafe for EmbFft<'a, T, N>
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