Skip to main content

BluesteinsAvx

Struct BluesteinsAvx 

Source
pub struct BluesteinsAvx<A: AvxNum, T> {
    inner_fft_multiplier: Box<[A::VectorType]>,
    common_data: CommonSimdData<T, A::VectorType>,
    _phantom: PhantomData<T>,
}
Expand description

Implementation of Bluestein’s Algorithm

This algorithm computes an arbitrary-sized FFT in O(nlogn) time. It does this by converting this size n FFT into a size M where M >= 2N - 1. The most obvious choice for M is a power of two, although that isn’t a requirement.

It requires a large scratch space, so it’s probably inconvenient to use as an inner FFT to other algorithms.

Bluestein’s Algorithm is relatively expensive compared to other FFT algorithms. Benchmarking shows that it is up to an order of magnitude slower than similar composite sizes.

Fields§

§inner_fft_multiplier: Box<[A::VectorType]>§common_data: CommonSimdData<T, A::VectorType>§_phantom: PhantomData<T>

Implementations§

Source§

impl<A: AvxNum, T: FftNum> BluesteinsAvx<A, T>

Source

unsafe fn mul_complex_conjugated<V: AvxVector>(left: V, right: V) -> V

Pairwise multiply the complex numbers in left with the complex numbers in right. This is exactly the same as mul_complex in AvxVector, but this implementation also conjugates the left input before multiplying

Source

pub fn new(len: usize, inner_fft: Arc<dyn Fft<T>>) -> Result<Self, ()>

Preallocates necessary arrays and precomputes necessary data to efficiently compute the FFT Returns Ok() if this machine has the required instruction sets, Err() if some instruction sets are missing

Source

unsafe fn new_with_avx(len: usize, inner_fft: Arc<dyn Fft<T>>) -> Self

Source

unsafe fn prepare_bluesteins( &self, input: &[Complex<A>], inner_fft_buffer: &mut [Complex<A>], )

Source

unsafe fn finalize_bluesteins( &self, inner_fft_buffer: &[Complex<A>], output: &mut [Complex<A>], )

Source

unsafe fn pairwise_complex_multiply_conjugated( buffer: impl AvxArrayMut<A>, multiplier: &[A::VectorType], )

Source

fn perform_fft_inplace( &self, buffer: &mut [Complex<T>], scratch: &mut [Complex<T>], )

Source

fn perform_fft_immut( &self, input: &[Complex<T>], output: &mut [Complex<T>], scratch: &mut [Complex<T>], )

Source

fn perform_fft_out_of_place( &self, input: &[Complex<T>], output: &mut [Complex<T>], scratch: &mut [Complex<T>], )

Trait Implementations§

Source§

impl<A: AvxNum, T> Direction for BluesteinsAvx<A, T>

Source§

fn fft_direction(&self) -> FftDirection

Returns FftDirection::Forward if this instance computes forward FFTs, or FftDirection::Inverse for inverse FFTs
Source§

impl<A: AvxNum, T: FftNum> Fft<T> for BluesteinsAvx<A, T>

Source§

fn process_immutable_with_scratch( &self, input: &[Complex<T>], output: &mut [Complex<T>], scratch: &mut [Complex<T>], )

Divides input and output into chunks of self.len(), and computes a FFT on each chunk while keeping input untouched. Read more
Source§

fn process_outofplace_with_scratch( &self, input: &mut [Complex<T>], output: &mut [Complex<T>], scratch: &mut [Complex<T>], )

Divides input and output into chunks of size self.len(), and computes a FFT on each chunk. Read more
Source§

fn process_with_scratch( &self, buffer: &mut [Complex<T>], scratch: &mut [Complex<T>], )

Divides buffer into chunks of size self.len(), and computes a FFT on each chunk. Read more
Source§

fn get_inplace_scratch_len(&self) -> usize

Returns the size of the scratch buffer required by process_with_scratch Read more
Source§

fn get_outofplace_scratch_len(&self) -> usize

Returns the size of the scratch buffer required by process_outofplace_with_scratch Read more
Source§

fn get_immutable_scratch_len(&self) -> usize

Returns the size of the scratch buffer required by process_immutable_with_scratch Read more
Source§

fn process(&self, buffer: &mut [Complex<T>])

Computes a FFT in-place. Read more
Source§

impl<A: AvxNum, T> Length for BluesteinsAvx<A, T>

Source§

fn len(&self) -> usize

The FFT size that this algorithm can process

Auto Trait Implementations§

§

impl<A, T> !RefUnwindSafe for BluesteinsAvx<A, T>

§

impl<A, T> !UnwindSafe for BluesteinsAvx<A, T>

§

impl<A, T> Freeze for BluesteinsAvx<A, T>

§

impl<A, T> Send for BluesteinsAvx<A, T>
where T: Send,

§

impl<A, T> Sync for BluesteinsAvx<A, T>
where T: Sync,

§

impl<A, T> Unpin for BluesteinsAvx<A, T>
where T: Unpin,

§

impl<A, T> UnsafeUnpin for BluesteinsAvx<A, T>

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.