Skip to main content

log_mel_from_mono

Function log_mel_from_mono 

Source
pub fn log_mel_from_mono(
    samples: &[f32],
    frame_size: usize,
    hop: usize,
    sample_rate: u32,
    n_mel: usize,
    out: &mut [f32],
) -> Result<usize, AudioError>
Expand description

Log-mel spectrogram using the REAL triangular mel filterbank (features::mel).

Per frame: real-FFT magnitudes → power → triangular mel bank (0..Nyquist) → natural log. This replaced the earlier linear-FFT-bin averaging that was mislabelled “log-mel”. Batch convenience path — allocates working buffers once (the zero-heap streaming path is StreamingStft + features::mel::mel_bands applied per frame).