Struct chfft::RFft1D [] [src]

pub struct RFft1D<T> { /* fields omitted */ }

Perform a real-to-complex one-dimensional Fourier transform

Example

extern crate chfft;

use chfft::RFft1D;

fn main() {
    let input = [2.0, 0.0, 1.0, 1.0, 0.0, 3.0, 2.0, 4.0];

    let mut fft = RFft1D::<f64>::new(input.len());

    let output = fft.forward(&input);

    println!("the transform of {:?} is {:?}", input, output);
}

Methods

impl<T: Float + FloatConst + NumAssign> RFft1D<T>
[src]

[src]

Returns a instances to execute FFT

use chfft::RFft1D;
let mut rfft = RFft1D::<f64>::new(1024);

[src]

Reinitialize length

use chfft::RFft1D;
let mut rfft = RFft1D::<f64>::new(1024);

// reinitialize
rfft.setup(2048);

[src]

The 1 scaling factor forward transform

extern crate chfft;

let input = [2.0, 0.0, 1.0, 1.0, 0.0, 3.0, 2.0, 4.0];

let mut fft = chfft::RFft1D::<f64>::new(input.len());
let output = fft.forward0(&input);

[src]

The 1 scaling factor forward transform

extern crate chfft;

let input = [2.0, 0.0, 1.0, 1.0, 0.0, 3.0, 2.0, 4.0];

let mut fft = chfft::RFft1D::<f64>::new(input.len());
let output = fft.forward0(&input);

[src]

The \(\frac 1 {\sqrt n}\) scaling factor forward transform

extern crate chfft;

let input = [2.0, 0.0, 1.0, 1.0, 0.0, 3.0, 2.0, 4.0];

let mut fft = chfft::RFft1D::<f64>::new(input.len());
let output = fft.forwardu(&input);

[src]

The \(\frac 1 n\) scaling factor forward transform

extern crate chfft;

let input = [2.0, 0.0, 1.0, 1.0, 0.0, 3.0, 2.0, 4.0];

let mut fft = chfft::RFft1D::<f64>::new(input.len());
let output = fft.forwardn(&input);

[src]

The \(\frac 1 n\) scaling factor backward transform

extern crate chfft;
extern crate num_complex;

let input = [num_complex::Complex::new(2.0, 0.0), num_complex::Complex::new(1.0, 1.0),
             num_complex::Complex::new(4.0, 3.0), num_complex::Complex::new(2.0, 0.0)];

let mut fft = chfft::RFft1D::<f64>::new(6);
let output = fft.backward(&input);

[src]

The 1 scaling factor backward transform

extern crate chfft;
extern crate num_complex;

let input = [num_complex::Complex::new(2.0, 0.0), num_complex::Complex::new(1.0, 1.0),
             num_complex::Complex::new(4.0, 3.0), num_complex::Complex::new(2.0, 0.0)];

let mut fft = chfft::RFft1D::<f64>::new(6);
let output = fft.backward0(&input);

[src]

The \(\frac 1 {\sqrt n}\) scaling factor backward transform

extern crate chfft;
extern crate num_complex;

let input = [num_complex::Complex::new(2.0, 0.0), num_complex::Complex::new(1.0, 1.0),
             num_complex::Complex::new(4.0, 3.0), num_complex::Complex::new(2.0, 0.0)];

let mut fft = chfft::RFft1D::<f64>::new(6);
let output = fft.backwardu(&input);

[src]

The \(\frac 1 n\) scaling factor backward transform

extern crate chfft;
extern crate num_complex;

let input = [num_complex::Complex::new(2.0, 0.0), num_complex::Complex::new(1.0, 1.0),
             num_complex::Complex::new(4.0, 3.0), num_complex::Complex::new(2.0, 0.0)];

let mut fft = chfft::RFft1D::<f64>::new(6);
let output = fft.backwardn(&input);

Trait Implementations

Auto Trait Implementations

impl<T> Send for RFft1D<T> where
    T: Send

impl<T> Sync for RFft1D<T> where
    T: Sync