|
| template<typename Rep , typename Precision = std::ratio<1>> |
| using | electro::gain = quantity< decibel_unit, Rep, Precision > |
| | A logarithmic ratio with configurable representation and precision.
|
| |
| using | electro::decibels = gain< int64_t > |
| | Gain with 1 dB precision.
|
| |
| using | electro::centidecibels = gain< int64_t, std::centi > |
| | Gain with 0.01 dB precision.
|
| |
| using | electro::millidecibels = gain< int64_t, std::milli > |
| | Gain with 0.001 dB precision.
|
| |
| template<typename Rep , typename Precision = std::ratio<1>> |
| using | electro::dbm_level = level< milliwatt_reference, Rep, Precision > |
| | A level referenced to 1 mW.
|
| |
| template<typename Rep , typename Precision = std::ratio<1>> |
| using | electro::dbw_level = level< watt_reference, Rep, Precision > |
| | A level referenced to 1 W.
|
| |
| template<typename Rep , typename Precision = std::ratio<1>> |
| using | electro::dbv_level = level< volt_reference, Rep, Precision > |
| | A level referenced to 1 V.
|
| |
| template<typename Rep , typename Precision = std::ratio<1>> |
| using | electro::dbmv_level = level< millivolt_reference, Rep, Precision > |
| | A level referenced to 1 mV.
|
| |
| template<typename Rep , typename Precision = std::ratio<1>> |
| using | electro::dbuv_level = level< microvolt_reference, Rep, Precision > |
| | A level referenced to 1 µV.
|
| |
| using | electro::dbm = dbm_level< int64_t > |
| | Power level in dBm, with 1 dB precision.
|
| |
| using | electro::centi_dbm = dbm_level< int64_t, std::centi > |
| | Power level in dBm, with 0.01 dB precision.
|
| |
| using | electro::dbw = dbw_level< int64_t > |
| | Power level in dBW, with 1 dB precision.
|
| |
| using | electro::dbv = dbv_level< int64_t > |
| | Voltage level in dBV, with 1 dB precision.
|
| |
| using | electro::dbmv = dbmv_level< int64_t > |
| | Voltage level in dBmV, with 1 dB precision.
|
| |
| using | electro::dbuv = dbuv_level< int64_t > |
| | Voltage level in dBµV, with 1 dB precision.
|
| |
| using | electro::centi_dbuv = dbuv_level< int64_t, std::centi > |
| | Voltage level in dBµV, with 0.01 dB precision.
|
| |
|
| template<typename ToLevel , typename Reference , typename Rep , typename Precision > |
| constexpr ToLevel | electro::level_cast (const level< Reference, Rep, Precision > &l) |
| | Converts a level to a different precision or representation.
|
| |
| template<typename ToLevel , typename Reference , typename Rep , typename Precision > |
| constexpr ToLevel | electro::floor (const level< Reference, Rep, Precision > &l) |
| | Converts a level to the target type, rounding toward negative infinity.
|
| |
| template<typename ToLevel , typename Reference , typename Rep , typename Precision > |
| constexpr ToLevel | electro::ceil (const level< Reference, Rep, Precision > &l) |
| | Converts a level to the target type, rounding toward positive infinity.
|
| |
| template<typename ToLevel , typename Reference , typename Rep , typename Precision > |
| constexpr ToLevel | electro::round (const level< Reference, Rep, Precision > &l) |
| | Converts a level to the target type, rounding to nearest (ties to even).
|
| |
| template<typename Reference , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > |
| constexpr auto | electro::operator+ (const level< Reference, Rep1, Precision1 > &l, const quantity< decibel_unit, Rep2, Precision2 > &g) |
| | Applies a gain to a level.
|
| |
| template<typename Reference , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > |
| constexpr auto | electro::operator+ (const quantity< decibel_unit, Rep2, Precision2 > &g, const level< Reference, Rep1, Precision1 > &l) |
| | Applies a gain to a level.
|
| |
| template<typename Reference , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > |
| constexpr auto | electro::operator- (const level< Reference, Rep1, Precision1 > &l, const quantity< decibel_unit, Rep2, Precision2 > &g) |
| | Applies a loss to a level.
|
| |
| template<typename Reference , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > |
| constexpr auto | electro::operator- (const level< Reference, Rep1, Precision1 > &a, const level< Reference, Rep2, Precision2 > &b) |
| | The difference between two levels is a gain.
|
| |
| template<typename Reference , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > |
| constexpr bool | electro::operator== (const level< Reference, Rep1, Precision1 > &a, const level< Reference, Rep2, Precision2 > &b) |
| |
template<typename Reference , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 >
requires std::three_way_comparable<std::common_type_t<Rep1, Rep2>> |
| constexpr auto | electro::operator<=> (const level< Reference, Rep1, Precision1 > &a, const level< Reference, Rep2, Precision2 > &b) |
| |
| template<typename Reference , typename Rep , typename Precision > |
| auto | electro::to_linear (const level< Reference, Rep, Precision > &l) |
| | Converts a level to the equivalent linear quantity.
|
| |
| template<typename ToLevel , typename Unit , typename Rep , typename Precision > |
| ToLevel | electro::to_level (const quantity< Unit, Rep, Precision > &q) |
| | Converts a linear quantity to a level.
|
| |
| template<typename Rep , typename Precision > |
| double | electro::power_ratio (const quantity< decibel_unit, Rep, Precision > &g) |
| | The linear power ratio a gain represents (10^(dB/10)).
|
| |
| template<typename Rep , typename Precision > |
| double | electro::amplitude_ratio (const quantity< decibel_unit, Rep, Precision > &g) |
| | The linear amplitude ratio a gain represents (10^(dB/20)).
|
| |
| gain< double > | electro::power_gain (double ratio) |
| | The gain corresponding to a linear power ratio (10*log10(ratio)).
|
| |
| gain< double > | electro::amplitude_gain (double ratio) |
| | The gain corresponding to a linear amplitude ratio (20*log10(ratio)).
|
| |
template<typename Reference , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 >
requires is_power_reference_v<Reference> |
| auto | electro::add_powers (const level< Reference, Rep1, Precision1 > &a, const level< Reference, Rep2, Precision2 > &b) |
| | Combines the powers of two uncorrelated signals.
|
| |
template<typename Rep , typename Precision >
requires _is_decimal_precision<typename Precision::type> |
| std::string | electro::to_string (const quantity< decibel_unit, Rep, Precision > &g) |
| | Converts a gain to a string, e.g.
|
| |
template<typename Reference , typename Rep , typename Precision >
requires _is_decimal_precision<typename Precision::type> |
| std::string | electro::to_string (const level< Reference, Rep, Precision > &l) |
| | Converts a level to a string, e.g.
|
| |
| template<char... Digits> |
| constexpr electro::decibels | electro_literals::operator""_dB () |
| | Literal for decibels (e.g., 20_dB).
|
| |
| template<char... Digits> |
| constexpr electro::centidecibels | electro_literals::operator""_cdB () |
| | Literal for centidecibels, i.e.
|
| |
| template<char... Digits> |
| constexpr electro::dbm | electro_literals::operator""_dBm () |
| | Literal for dBm (e.g., 20_dBm, or -73_dBm).
|
| |
| template<char... Digits> |
| constexpr electro::centi_dbm | electro_literals::operator""_cdBm () |
| | Literal for dBm in 0.01 dB steps (e.g., 1301_cdBm is 13.01 dBm).
|
| |
| template<char... Digits> |
| constexpr electro::dbw | electro_literals::operator""_dBW () |
| | Literal for dBW (e.g., 10_dBW).
|
| |
| template<char... Digits> |
| constexpr electro::dbv | electro_literals::operator""_dBV () |
| | Literal for dBV (e.g., 6_dBV).
|
| |
| template<char... Digits> |
| constexpr electro::dbmv | electro_literals::operator""_dBmV () |
| | Literal for dBmV (e.g., 40_dBmV).
|
| |
| template<char... Digits> |
| constexpr electro::dbuv | electro_literals::operator""_dBuV () |
| | Literal for dBµV (e.g., 120_dBuV).
|
| |
| template<char... Digits> |
| constexpr electro::dbuv | electro_literals::operator""_dBµV () |
| | Literal for dBµV (e.g., 120_dBµV).
|
| |