Struct realfft::ComplexToRealOdd
source · [−]pub struct ComplexToRealOdd<T> { /* private fields */ }
Implementations
sourceimpl<T: FftNum> ComplexToRealOdd<T>
impl<T: FftNum> ComplexToRealOdd<T>
sourcepub fn new(length: usize, fft_planner: &mut FftPlanner<T>) -> Self
pub fn new(length: usize, fft_planner: &mut FftPlanner<T>) -> Self
Create a new ComplexToReal FFT for input data of a given length, and uses the given FftPlanner to build the inner FFT. Panics if the length is not odd.
Trait Implementations
sourceimpl<T: FftNum> ComplexToReal<T> for ComplexToRealOdd<T>
impl<T: FftNum> ComplexToReal<T> for ComplexToRealOdd<T>
sourcefn process(
&self,
input: &mut [Complex<T>],
output: &mut [T]
) -> Result<(), FftError>
fn process(
&self,
input: &mut [Complex<T>],
output: &mut [T]
) -> Result<(), FftError>
Transform a complex spectrum of N/2+1 (with N/2 rounded down) values and store the real result in the N long output.
The input buffer is used as scratch space, so the contents of input should be considered garbage after calling.
It also allocates additional scratch space as needed.
An error is returned if any of the given slices has the wrong length.
If the input data is invalid, meaning that one of the positions that should contain a zero holds a different value,
these non-zero values are ignored and the transform is still performed.
The function then returns an FftError::InputValues
error to tell that the result may not be correct.
sourcefn process_with_scratch(
&self,
input: &mut [Complex<T>],
output: &mut [T],
scratch: &mut [Complex<T>]
) -> Result<(), FftError>
fn process_with_scratch(
&self,
input: &mut [Complex<T>],
output: &mut [T],
scratch: &mut [Complex<T>]
) -> Result<(), FftError>
Transform a complex spectrum of N/2+1 (with N/2 rounded down) values and store the real result in the N long output.
The input buffer is used as scratch space, so the contents of input should be considered garbage after calling.
It also uses the provided scratch vector instead of allocating, which will be faster if it is called more than once.
An error is returned if any of the given slices has the wrong length.
If the input data is invalid, meaning that one of the positions that should contain a zero holds a different value,
these non-zero values are ignored and the transform is still performed.
The function then returns an FftError::InputValues
error to tell that the result may not be correct.
sourcefn get_scratch_len(&self) -> usize
fn get_scratch_len(&self) -> usize
Get the length of the scratch space needed for process_with_scratch
.
sourcefn make_input_vec(&self) -> Vec<Complex<T>>
fn make_input_vec(&self) -> Vec<Complex<T>>
Convenience method to make an input vector of the right type and length.
sourcefn make_output_vec(&self) -> Vec<T>
fn make_output_vec(&self) -> Vec<T>
Convenience method to make an output vector of the right type and length.
sourcefn make_scratch_vec(&self) -> Vec<Complex<T>>
fn make_scratch_vec(&self) -> Vec<Complex<T>>
Convenience method to make a scratch vector of the right type and length.
Auto Trait Implementations
impl<T> !RefUnwindSafe for ComplexToRealOdd<T>
impl<T> Send for ComplexToRealOdd<T>
impl<T> Sync for ComplexToRealOdd<T>
impl<T> Unpin for ComplexToRealOdd<T>
impl<T> !UnwindSafe for ComplexToRealOdd<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more