Skip to main content

Module log_spectral_distance

Module log_spectral_distance 

Source
Expand description

Log-spectral distance (LSD) between a reference and a degraded magnitude spectrum.

LSD is the classic intrusive spectral-envelope error: the root-mean-square, over frequency bins, of the difference between the two log-magnitude spectra, expressed in dB. Zero for identical spectra; grows with envelope mismatch.

This operates on already-computed magnitude spectra (e.g. from crate::features::fft::real_fft_magnitude) so it stays pure, allocation-free and reusable per-frame. Caller supplies both magnitude slices; a single scalar is returned.

Functionsยง

log_spectral_distance
Log-spectral distance in dB between two magnitude spectra.