pub fn istft(
spectra: &mut [f32],
fft_size: usize,
hop: usize,
analysis_window: &[f32],
synthesis_window: &[f32],
ifft_scratch: &mut [f32],
norm: &mut [f32],
out: &mut [f32],
) -> Result<usize, AudioError>Expand description
Inverse STFT of a run of complex spectra into a single time-domain signal.
spectra:num_frames × (2·fft_size)interleaved-complex bins ([re, im, …]), frameiatspectra[i*2N .. (i+1)*2N]. Clobbered in place (each frame is inverse-transformed).num_framesis inferred asspectra.len() / (2·fft_size).fft_size:N, a power of two; equals the analysis frame size.hop: sample advance between frames (> 0).analysis_window/synthesis_window: the length-Nwindows used in analysis and applied in synthesis. Their product forms the normalisation.ifft_scratch:≥ Nfloats; per-frame real inverse output (clobbered).norm:≥ out_lenfloats; accumulatesΣ w_a·w_s(clobbered).out:≥ out_lenfloats; receives the reconstructed signal, whereout_len = (num_frames − 1)·hop + N.
Returns the number of output samples written (out_len).
Errors: AudioError::InvalidParameter for a non-power-of-two/zero
fft_size, zero hop, wrong window lengths, or a spectra length that is
not a multiple of 2·fft_size; AudioError::OutputBufferTooSmall if
ifft_scratch, norm, or out are too short.