<< unshiftdata | FOSSEE_Signal_Processing_Toolbox | upfirdn >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > unwrap2

# unwrap2

Unwrap radian phases in an input array.

### Syntax

    retval = unwrap2(x)
    retval = unwrap2(x, tol)
    retval = unwrap2(x, tol, dim)

### Parameters

x:

  Input array containing radian phases to be unwrapped.

tol (optional):

  Tolerance parameter specifying the maximum jump allowed between consecutive phases before adding or subtracting 2π. Defaults to π.

dim (optional):

  Dimension along which to unwrap the phases. If unspecified, dim defaults to the first non-singleton dimension of the array x.

retval:

  Array with unwrapped radian phases.

### Description

The `unwrap2` function adjusts radian phases in the input array `x` by adding or subtracting multiples of 2π as necessary to remove phase jumps that exceed the specified tolerance `tol`. If `tol` is not provided, it defaults to π. The function operates along the specified dimension `dim` or the first non-singleton dimension if `dim` is not provided.

### Examples

    // Unwrap a vector of radian phases:
    x = [0, %pi/2, %pi, -%pi, -%pi/2]
    retval = unwrap2(x)

### Authors

- FOSSEE Team
- toolbox@scilab.in

### See also

- permute

Report an issue
<< unshiftdata | FOSSEE_Signal_Processing_Toolbox | upfirdn >>