pub fn inverse_stft(
spec: &[Vec<[f32; 2]>],
frame_size: usize,
hop: usize,
) -> Result<Vec<f32>, StftBakeError>Expand description
Inverse STFT of the two-sided complex frames from
crate::audio::stft::forward_stft back into a single time-domain signal.
spec:num_framesframes, each a length-frame_sizetwo-sided spectrum of[re, im]bins (exactly thecrate::audio::stft::forward_stftoutput).frame_size:N, a power of two; the analysis/synthesis frame length.hop: sample advance between frames (> 0). A COLA Hann athop = N/2gives exact interior reconstruction.
The frames are flattened into a num_frames × 2·N interleaved-complex buffer
([re, im, …]), a length-N Hann window is built for both the analysis and
synthesis arguments, and the WOLA resynthesiser
[qualia_audio::features::framing::istft] is invoked with caller-owned
scratch/norm/out buffers (out_len = (num_frames − 1)·hop + N).
The core-db forward sign (exp(-2πi·k·j/N), crate::audio::stft) matches
qualia-audio’s inverse sign (fft_radix2(_, false) uses e^{-j2πk/L}), so
no conjugation is required — the forward output feeds straight in.
Returns the reconstructed samples (length out_len), or an empty Vec when
spec is empty. Errors map [qualia_audio::types::AudioError] →
StftBakeError.