comnum.w2dbm#

comnum.w2dbm(p_w)#

Convert a power in watts to dBm, 10 log10 P + 30.

Parameters:

p_w (float | array_like) – the power (W).

Returns:

the power (dBm).

Return type:

float | numpy.ndarray

Raises:

ValueError – for values that are not real numbers.

Examples

>>> import comnum
>>> comnum.w2dbm(1e-3)
0.0