Skip to main content

above_floor

Function above_floor 

Source
pub fn above_floor(values: &[f64], db_below_peak: f64) -> Vec<usize>
Expand description

Keeps the samples within db_below_peak decibels of the largest one.

The noise-floor cut: a spectrum’s floor is what a display spends most of its points drawing, and forty decibels below the peak is rarely signal. Amplitude decibels, so the threshold is peak · 10^(-db / 20).

A run whose largest sample is not positive keeps nothing.