uwacan.dB#

dB(x, power=True, safe_zeros=True, ref=1)[source]#

Calculate the decibel of an input value.

Parameters:
xnumeric

The value to take the decibel of

powerboolean, default True

Specifies if the input is a power-scale quantity or a root-power quantity. For power-scale quantities, the output is 10 log(x), for root-power quantities the output is 20 log(x). If there are negative values in a power-scale input, the handling can be controlled as follows: - power='imag': return imaginary values - power='nan': return nan where power < 0 - power=True: as nan, but raises a warning.

safe_zerosboolean, default True

If this option is on, all zero values in the input will be replaced with the smallest non-zero value.

refnumeric

The reference unit for the decibel. Note that this should be in the same unit as the x input, e.g., if x is a power, the ref value might need squaring.