Skip to main content

tc_to_total

Function tc_to_total 

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

Temporal centroid of envelope (the amplitude-weighted mean index), normalised to [0, 1) by the total length. For a symmetric envelope the centroid sits at the middle (≈ 0.5); an early-weighted envelope returns a smaller value.

§Errors