DSP Blockset    
Unwrap

Unwrap the phase of a signal.

Library

Signal Operations

Description

The Unwrap block unwraps each input channel by adding or subtracting appropriate multiples of   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.

Sections of This Reference Page

Acceptable Inputs and Corresponding Output Characteristics

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

The Two Unwrap Modes

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 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:
  • Frame-based inputs -- unwrap columns
  • Sample-based inputs -- unwrap each element of the input.
  • 1-D vector inputs -- treat as frame-based column
In this mode, the block unwraps the columns or rows of the input:
  • Frame-based inputs -- unwrap columns
  • Sample-based nonrow inputs -- unwrap columns
  • Sample-based row vector inputs -- unwrap the row.
  • 1-D vector inputs -- treat as frame-based column
See the following diagrams.
See the following diagrams.

The following diagrams illustrate how the two unwrap modes operate on various inputs.

Unwrap Method

The Unwrap block unwraps each channel of its input matrix or input vector by adding   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:
  • ui --  ith element of the input channel on which the algorithm operates
  •  -- Tolerance parameter value
  • phase jump or phase discontinuity -- difference between phase values of two adjacent channel entries that exceeds  . The diagram in the next section indicates phase jumps with red arrows.
   
Steps to the Unwrap Method:
  1. Set k to 0 (See The Two Unwrap Modes for more on how often this step occurs.)
  2. Check for a phase jump between adjacent channel elements ui and ui+1:
    • If there is no phase jump between ui and ui+1  , add   to ui, and then repeat step 2 to continue checking for phase jumps.
    • If there is a phase jump between ui and ui+1  , add   to ui, and then go to step 3 to update k.
  3. Update k as follows when there is a phase jump between ui and ui+1. Then go back to step 2 to add the updated   value to ui+1 and succeeding channel elements until the next phase jump:
    • If   (phase jump is negative), increment k.
    • If   (phase jump is positive), decrement k.

Definition of Phase Unwrap

Algorithms that compute the phase of a signal often only output phases between   and . For instance, such algorithms compute the phase of to be 3, since  , and since the actual phase,  , is not between   and . Such algorithms compute the phases of   and   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   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.

Dialog Box

Do not unwrap phase discontinuities between successive frames
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 this parameter is set, 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.
Tolerance
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 .

Supported Data Types

To learn how to convert to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.

See Also

unwrap
MATLAB

Also see Signal Operations for a list of all the blocks in the Signal Operations library.


  Uniform Encoder Upsample