|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)
dim using the default tolerance.
Q = unwrap(P,tol,dim)
uses a jump tolerance of
A jump tolerance less than has the same effect as a tolerance of . For a tolerance less than , if a jump is greater than the tolerance but less than , adding would result in a jump larger than the existing one, so |
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
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.
If you have the Control System Toolbox, you can create the data for this example with the following code.|
Example 2. Array
P features smoothly increasing phase angles except for discontinuities at elements
Q = unwrap(P) eliminates these discontinuities.