[−][src]Struct rustfft::FFTplanner
The FFT planner is used to make new FFT algorithm instances.
RustFFT has several FFT algorithms available; For a given FFT size, the FFTplanner decides which of the available FFT algorithms to use and then initializes them.
// Perform a forward FFT of size 1234 use std::sync::Arc; use rustfft::FFTplanner; use rustfft::num_complex::Complex; use rustfft::num_traits::Zero; let mut input: Vec<Complex<f32>> = vec![Zero::zero(); 1234]; let mut output: Vec<Complex<f32>> = vec![Zero::zero(); 1234]; let mut planner = FFTplanner::new(false); let fft = planner.plan_fft(1234); fft.process(&mut input, &mut output); // The fft instance returned by the planner is stored behind an `Arc`, so it's cheap to clone let fft_clone = Arc::clone(&fft);
If you plan on creating multiple FFT instances, it is recommnded to reuse the same planner for all of them. This is because the planner re-uses internal data across FFT instances wherever possible, saving memory and reducing setup time. (FFT instances created with one planner will never re-use data and buffers with FFT instances created by a different planner)
Each FFT instance owns Arc
s to its internal data, rather than borrowing it from the planner, so it's perfectly
safe to drop the planner after creating FFT instances.
Implementations
impl<T: FFTnum> FFTplanner<T>
[src]
pub fn new(inverse: bool) -> Self
[src]
Creates a new FFT planner.
If inverse
is false, this planner will plan forward FFTs. If inverse
is true, it will plan inverse FFTs.
pub fn plan_fft(&mut self, len: usize) -> Arc<dyn FFT<T>>
[src]
Returns a FFT instance which processes signals of size len
If this is called multiple times, it will attempt to re-use internal data between instances
Auto Trait Implementations
impl<T> !RefUnwindSafe for FFTplanner<T>
impl<T> Send for FFTplanner<T>
impl<T> Sync for FFTplanner<T>
impl<T> Unpin for FFTplanner<T>
impl<T> !UnwindSafe for FFTplanner<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,