skrf.mathFunctions.mag_2_db

skrf.mathFunctions.mag_2_db(z, zero_nan=True)

Convert linear magnitude to dB.

Parameters:
  • z (number or array_like) – A complex number or sequence of complex numbers

  • zero_nan (bool, optional) – Replace NaN with zero. The default is True.

Returns:

z – Magnitude in dB given by 20*log10(|z|)

Return type:

number or array_like