Skip to main content

ComplexFft

Struct ComplexFft 

Source
pub struct ComplexFft<T: Transcendental> { /* private fields */ }
Expand description

Radix-2 Decimation-In-Time (DIT) complex FFT.

Supports sizes that are powers of two. All scratch buffers are pre-allocated at construction time — process() performs zero heap allocations.

Implementations§

Source§

impl<T: Transcendental> ComplexFft<T>

Source

pub fn new(size: usize) -> Self

Create a new complex FFT for the given size.

§Panics

Panics if size is not a power of two.

Source

pub fn size(&self) -> usize

Returns the FFT size.

Source

pub fn forward(&self, data: &mut [Complex<T>])

Forward complex FFT — interleaved Complex<T> API.

§Panics

Panics if data.len() != self.size().

Source

pub fn inverse(&self, data: &mut [Complex<T>])

Inverse complex FFT — interleaved Complex<T> API.

Result is scaled by 1/N.

§Panics

Panics if data.len() != self.size().

Source

pub fn forward_soa(&self, re: &mut [T], im: &mut [T])

Forward complex FFT — SoA (Structure of Arrays) API.

Operates on separate real and imaginary arrays. Both must have length self.size(). Zero heap allocations in the process path.

With the simd feature, f32/f64 variants use hardware SIMD via F32x4/F64x2 for the butterfly arithmetic.

Source

pub fn inverse_soa(&self, re: &mut [T], im: &mut [T])

Inverse complex FFT — SoA API.

Result is scaled by 1/N.

Auto Trait Implementations§

§

impl<T> Freeze for ComplexFft<T>

§

impl<T> RefUnwindSafe for ComplexFft<T>
where T: RefUnwindSafe,

§

impl<T> Send for ComplexFft<T>

§

impl<T> Sync for ComplexFft<T>

§

impl<T> Unpin for ComplexFft<T>

§

impl<T> UnsafeUnpin for ComplexFft<T>

§

impl<T> UnwindSafe for ComplexFft<T>
where T: UnwindSafe,

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> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert to &dyn std::any::Any
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert to &mut dyn std::any::Any
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V