Skip to main content

EmbFft

Struct EmbFft 

Source
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>

Source

pub fn new(data: &'a mut [(T, T); N]) -> Self

Initializes a new FFT conversion

Use this function whenever a new conversion is required.

Source

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
}
Source

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();
Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.