Skip to main content

rms_to_meter_level

Function rms_to_meter_level 

Source
pub fn rms_to_meter_level(rms: f32) -> f32
Expand description

Convert a linear RMS value ([0, 1]) into a UI-meter level ([0, 1]) on a logarithmic dBFS scale, with 0 dBFS mapping to 1.0 and METER_FLOOR_DBFS mapping to 0.0.

Linear RMS is a useless meter input because human loudness perception (and microphone signal) is logarithmic — speech sits around -30 dBFS (RMS ≈ 0.03), while the linear scale would map the same speech to ~3 % of a 10-bar meter. The dBFS-mapped output puts conversational speech around 50 % of the bar, leaving headroom at both ends for whispers + shouts.

Indicative outputs (for the default -60 dBFS floor):

Input RMSdBFSMeter level
0.0-∞0.00
0.001-600.00
0.003-50.50.16
0.01-400.33
0.03-30.50.49
0.1-200.67
0.3-10.50.83
1.001.00