math (pmrf.math)

Core maths functions.

Modules

aggregations

Aggregations of arrays (vectors, tensors) into lower dimensions.

losses

Common loss functions for optimization.

Functions

complex_2_magnitude(z)

Return the magnitude of the complex argument.

complex_2_db(z)

Return the magnitude in dB of a complex number (as \(20\log_{10}(|z|)\)).

complex_2_db10(z)

Return the magnitude in dB of a complex number (as \(10\log_{10}(|z|)\)).

complex_2_radian(z)

Return the angle complex argument in radian.

complex_2_degree(z)

Returns the angle complex argument in degrees.

complex_2_quadrature(z)

Take a complex number and returns quadrature, which is (length, arc-length from real axis).

complex_2_reim(z)

Return real and imaginary parts of a complex number.

complex_components(z)

Break up a complex array into all possible scalar components.

magnitude_2_db(z[, zero_nan])

Convert linear magnitude to dB.

mag_2_db(z[, zero_nan])

Convert linear magnitude to dB.

mag_2_db10(z[, zero_nan])

Convert linear magnitude to dB (factor 10).

db_2_magnitude(z)

Convert dB to linear magnitude.

db_2_mag(z)

Convert dB to linear magnitude.

db10_2_mag(z)

Convert dB (factor 10) to linear magnitude.

magdeg_2_reim(mag, deg)

Convert linear magnitude and phase (in deg) arrays into a complex array.

dbdeg_2_reim(db, deg)

Convert dB magnitude and phase (in deg) arrays into a complex array.

db_2_np(db)

Convert a value in decibel (dB) to neper (Np).

np_2_db(x)

Convert a value in Nepers (Np) to decibel (dB).

radian_2_degree(rad)

Convert angles from radians to degrees.

degree_2_radian(deg)

Convert angles from degrees to radians.

feet_2_meter([feet])

Convert length in feet to meter.

meter_2_feet([meter])

Convert length in meter to feet.

db_per_100feet_2_db_per_100meter([...])

Convert attenuation values given in dB/100ft to dB/100m.

polar_2_rect(radii, angles[, deg])

Convert polar coordinates to rectangular (complex) coordinates.

rect_2_polar(x[, deg])

Convert rectangular (complex) coordinates to polar coordinates.

sqrt_phase_unwrap(z)

Take the square root of a complex number with unwrapped phase.

complexify(f[, name])

Make a function f(scalar) into f(complex).