#include <type_traits>
#include <cmath>
#include <limits>
Go to the source code of this file.
|
| template<typename Type > |
| Type | ExpGain (Type gain) noexcept |
| |
◆ ExpGain()
template<typename Type >
| Type ExpGain |
( |
Type |
gain | ) |
|
|
noexcept |
Definition at line 19 of file Gain.h.
20{
21 static_assert(std::is_floating_point_v<Type>);
22
23 constexpr Type a(1e-3);
24 constexpr Type b(6.908);
25
26 if (gain < std::numeric_limits<Type>::epsilon())
27 return {};
28
29 const Type expGain = a * std::exp(b * gain);
30
31 if (expGain >
Type(1))
33
34 return expGain;
35}
Referenced by AudioIoCallback::FillOutputBuffers().