mathFunctions (skrf.mathFunctions)

Provides commonly used mathematical functions.

Mathematical Constants

Some convenient constants are defined in the skrf.constants module.

Complex Component Conversion

complex_2_reim(z)

Return real and imaginary parts of a complex number.

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 degree.

complex_2_magnitude(z)

Return the magnitude of the complex argument.

complex_2_quadrature(z)

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

Phase Unwrapping

unwrap_rad(phi)

Unwraps a phase given in radians.

sqrt_phase_unwrap(z)

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

Unit Conversion

radian_2_degree(rad)

Convert angles from radians to degrees.

degree_2_radian(deg)

Convert angles from degrees to radians.

np_2_db(x)

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

db_2_np(db)

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

Scalar-Complex Conversion

These conversions are useful for wrapping other functions that don’t support complex numbers.

complex2Scalar(z)

Serialize a list/array of complex numbers

scalar2Complex(s)

Unserialize a list/array of real and imag numbers into a complex array.

Special Functions

dirac_delta(x)

Calculate Dirac function.

neuman(x)

Calculate Neumans number.

null(A[, eps])

Calculate the null space of matrix A.

cross_ratio(a, b, c, d)

Calculate the cross ratio of a quadruple of distinct points on the real line.

Various Utility Functions

psd2TimeDomain(f, y[, windowType])

Convert a one sided complex spectrum into a real time-signal.

rational_interp(x, y[, d, epsilon, axis])

Interpolates function using rational polynomials of degree d.

ifft(x)

Transforms S-parameters to time-domain bandpass.

irfft(x[, n])

Transforms S-parameters to time-domain, assuming complex conjugates for values corresponding to negative frequencies.

is_square(mat)

Tests whether mat is a square matrix.

is_symmetric(mat[, tol])

Tests mat for symmetry.

is_Hermitian(mat[, tol])

Tests whether mat is Hermitian.

is_positive_definite(mat[, tol])

Tests mat for positive definiteness.

is_positive_semidefinite(mat[, tol])

Tests mat for positive semidefiniteness.

get_Hermitian_transpose(mat)

Returns the conjugate transpose of mat.