MATLAB Function Reference    

Correct phase angles to produce smoother phase plots



Q = unwrap(P) corrects the radian phase angles in a vector P by adding multiples of when absolute jumps between consecutive elements of P are greater than the default jump tolerance of radians. If P is a matrix, unwrap operates columnwise. If P is a multidimensional array, unwrap operates on the first nonsingleton dimension.

Q = unwrap(P,tol) uses a jump tolerance tol instead of the default value, .

Q = unwrap(P,[],dim) unwraps along dim using the default tolerance.

Q = unwrap(P,tol,dim) uses a jump tolerance of tol.


Example 1. The following phase data comes from the frequency response of a third-order transfer function. The phase curve jumps 3.5873 radians between w = 3.0 and w = 3.5, from -1.8621 to 1.7252.

Using unwrap to correct the phase angle, the resulting jump is 2.6959, which is less than the default jump tolerance . This figure plots the new curve over the original curve.

Example 2. Array P features smoothly increasing phase angles except for discontinuities at elements (3,1) and (1,2).

The function Q = unwrap(P) eliminates these discontinuities.

See Also

abs, angle

  unregisterevent (COM) unzip