Math Tools

Implementations of basic maths equations.

class DbConversionType(value)

Bases: enum.Enum

Supported db conversion types.

POWER = 0
AMPLITUDE = 1
HILLY = 2
db2lin(db_val, conversion_type=DbConversionType.POWER)

Converts from dB to linear

Parameters
  • db_val (float) – value in dB

  • conversion_type (DbConversionType, optional) – if POWER then it converts from dB to a power ratio if AMPLITUDE, then it converts from dB to an amplitude ratio default = POWER

Returns

the equivalent value in linear scale

Return type

(float)

lin2db(val, conversion_type=DbConversionType.POWER)

Converts from linear to dB

Parameters
  • val (float) – value in linear scale

  • conversion_type (DbConversionType, optional) – if POWER then it converts from a power ratio to dB if AMPLITUDE, then it converts from an amplitude ratio to dB default = POWER

Returns

(float) the equivalent value in linear scale

marcum_q(a, b, m=1)

Calculates the Marcum-Q function Q_m(a, b)

This method uses the relationship between Marcum-Q function and the chi-squared distribution

Parameters
  • a (float) –

  • b (np.array) –

  • m (float) –

Returns

the approximated Marcum-Q function for the desired parameters

Return type

(np.ndarray)

rotation_matrix(orientation)
Return type

ndarray

transform_vector(vector, position, orientation)
Return type

ndarray

transform_coordinates(coordinates, position, orientation)
Return type

ndarray

rms_value(x)

Returns the root-mean-square value of a given input vector

Return type

float