Skip to content

Commit aa54a7e

Browse files
committed
ulab: update documentation
1 parent 69aa010 commit aa54a7e

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

shared-bindings/ulab/__init__.rst

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ ulab.array -- 1- and 2- dimensional array
3333
:param sequence values: Sequence giving the initial content of the array.
3434
:param dtype: The type of array values, ``int8``, ``uint8``, ``int16``, ``uint16``, or ``float``
3535

36-
The `values` sequence can either be a sequence of numbers (in which case a
37-
1-dimensional array is created), or a sequence where each subsequence has
38-
the same length (in which case a 2-dimensional array is created).
36+
The `values` sequence can either be another ~ulab.array, sequence of numbers
37+
(in which case a 1-dimensional array is created), or a sequence where each
38+
subsequence has the same length (in which case a 2-dimensional array is
39+
created).
40+
41+
Passing a ~ulab.array and a different dtype can be used to convert an array
42+
from one dtype to another.
3943

4044
In many cases, it is more convenient to create an array from a function
4145
like `zeros` or `linspace`.
@@ -209,9 +213,20 @@ much more efficient than expressing the same operation as a Python loop.
209213

210214
Computes the inverse hyperbolic sine function
211215

216+
.. method:: around(a, \*, decimals)
217+
218+
Returns a new float array in which each element is rounded to
219+
``decimals`` places.
220+
212221
.. method:: atan
213222

214-
Computes the inverse tangent function
223+
Computes the inverse tangent function; the return values are in the
224+
range [-pi/2,pi/2].
225+
226+
.. method:: atan2(y,x)
227+
228+
Computes the inverse tangent function of y/x; the return values are in
229+
the range [-pi, pi].
215230

216231
.. method:: atanh
217232

@@ -290,6 +305,14 @@ much more efficient than expressing the same operation as a Python loop.
290305

291306
.. module:: ulab.linalg
292307

308+
.. method:: cholesky(A)
309+
310+
:param ~ulab.array A: a positive definite, symmetric square matrix
311+
:return ~ulab.array L: a square root matrix in the lower triangular form
312+
:raises ValueError: If the input does not fulfill the necessary conditions
313+
314+
The returned matrix satisfies the equation m=LL*
315+
293316
.. method:: det
294317

295318
:param: m, a square matrix
@@ -360,6 +383,9 @@ much more efficient than expressing the same operation as a Python loop.
360383

361384
Perform a Fast Fourier Transform from the time domain into the frequency domain
362385

386+
See also ~ulab.extras.spectrogram, which computes the magnitude of the fft,
387+
rather than separately returning its real and imaginary parts.
388+
363389
.. method:: ifft(r, c=None)
364390

365391
: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.
368394

369395
Perform an Inverse Fast Fourier Transform from the frequeny domain into the time domain
370396

371-
.. method:: spectrum(r):
372-
373-
:param ulab.array r: A 1-dimension array of values whose size is a power of 2
374-
375-
Computes the spectrum of the input signal. This is the absolute value of the (complex-valued) fft of the signal.
376-
377397
:mod:`ulab.numerical` --- Numerical and Statistical functions
378398
=============================================================
379399

@@ -448,3 +468,14 @@ operate over the flattened array (None), rows (0), or columns (1).
448468
.. method:: polyval(p, x)
449469

450470
Evaluate the polynomial p at the points x. x must be an array.
471+
472+
:mod:`ulab.extras` --- Additional functions not in numpy
473+
========================================================
474+
475+
.. method:: spectrum(r):
476+
477+
:param ulab.array r: A 1-dimension array of values whose size is a power of 2
478+
479+
Computes the spectrum of the input signal. This is the absolute value of the (complex-valued) fft of the signal.
480+
481+
This function is similar to scipy's ``scipy.signal.spectrogram``.

0 commit comments

Comments
 (0)