jax.numpy.unwrap#

jax.numpy.unwrap(p, discont=None, axis=- 1, period=6.283185307179586)[source]#

Unwrap by taking the complement of large deltas with respect to the period.

LAX-backend implementation of numpy.unwrap().

Original docstring below.

This unwraps a signal p by changing elements which have an absolute difference from their predecessor of more than max(discont, period/2) to their period-complementary values.

For the default case where period is \(2\pi\) and discont is \(\pi\), this unwraps a radian phase p such that adjacent differences are never greater than \(\pi\) by adding \(2k\pi\) for some integer \(k\).

Parameters
  • p (array_like) – Input array.

  • discont (float, optional) – Maximum discontinuity between values, default is period/2. Values below period/2 are treated as if they were period/2. To have an effect different from the default, discont should be larger than period/2.

  • axis (int, optional) – Axis along which unwrap will operate, default is the last axis.

  • period (float, optional) – Size of the range over which the input wraps. By default, it is 2 pi.

Returns

out – Output array.

Return type

ndarray