sva-analysis 0.7.6

Post-hoc analyses over rendered buffers: onsets and trajectory are stable; masking and gain-reduction are still experimental
Documentation
1
2
3
4
5
6
7
8
9
10
11
// Concern: amplitude to dB for every analysis that reports one | Non-concern: the floored dB a spectrum's own scale needs (sva_samples::db) | IO: (amplitude) -> dB

/// Silence is `-inf`, not a floor: an analysis states what it measured and leaves the floor
/// to whoever reads it. `sva_samples::db` clamps instead, because a spectrum is drawn.
pub fn to_db(amplitude: f64) -> f64 {
    if amplitude <= 0.0 {
        f64::NEG_INFINITY
    } else {
        20.0 * amplitude.log10()
    }
}