Package org.apache.sis.measure
Class PowerOf10
java.lang.Object
org.apache.sis.measure.AbstractConverter
org.apache.sis.measure.PowerOf10
- All Implemented Interfaces:
Serializable,javax.measure.UnitConverter
Conversions from units represented by a logarithm in base 10.
- Since:
- 1.0
- Version:
- 1.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final javax.measure.UnitConverterThe singleton instance.private static final doubleValue ofMath.log(10).private static final longFor cross-version compatibility. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static javax.measure.UnitConverterbelToOne()Returns the converter from bel unit (B) to dimensionless unit.doubleconvert(double value) Applies the unit conversion on the given value.doublederivative(double value) Returns the derivative of this conversion at the given value.booleanCompares this converter with the given object for equality.inthashCode()Returns a hash code value for this unit converter.javax.measure.UnitConverterinverse()Returns the inverse of this converter.private ObjectReturns the singleton instance on deserialization.toString()Returns a string representation of this converter for debugging purpose.Methods inherited from class org.apache.sis.measure.AbstractConverter
coefficients, concatenate, convert, derivative, doubleValue, epsilonEquals, getConversionSteps, isIdentity, isLinear, scale
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
LN_10
private static final double LN_10Value ofMath.log(10).- See Also:
-
INSTANCE
private static final javax.measure.UnitConverter INSTANCEThe singleton instance. Can be used for conversion from neper units toUnits.UNITY.
-
-
Constructor Details
-
PowerOf10
private PowerOf10()Creates the singleton instance.
-
-
Method Details
-
belToOne
static javax.measure.UnitConverter belToOne()Returns the converter from bel unit (B) to dimensionless unit. ISO 80000-3:2006 defines 1 B = ln(10)/2 Np (neper) and 1 Np = 1 (dimensionless), keeping in mind that neper is a logarithmic scale using the natural logarithm. The ln(10) factor is for converting from base ℯ to base 10.The method of expressing a ratio as a level in decibels depends on whether the measured property is a power quantity or a root-power quantity (amplitude of a field). This is because power is often proportional to the square of the amplitude. The /2 in above equation is for taking the square root of a power, since B is used for power and Np is used for root-power.
The bel represents the logarithm of a ratio between two power quantities of 10:1. Two signals whose levels differ by x bels have a power ratio of 10^x and an amplitude (field quantity) ratio of 10^(x/2).
- See Also:
-
readResolve
Returns the singleton instance on deserialization.- Throws:
ObjectStreamException
-
inverse
public javax.measure.UnitConverter inverse()Returns the inverse of this converter. -
convert
public double convert(double value) Applies the unit conversion on the given value. -
derivative
public double derivative(double value) Returns the derivative of this conversion at the given value.- Specified by:
derivativein classAbstractConverter- Parameters:
value- the point at which to compute the derivative. Ignored (can beDouble.NaN) if the conversion is linear.
-
equals
Compares this converter with the given object for equality. -
hashCode
public int hashCode()Returns a hash code value for this unit converter. -
toString
Returns a string representation of this converter for debugging purpose.
-