Struct rustfft::algorithm::MixedRadix [−][src]
pub struct MixedRadix<T> { /* fields omitted */ }
Implementation of the Mixed-Radix FFT algorithm
This algorithm factors a size n FFT into n1 * n2, computes several inner FFTs of size n1 and n2, then combines the results to get the final answer
// Computes a forward FFT of size 1200, using the Mixed-Radix Algorithm use rustfft::algorithm::MixedRadix; use rustfft::{FFT, FFTplanner}; use rustfft::num_complex::Complex; use rustfft::num_traits::Zero; let mut input: Vec<Complex<f32>> = vec![Zero::zero(); 1200]; let mut output: Vec<Complex<f32>> = vec![Zero::zero(); 1200]; // we need to find an n1 and n2 such that n1 * n2 == 1200 // n1 = 30 and n2 = 40 satisfies this let mut planner = FFTplanner::new(false); let inner_fft_n1 = planner.plan_fft(30); let inner_fft_n2 = planner.plan_fft(40); // the mixed radix FFT length will be inner_fft_n1.len() * inner_fft_n2.len() = 1200 let fft = MixedRadix::new(inner_fft_n1, inner_fft_n2); fft.process(&mut input, &mut output);
Methods
impl<T: FFTnum> MixedRadix<T>
[src]
impl<T: FFTnum> MixedRadix<T>
pub fn new(width_fft: Arc<FFT<T>>, height_fft: Arc<FFT<T>>) -> Self
[src]
pub fn new(width_fft: Arc<FFT<T>>, height_fft: Arc<FFT<T>>) -> Self
Creates a FFT instance which will process inputs/outputs of size width_fft.len() * height_fft.len()
Trait Implementations
impl<T: FFTnum> FFT<T> for MixedRadix<T>
[src]
impl<T: FFTnum> FFT<T> for MixedRadix<T>
fn process(&self, input: &mut [Complex<T>], output: &mut [Complex<T>])
[src]
fn process(&self, input: &mut [Complex<T>], output: &mut [Complex<T>])
Computes an FFT on the input
buffer and places the result in the output
buffer. Read more
fn process_multi(&self, input: &mut [Complex<T>], output: &mut [Complex<T>])
[src]
fn process_multi(&self, input: &mut [Complex<T>], output: &mut [Complex<T>])
Divides the input
and output
buffers into chunks of length self.len(), then computes an FFT on each chunk. Read more
impl<T> Length for MixedRadix<T>
[src]
impl<T> Length for MixedRadix<T>
impl<T> IsInverse for MixedRadix<T>
[src]
impl<T> IsInverse for MixedRadix<T>
fn is_inverse(&self) -> bool
[src]
fn is_inverse(&self) -> bool
Returns false if this instance computes forward FFTs, true for inverse FFTs
Auto Trait Implementations
impl<T> Send for MixedRadix<T> where
T: Send,
impl<T> Send for MixedRadix<T> where
T: Send,
impl<T> Sync for MixedRadix<T> where
T: Sync,
impl<T> Sync for MixedRadix<T> where
T: Sync,