Skip to main content

ifft_to_real

Function ifft_to_real 

Source
pub fn ifft_to_real(
    spectrum: &mut [f32],
    out_real: &mut [f32],
) -> Result<(), AudioError>
Expand description

Inverse FFT of an interleaved-complex spectrum, writing the real part of the time-domain result.

  • spectrum: 2 * N interleaved complex bins, N a power of two. Clobbered in place (holds the full complex inverse on return).
  • out_real: at least N floats; receives Re(x[n]) for n = 0..N.

The inverse is 1/N-normalised (via fft_radix2), so pairing this with a forward real FFT reconstructs the original samples — the ISTFT synthesis path.

Returns AudioError::InvalidParameter if the spectrum length is invalid, or AudioError::OutputBufferTooSmall if out_real is short.