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>
impl<A: AvxNum, T: FftNum> BluesteinsAvx<A, T>
Sourceunsafe fn mul_complex_conjugated<V: AvxVector>(left: V, right: V) -> V
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
Sourcepub fn new(len: usize, inner_fft: Arc<dyn Fft<T>>) -> Result<Self, ()>
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
unsafe fn new_with_avx(len: usize, inner_fft: Arc<dyn Fft<T>>) -> Self
unsafe fn prepare_bluesteins( &self, input: &[Complex<A>], inner_fft_buffer: &mut [Complex<A>], )
unsafe fn finalize_bluesteins( &self, inner_fft_buffer: &[Complex<A>], output: &mut [Complex<A>], )
unsafe fn pairwise_complex_multiply_conjugated( buffer: impl AvxArrayMut<A>, multiplier: &[A::VectorType], )
fn perform_fft_inplace( &self, buffer: &mut [Complex<T>], scratch: &mut [Complex<T>], )
fn perform_fft_immut( &self, input: &[Complex<T>], output: &mut [Complex<T>], scratch: &mut [Complex<T>], )
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>
impl<A: AvxNum, T> Direction for BluesteinsAvx<A, T>
Source§fn fft_direction(&self) -> FftDirection
fn fft_direction(&self) -> FftDirection
Source§impl<A: AvxNum, T: FftNum> Fft<T> for BluesteinsAvx<A, T>
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>],
)
fn process_immutable_with_scratch( &self, input: &[Complex<T>], output: &mut [Complex<T>], scratch: &mut [Complex<T>], )
input and output into chunks of self.len(), and computes a FFT on each chunk while
keeping input untouched. Read moreSource§fn process_outofplace_with_scratch(
&self,
input: &mut [Complex<T>],
output: &mut [Complex<T>],
scratch: &mut [Complex<T>],
)
fn process_outofplace_with_scratch( &self, input: &mut [Complex<T>], output: &mut [Complex<T>], scratch: &mut [Complex<T>], )
input and output into chunks of size self.len(), and computes a FFT on each chunk. Read moreSource§fn process_with_scratch(
&self,
buffer: &mut [Complex<T>],
scratch: &mut [Complex<T>],
)
fn process_with_scratch( &self, buffer: &mut [Complex<T>], scratch: &mut [Complex<T>], )
Source§fn get_inplace_scratch_len(&self) -> usize
fn get_inplace_scratch_len(&self) -> usize
process_with_scratch Read moreSource§fn get_outofplace_scratch_len(&self) -> usize
fn get_outofplace_scratch_len(&self) -> usize
process_outofplace_with_scratch Read moreSource§fn get_immutable_scratch_len(&self) -> usize
fn get_immutable_scratch_len(&self) -> usize
process_immutable_with_scratch Read more