47#ifndef LASS_GUARDIAN_OF_INCLUSION_NUM_DB_H
48#define LASS_GUARDIAN_OF_INCLUSION_NUM_DB_H
53#define LASS_NUM_DB_10_OVER_LN10 4.3429448190325182765112891891661
54#define LASS_NUM_DB_20_OVER_LN10 8.6858896380650365530225783783321
55#define LASS_NUM_DB_LN10_OVER_10 0.23025850929940456840179914546844
56#define LASS_NUM_DB_LN10_OVER_20 0.11512925464970228420089957273422
65 template <
typename T>
inline T
pow2dB(
const T& power)
67 return T(LASS_NUM_DB_10_OVER_LN10) * num::log(power);
73 template <
typename T>
inline T
amp2dB(
const T& amplitude)
75 return T(LASS_NUM_DB_20_OVER_LN10) * num::log(amplitude);
81 template <
typename T>
inline T
dB2pow(
const T& decibels)
83 return num::exp(T(LASS_NUM_DB_LN10_OVER_10) * decibels);
89 template <
typename T>
inline T
dB2amp(
const T& decibels)
91 return num::exp(T(LASS_NUM_DB_LN10_OVER_20) * decibels);
97 template<
typename T > T
p2dB(
const T& iValue );
102 template<
typename T > T
W2dB(
const T& iValue );
109 template<
typename T > T
I2dB(
const T& iValue );
114 template<
typename T > T
dB2p(
const T& iValue );
119 template<
typename T > T
dB2W(
const T& iValue );
126 template<
typename T > T
dB2I(
const T& iValue );
T dB2W(const T &iValue)
Converts decibels into a power.
T pow2dB(const T &power)
power to decibels: y = 10 * log10(x)
T dB2pow(const T &decibels)
decibels to power: y = num::pow(10, x / 10)
T dB2p(const T &iValue)
Converts decibels into a pressure .
T dB2I(const T &iValue)
Converts decibels into an intensity.
T amp2dB(const T &litude)
amplitude to decibels: y = 20 * log10(x)
T W2dB(const T &iValue)
Converts a absolute acoustical power into decibels.
T I2dB(const T &iValue)
Converts an intensity into decibels.
T p2dB(const T &iValue)
Converts an absolute acoustical pressure into decibels.
T dB2amp(const T &decibels)
decibels to amplitude: y = num::pow(10, x / 20)
numeric types and traits.
Library for Assembled Shared Sources.