summaryrefslogtreecommitdiff
path: root/shared-bindings/ulab/__init__.rst
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2020-03-17 15:33:08 -0700
committerGitHub <noreply@github.com>2020-03-17 15:33:08 -0700
commit4603c6ddd7aaccc5674db135fe3951e475ea05d8 (patch)
tree238adb6865105638b47fa6a21b4be5d8afbf74df /shared-bindings/ulab/__init__.rst
parent9453e10c57deee12f895466d872e3e9198c73f7d (diff)
parent38a718ff5558c2286172091615aaeb2ded5f70f5 (diff)
Merge pull request #2711 from jepler/update-ulab5.1.0-rc.05.1.0
update ulab
Diffstat (limited to 'shared-bindings/ulab/__init__.rst')
-rw-r--r--shared-bindings/ulab/__init__.rst51
1 files changed, 41 insertions, 10 deletions
diff --git a/shared-bindings/ulab/__init__.rst b/shared-bindings/ulab/__init__.rst
index b2933be79..1379e56f3 100644
--- a/shared-bindings/ulab/__init__.rst
+++ b/shared-bindings/ulab/__init__.rst
@@ -33,9 +33,13 @@ ulab.array -- 1- and 2- dimensional array
:param sequence values: Sequence giving the initial content of the array.
:param dtype: The type of array values, ``int8``, ``uint8``, ``int16``, ``uint16``, or ``float``
- The `values` sequence can either be a sequence of numbers (in which case a
- 1-dimensional array is created), or a sequence where each subsequence has
- the same length (in which case a 2-dimensional array is created).
+ The `values` sequence can either be another ~ulab.array, sequence of numbers
+ (in which case a 1-dimensional array is created), or a sequence where each
+ subsequence has the same length (in which case a 2-dimensional array is
+ created).
+
+ Passing a ~ulab.array and a different dtype can be used to convert an array
+ from one dtype to another.
In many cases, it is more convenient to create an array from a function
like `zeros` or `linspace`.
@@ -209,9 +213,20 @@ much more efficient than expressing the same operation as a Python loop.
Computes the inverse hyperbolic sine function
+.. method:: around(a, \*, decimals)
+
+ Returns a new float array in which each element is rounded to
+ ``decimals`` places.
+
.. method:: atan
- Computes the inverse tangent function
+ Computes the inverse tangent function; the return values are in the
+ range [-pi/2,pi/2].
+
+.. method:: atan2(y,x)
+
+ Computes the inverse tangent function of y/x; the return values are in
+ the range [-pi, pi].
.. method:: atanh
@@ -290,6 +305,14 @@ much more efficient than expressing the same operation as a Python loop.
.. module:: ulab.linalg
+.. method:: cholesky(A)
+
+ :param ~ulab.array A: a positive definite, symmetric square matrix
+ :return ~ulab.array L: a square root matrix in the lower triangular form
+ :raises ValueError: If the input does not fulfill the necessary conditions
+
+ The returned matrix satisfies the equation m=LL*
+
.. method:: det
:param: m, a square matrix
@@ -360,6 +383,9 @@ much more efficient than expressing the same operation as a Python loop.
Perform a Fast Fourier Transform from the time domain into the frequency domain
+ See also ~ulab.extras.spectrum, which computes the magnitude of the fft,
+ rather than separately returning its real and imaginary parts.
+
.. method:: ifft(r, c=None)
:param ulab.array r: A 1-dimension array of values whose size is a power of 2
@@ -368,12 +394,6 @@ much more efficient than expressing the same operation as a Python loop.
Perform an Inverse Fast Fourier Transform from the frequeny domain into the time domain
-.. method:: spectrum(r):
-
- :param ulab.array r: A 1-dimension array of values whose size is a power of 2
-
- Computes the spectrum of the input signal. This is the absolute value of the (complex-valued) fft of the signal.
-
:mod:`ulab.numerical` --- Numerical and Statistical functions
=============================================================
@@ -448,3 +468,14 @@ operate over the flattened array (None), rows (0), or columns (1).
.. method:: polyval(p, x)
Evaluate the polynomial p at the points x. x must be an array.
+
+:mod:`ulab.extras` --- Additional functions not in numpy
+========================================================
+
+.. method:: spectrum(r):
+
+ :param ulab.array r: A 1-dimension array of values whose size is a power of 2
+
+ Computes the spectrum of the input signal. This is the absolute value of the (complex-valued) fft of the signal.
+
+ This function is similar to scipy's ``scipy.signal.spectrogram``.