Skip to main content

ifft_batch

Function ifft_batch 

Source
pub fn ifft_batch(signals: &[(Vec<f32>, Vec<f32>)]) -> Vec<Vec<f32>>
Expand description

Computes the Cooley-Tukey radix-2 IFFT for a batch of complex spectra in a single GPU pass.

Each element of signals is a (real, imag) pair — the direct output of fft_batch. All pairs must share the same power-of-two length.

Returns one Vec<f32> per input signal, each of length 2 * n:

  • [0..n] — reconstructed real signal
  • [n..2n] — reconstructed imaginary signal (≈ 0 for real-valued inputs)

§Example

use gpu_fft::{fft_batch, ifft_batch};
let signals = vec![vec![1.0f32, 2.0, 3.0, 4.0]];
let spectra = fft_batch(&signals);
let recovered = ifft_batch(&spectra);