Struct chfft::CFft1D
[−]
[src]
pub struct CFft1D<T> { /* fields omitted */ }
Perform a complex-to-complex one-dimensional Fourier transform
Example
extern crate chfft; extern crate num; use num::Complex; use chfft::CFft1D; fn main() { let input = [Complex::new(2.0, 0.0), Complex::new(1.0, 1.0), Complex::new(0.0, 3.0), Complex::new(2.0, 4.0)]; let mut fft = CFft1D::<f64>::with_len(input.len()); let output = fft.forward(&input); println!("the transform of {:?} is {:?}", input, output); }
Methods
impl<T: Float + FloatConst + NumAssign> CFft1D<T>
[src]
fn new() -> Self
[src]
Returns a instances to execute FFT
use chfft::CFft1D; let mut fft = CFft1D::<f64>::new();
fn with_len(len: usize) -> Self
[src]
Returns a instances to execute length initialized FFT
use chfft::CFft1D; let mut fft = CFft1D::<f64>::with_len(1024);
fn setup(&mut self, len: usize)
[src]
Reinitialize length
use chfft::CFft1D; let mut fft = CFft1D::<f64>::with_len(1024); // reinitialize fft.setup(2048);
fn forward(&mut self, source: &[Complex<T>]) -> Vec<Complex<T>>
[src]
The 1 scaling factor forward transform
extern crate chfft; extern crate num; let input = [num::Complex::new(2.0, 0.0), num::Complex::new(1.0, 1.0), num::Complex::new(0.0, 3.0), num::Complex::new(2.0, 4.0)]; let mut fft = chfft::CFft1D::<f64>::with_len(input.len()); let output = fft.forward(&input);
fn forward0(&mut self, source: &[Complex<T>]) -> Vec<Complex<T>>
[src]
The 1 scaling factor forward transform
extern crate chfft; extern crate num; let input = [num::Complex::new(2.0, 0.0), num::Complex::new(1.0, 1.0), num::Complex::new(0.0, 3.0), num::Complex::new(2.0, 4.0)]; let mut fft = chfft::CFft1D::<f64>::with_len(input.len()); let output = fft.forward0(&input);
fn forwardu(&mut self, source: &[Complex<T>]) -> Vec<Complex<T>>
[src]
The $\frac 1 {\sqrt n}$ scaling factor forward transform
extern crate chfft; extern crate num; let input = [num::Complex::new(2.0, 0.0), num::Complex::new(1.0, 1.0), num::Complex::new(0.0, 3.0), num::Complex::new(2.0, 4.0)]; let mut fft = chfft::CFft1D::<f64>::with_len(input.len()); let output = fft.forwardu(&input);
fn forwardn(&mut self, source: &[Complex<T>]) -> Vec<Complex<T>>
[src]
The $\frac 1 n$ scaling factor forward transform
extern crate chfft; extern crate num; let input = [num::Complex::new(2.0, 0.0), num::Complex::new(1.0, 1.0), num::Complex::new(0.0, 3.0), num::Complex::new(2.0, 4.0)]; let mut fft = chfft::CFft1D::<f64>::with_len(input.len()); let output = fft.forwardn(&input);
fn backward(&mut self, source: &[Complex<T>]) -> Vec<Complex<T>>
[src]
The $\frac 1 n$ scaling factor backward transform
extern crate chfft; extern crate num; let input = [num::Complex::new(2.0, 0.0), num::Complex::new(1.0, 1.0), num::Complex::new(0.0, 3.0), num::Complex::new(2.0, 4.0)]; let mut fft = chfft::CFft1D::<f64>::with_len(input.len()); let output = fft.backward(&input);
fn backward0(&mut self, source: &[Complex<T>]) -> Vec<Complex<T>>
[src]
The 1 scaling factor backward transform
extern crate chfft; extern crate num; let input = [num::Complex::new(2.0, 0.0), num::Complex::new(1.0, 1.0), num::Complex::new(0.0, 3.0), num::Complex::new(2.0, 4.0)]; let mut fft = chfft::CFft1D::<f64>::with_len(input.len()); let output = fft.backward0(&input);
fn backwardu(&mut self, source: &[Complex<T>]) -> Vec<Complex<T>>
[src]
The $\frac 1 {\sqrt n}$ scaling factor backward transform
extern crate chfft; extern crate num; let input = [num::Complex::new(2.0, 0.0), num::Complex::new(1.0, 1.0), num::Complex::new(0.0, 3.0), num::Complex::new(2.0, 4.0)]; let mut fft = chfft::CFft1D::<f64>::with_len(input.len()); let output = fft.backwardu(&input);
fn backwardn(&mut self, source: &[Complex<T>]) -> Vec<Complex<T>>
[src]
The $\frac 1 n$ scaling factor backward transform
extern crate chfft; extern crate num; let input = [num::Complex::new(2.0, 0.0), num::Complex::new(1.0, 1.0), num::Complex::new(0.0, 3.0), num::Complex::new(2.0, 4.0)]; let mut fft = chfft::CFft1D::<f64>::with_len(input.len()); let output = fft.backwardn(&input);