mathFunctions (skrf.mathFunctions)
Provides commonly used mathematical functions.
Mathematical Constants
Some convenient constants are defined in the skrf.constants module.
Complex Component Conversion
Return real and imaginary parts of a complex number. |
|
Return the magnitude of the complex argument. |
|
|
Return the magnitude in dB of a complex number (as \(20\log_{10}(|z|)\)).. |
Return the magnitude in dB of a complex number (as \(10\log_{10}(|z|)\)). |
|
Return the angle complex argument in radian. |
|
Returns the angle complex argument in degree. |
|
Return the magnitude of the complex argument. |
|
Take a complex number and returns quadrature, which is (length, arc-length from real axis) |
|
Break up a complex array into all possible scalar components. |
Magnitude and decibel
|
Convert linear magnitude to dB. |
|
Convert linear magnitude to dB. |
|
Convert linear magnitude to dB. |
Convert dB to linear magnitude. |
|
|
Convert dB to linear magnitude. |
|
Convert dB to linear magnitude. |
Phase Unwrapping
|
Unwraps a phase given in radians. |
Take the square root of a complex number with unwrapped phase. |
Unit Conversion
|
Convert angles from radians to degrees. |
|
Convert angles from degrees to radians. |
|
Converts a value in Nepers (Np) to decibel (dB). |
|
Converts a value in decibel (dB) to neper (Np). |
|
Convert length in feet to meter. |
|
Convert length in meter to feet. |
Convert attenuation values given in dB/100ft to dB/100m. |
Scalar-Complex Conversion
These conversions are useful for wrapping other functions that don’t support complex numbers.
Serialize a list/array of complex numbers |
|
Unserialize a list/array of real and imag numbers into a complex array. |
Special Functions
|
Calculate Dirac function. |
|
Calculate Neumans number. |
|
Calculate the null space of matrix A. |
|
Calculate the cross ratio of a quadruple of distinct points on the real line. |
Random Number Generation
|
Set the global |
|
Obtain the global |
|
Creates a complex random array of shape s. |
Various Utility Functions
|
Convert a one sided complex spectrum into a real time-signal. |
|
Interpolates function using rational polynomials of degree d. |
|
Transforms S-parameters to time-domain bandpass. |
|
Transforms S-parameters to time-domain, assuming complex conjugates for values corresponding to negative frequencies. |
|
Tests whether mat is a square matrix. |
|
Tests mat for symmetry. |
|
Tests whether mat is Hermitian. |
|
Tests mat for positive definiteness. |
|
Tests mat for positive semidefiniteness. |
Returns the conjugate transpose of mat. |
|
|
Return the square root of a complex number, with sign chosen to match z_approx. |
|
Create new vector from z1, z2 choosing elements with sign matching z_approx. |
|
Return z1 or z2 depending on which is closer to z_approx. |
|
Convert inf and -inf's to large numbers. |
|
Solves x @ A = B. |
|
Nudge eigenvalues with absolute value smaller than max(cond * max(eigenvalue), min_eig) to that value. |