Skip to main content

fftw_execute

Function fftw_execute 

Source
pub fn fftw_execute<T: Float>(
    plan: &Plan<T>,
    input: &[Complex<T>],
    output: &mut [Complex<T>],
)
Expand description

Execute a 1-D complex DFT plan.

Corresponds to FFTW’s fftw_execute / fftw_execute_dft.

Unlike FFTW, OxiFFT does not modify the input buffer. The input slice is immutable; the signature accepts &[Complex<T>] (immutable reference).

§Arguments

  • plan - A reference to the plan to execute.
  • input - Input buffer of size n.
  • output - Output buffer of size n (written in-place).

§Panics

Panics if input.len() or output.len() does not equal plan.size().

§Example

use oxifft::compat::{fftw_plan_dft_1d, fftw_execute};
use oxifft::{Direction, Flags, Complex};

let plan = fftw_plan_dft_1d(8, Direction::Forward, Flags::ESTIMATE).unwrap();
let input = vec![Complex::new(1.0_f64, 0.0); 8];
let mut output = vec![Complex::new(0.0_f64, 0.0); 8];
fftw_execute(&plan, &input, &mut output);