20 #ifndef __ardour_dB_h__
21 #define __ardour_dB_h__
26 #define GAIN_COEFF_ZERO 0.f
27 #define GAIN_COEFF_SMALL 0.0000001f //-140dB
28 #define GAIN_COEFF_UNITY 1.f
31 return dB > -318.8f ? pow (10.0
f, dB * 0.05
f) : 0.0f;
39 if (coeff < 1e-15)
return -std::numeric_limits<float>::infinity();
40 return 20.0f * log10f (coeff);
45 return 0.1 * (max_coeff / max_db);
static float fast_coefficient_to_dB(float coeff)
double zero_db_as_fraction
static float accurate_coefficient_to_dB(float coeff)
static double dB_coeff_step(double max_coeff)
static float fast_log10(const float val)
static float dB_to_coefficient(float dB)