| Signal Processing Blockset™ | ![]() |
Signal Operations
dspsigops
The Unwrap block unwraps each input channel by adding or subtracting appropriate multiples of 2π to each channel element. The input can be any matrix or 1-D vector, and must have radian phase entries. The block recognizes phase discontinuities larger than the Tolerance parameter setting.
The block preserves the input size, dimension, and frame status, and the output port rate equals the input port rate. For a detailed discussion of the Unwrap block, see other sections of this reference page.
The Unwrap block preserves the input size, dimension, and frame status, and the output port rate equals the input port rate.
| Characteristics of Valid Input | Characteristics of Corresponding Output |
|---|---|
Input elements must be phase values in radians. Sample- or frame-based M-by-N 2-D matrix or a 1-D vector | Output elements are phase values in radians. Same frame status as input Same size and dimension as input Output port rate = input port rate |
You must specify the unwrap mode by setting the parameter, Do not unwrap phase discontinuities between successive frames. The unwrap modes are summarized in the next table.
Two Unwrap Modes | |
|---|---|
In both unwrap modes, the block adds 2πk to each input channel's elements, where it updates k at each phase discontinuity. (For more on the updating of k, see Unwrap Method.) The number of times that k is reset to 0 depends on the unwrap mode. | |
| Default Unwrap Mode: Initialize k to 0 for Only the First Input Frame | Nondefault Unwrap Mode: Set k to 0 for Each Successive Input Matrix or Input Vector |
|
In this mode, k is initialized to 0 for only the first input matrix or input vector. As k gets updated, the value of k is retained between successive input matrices or input vectors. That is, the block unwraps each input's channel by considering phase discontinuities in all previous frames and the current frame. |
In this mode, k is reset to 0 for each successive input matrix or input vector. As k gets updated, the value of k is only retained within the current input matrix or vector. That is, the block unwraps each input's channel by considering phase discontinuities in the current input matrix or input vector only, ignoring discontinuities in previous inputs. |
In this mode, the block unwraps the columns or each individual element of the input:
| In this mode, the block unwraps the columns or rows of the input:
|
See the following diagrams. | See the following diagrams. |
The following diagrams illustrate how the two unwrap modes operate on various inputs.


The Unwrap block unwraps each channel of its input matrix or input vector by adding 2πk to each successive channel element, and updating k at each phase jump. See the following steps to the unwrap method for details.
| Relevant Unwrap Terms: |
|---|
|
Steps to the Unwrap Method: |
|
Algorithms that compute the phase of a signal often only output phases between –π and π. For instance, such algorithms compute the phase of sin(2π + 3) to be 3, since sin(3) = sin(2π + 3), and since the actual phase, 2π + 3, is not between –π and π. Such algorithms compute the phases of sin(–4π + 3) and sin(16π + 3) to be 3 as well.
Phase unwrap or unwrap is a process often used to reconstruct a signal's original phase. Unwrap algorithms add appropriate multiples of 2π to each phase input to restore original phase values, as illustrated in the following diagram. For more on phase unwrap, see the previous section, Unwrap Method.



When this parameter is cleared, the block unwraps each input's channels (the input channels are the columns of frame-based inputs and each element of sample-based inputs). When you select this parameter, the block unwraps each row of sample-based row vector inputs, and unwraps the columns of all other inputs, where each input matrix or input vector is treated as completely unrelated to the other input matrices or input vectors. 1-D vector inputs are always treated as frame-based column vectors. See The Two Unwrap Modes.
The jump size that the block recognizes as a true phase discontinuity. The default is set to π (rather than a smaller value) to avoid altering legitimate signal features. To increase the block's sensitivity, set Tolerance to a value slightly less than π.
Double-precision floating point
Single-precision floating point
| unwrap | MATLAB |
![]() | Uniform Encoder | Upsample | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |