Skip to main content

high_frequency_content

Function high_frequency_content 

Source
pub fn high_frequency_content(mag: &[f32]) -> Result<f32, AudioError>
Expand description

High-frequency content of a one-sided magnitude spectrum mag.

HFC = Σ_k k · |X[k]| — each bin is weighted by its index, so energy at higher bins contributes more. It is a percussive-onset / brightness measure: larger for spectra whose energy sits in the upper bins.

Zero-heap: single pass, scalar result.

§Errors