level_ratio library

Provides type-safe units for logarithmic level ratios.

Import this file to use LevelRatio quantities and their num extensions (like 3.dB or 1.Np).

Classes

AffineQuantity<T extends Unit<T>, Q extends AffineQuantity<T, Q>>
Base class for quantities whose conversions are affine instead of purely multiplicative.
InverseQuantity<T extends Unit<T>, Q extends InverseQuantity<T, Q>>
Base class for quantities whose conversions route through a reciprocal canonical form.
LevelRatio
Represents a logarithmic level ratio such as gain or attenuation.
LinearQuantity<T extends LinearUnit<T>, Q extends LinearQuantity<T, Q>>
An abstract base class for physical quantities with linear (factor-based) unit conversions.
LinearUnit<T extends LinearUnit<T>>
A contract for units that scale linearly (via a simple multiplier).
LogarithmicQuantity<T extends Unit<T>, Q extends LogarithmicQuantity<T, Q>>
Base class for quantities that represent logarithmic levels of another physical dimension.
Quantity<T extends Unit<T>>
An abstract representation of a physical quantity, encapsulating a numerical value and a specific unit of measurement.
Unit<T extends Unit<T>>
A base contract for all unit enums.

Enums

LevelRatioUnit
Represents units of logarithmic level ratio.

Extensions

LevelRatioCreation on num
Provides convenient factory methods for creating LevelRatio instances.
LevelRatioValueGetters on LevelRatio
Provides convenient access to LevelRatio values in specific units.