tftb package¶
Subpackages¶
- tftb.generators package
- Subpackages
- tftb.generators.tests package
- Submodules
- tftb.generators.tests.test_amplitude_modulations module
- tftb.generators.tests.test_analytic_signals module
- tftb.generators.tests.test_frequency_modulations module
- tftb.generators.tests.test_misc module
- tftb.generators.tests.test_noise module
- tftb.generators.tests.test_utils module
- Module contents
- tftb.generators.tests package
- Submodules
- tftb.generators.amplitude_modulated module
- tftb.generators.analytic_signals module
- tftb.generators.frequency_modulated module
- tftb.generators.misc module
- tftb.generators.noise module
- tftb.generators.utils module
- Module contents
- Subpackages
- tftb.processing package
- Submodules
- tftb.processing.affine module
- tftb.processing.ambiguity module
- tftb.processing.base module
- tftb.processing.cohen module
- tftb.processing.freq_domain module
- tftb.processing.linear module
- tftb.processing.plotifl module
- tftb.processing.postprocessing module
- tftb.processing.reassigned module
- tftb.processing.time_domain module
- tftb.processing.utils module
- Module contents
- tftb.tests package
Submodules¶
tftb.utils module¶
Miscellaneous utilities.
-
tftb.utils.
divider
(N)[source]¶ Compute two factors of N such that they are as close as possible to sqrt(N).
Parameters: N (int) – Number to be divided. Returns: A tuple of two integers such that their product is N and they are the closest possible to \(\sqrt(N)\) # NOQA: W605 Return type: tuple(int) Example: >>> from __future__ import print_function >>> print(divider(256)) (16.0, 16.0) >>> print(divider(10)) (2.0, 5.0) >>> print(divider(101)) (1.0, 101.0)
-
tftb.utils.
is_linear
(x, decimals=5)[source]¶ Check if an array is linear.
Parameters: - x (numpy.ndarray) – Array to be checked for linearity.
- decimals (int) – decimal places upto which the derivative of the array should be rounded off (default=5)
Returns: If the array is linear
Return type: boolean
Example: >>> import numpy as np >>> x = np.linspace(0, 2 * np.pi, 100) >>> is_linear(x) True >>> is_linear(np.sin(x)) False
-
tftb.utils.
modulo
(x, N)[source]¶ Compute the congruence of each element of x modulo N.
Returns: array-like Example: >>> from __future__ import print_function >>> print(modulo(range(1, 11), 2)) [1 2 1 2 1 2 1 2 1 2]
-
tftb.utils.
nearest_odd
(N)[source]¶ Get the nearest odd number for each value of N.
Parameters: N – int / sequence of ints Returns: int / sequence of ints Example: >>> from __future__ import print_function >>> print(nearest_odd(range(1, 11))) [ 1. 3. 3. 5. 5. 7. 7. 9. 9. 11.] >>> nearest_odd(0) 1 >>> nearest_odd(3) 3.0
-
tftb.utils.
nextpow2
(n)[source]¶ Compute the integer exponent of the next higher power of 2.
Parameters: n (int, np.ndarray) – Number whose next higest power of 2 needs to be computed. Return type: int, np.ndarray Example: >>> from __future__ import print_function >>> import numpy as np >>> x = np.arange(1, 9) >>> print(nextpow2(x)) [ 0. 1. 2. 2. 3. 3. 3. 3.]