tools
module for common rf functions and utilities.
db20(*kwargs)
¶
Return the decibel value of the sum of the given complex number.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kwargs
|
input complex numbers |
()
|
Returns:
Type | Description |
---|---|
sum of absolute value of the input complex numbers in decibel examples: db20(1) -> 0 db20(0.5,0.5) -> 0 |
Source code in hades\models\tools.py
8 9 10 11 12 13 14 15 16 17 18 |
|
eng(x, precision=3, prefix=True)
¶
Convert a number to engineer notation (notation with an exponent multiple of 3).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
number to convert |
required |
precision
|
int
|
after comma digit number. |
3
|
prefix
|
bool
|
If True, return number with prefix letters (fe: 1.3 p). If False, return number with exponent (fe: 1.3e3). |
True
|
Returns:
Type | Description |
---|---|
str
|
string representing the number |
Source code in hades\models\tools.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
norm_diff(a, b)
¶
return the normalized difference of two numbers a and b.
Source code in hades\models\tools.py
28 29 30 31 32 |
|
quality(z)
¶
Return the quality factor of an impedance.
Source code in hades\models\tools.py
21 22 23 24 25 |
|