Function ifft

Source
pub fn ifft<R: Runtime>(
    device: &R::Device,
    input_real: Vec<f32>,
    input_imag: Vec<f32>,
) -> Vec<f32>
Expand description

Computes the Inverse Fast Fourier Transform (IFFT) of a vector of real and imaginary input data.

This function initializes the IFFT computation on the provided input vectors, launching the IFFT kernel to perform the transformation. The input data is expected to be in the form of separate real and imaginary components of complex numbers.

§Parameters

  • device: A reference to the device on which the IFFT computation will be performed.
  • input_real: A vector of f32 values representing the real parts of the input data.
  • input_imag: A vector of f32 values representing the imaginary parts of the input data.

§Returns

A vector of f32 values representing the interleaved output of the IFFT, which contains both the real and imaginary parts of the result.

§Example

let input_real = vec![1.0, 0.0, 0.0, 0.0]; // Example real input
let input_imag = vec![0.0, 0.0, 0.0, 0.0]; // Example imaginary input
let output = ifft::<YourRuntimeType>(device, input_real, input_imag);

§Safety

This function uses unsafe operations to interact with the underlying runtime and device. The caller must ensure that the input data is valid and that the device is properly set up for computation.