Logarithmics¶

Logarithmic numbers represent Decibel (dB) parameters within Hermes’ API. However, they will always act as their linear value when being interacted with, in order to preserve compatibility with any internal equation, since equations internally assume all parameters to be linear.
Note that therefore,
a = Logarithmic(10)
b = Logarithmic(20)
c = a + b
print(c)
>>> 20dB
will return in the output \(20.41392685158225\) instead of \(30\), since internally the linear representations will be summed. Instead, use the multiplication operator to sum Logarithmics, i.e.
a = Logarithmic(10)
b = Logarithmic(20)
c = a * b
print(c)
>>> 30dB
- class Logarithmic(value, value_type=ValueType.DB, conversion=DbConversionType.POWER)[source]¶
Bases:
floatRepresentation of a logarithmic number.
- Parameters:
value_type (
ValueType) – Assumed type of value. Decibels by default.conversion (
DbConversionType) – Conversion of logarithmic scale. Power by default.
- classmethod From_Tuple(linear, logarithmic, conversion=DbConversionType.POWER)[source]¶
Reconstruct a
Logarithmicfrom its linear and logarithmic values.- Parameters:
linear (
float) – Linear value of the logarithmic number.logarithmic (
float) – Logarithmic value of the logarithmic number.conversion (
DbConversionType) – Conversion of logarithmic scale.
- Return type:
- property conversion: DbConversionType[source]¶
Logarithmic conversion type.
Returns: Conversion type.
- class LogarithmicSequence(values: Sequence[float | int] | None = None, value_type: ValueType = ValueType.DB, conversion: DbConversionType = DbConversionType.POWER)[source]¶
Bases:
ndarray[tuple[int],dtype[float64]]A sequence of logarithmic numbers.
- Parameters:
values – Initial content of the represented sequence. If not provided, the sequence will be initialized as empty.
value_type – Assumed type of value. Decibels by default.
conversion – Conversion of logarithmic scale. Power by default.
- property conversion: DbConversionType[source]¶
Logarithmic conversion type.
Returns: Conversion type.