pub fn analyze_frame(
snd: &[f32],
bufs: &mut EncoderBuffers,
plan: &mut FftPlan,
fft_out: &mut [Complex<f32>],
)Expand description
Ingest one 160-sample frame and run the front-end analysis.
sndis the new audio frame as f32 samples in nominal[-1, 1). Callers converting from i16 should divide by 32768.0.bufsis the per-stream working state; buffers are shifted and updated in place.plancarries the realfft plan cache.fft_outreceives a complex spectrum of lengthFFT_LENGTH / 2 + 1= 129. Realfft returns only the non-redundant half of the Hermitian-symmetric complex FFT; for the purposes of pitch refinement and spectral amplitude extraction that’s sufficient.
§Panics
Panics if snd.len() < FRAME or fft_out.len() != FFT_LENGTH / 2 + 1.
Both are caller contracts; the downstream encoder controls both.