Unwrap Signal Phase - Simulink - MathWorks India
Unwrap Signal Phase - Simulink - MathWorks India
Unwrap Signal Phase - Simulink - MathWorks India
Unwrap
Unwrap signal phase
Library
Signal Operations
dspsigops
Description
The Unwrap block unwraps each channel of the input by adding or subtracting appropriate multiples of 2π to each
channel element. The input can be a vector or matrix, and must have radian phase entries. The block recognizes phase
discontinuities larger than the Tolerance parameter setting. For more information about phase unwrapping, see the
Definition of Phase Unwrap.
The block preserves the input size and dimension, and the output port rate equals the input port rate.
Unwrap Method
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. A phase jump occurs when the difference between two adjacent phase
value entries exceeds the value of the Tolerance parameter.
The following code illustrates how the block unwraps the data in a given input channel u.
k=0; % initialize k to 0
i=1; % initialize the counter to 1
alpha=pi; % set alpha to the desired Tolerance. In this case, pi
for i = 1:(size(u)-1)
yout(i,:)=u(i)+(2*pi*k); % add 2*pi*k to ui
if((abs(u(i+1)-u(i)))>(abs(alpha))) %if diff is greater than alpha, increment or decreme
Frame-Based Processing
When you configure the block to perform frame-based processing, the block supports two different unwrap modes. In
both modes, the block adds 2πk to each input channel's elements, and updates k at each phase discontinuity. The
difference between the two modes is how often the block resets the initial phase value (k) to zero. You can choose to
unwrap data across frame boundaries (default), or to unwrap only within input frames, by resetting the initial phase
value each time a new input frame is received.
https://in.mathworks.com/help/dsp/ref/unwrap.html?s_tid=gn_loc_drop 1/5
2/2/2018 Unwrap signal phase - Simulink - MathWorks India
Sample-Based Processing
When you configure the block to perform sample-based processing, the block treats each element of the input as an
individual channel. The block unwraps the data in each channel of the input, and does not reset the initial phase to zero
each time a new input is received. The following figure illustrates how the block unwraps data when performing sample-
based processing.
https://in.mathworks.com/help/dsp/ref/unwrap.html?s_tid=gn_loc_drop 2/5
2/2/2018 Unwrap signal phase - Simulink - MathWorks India
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.
See Unwrap Method for more information on the unwrap algorithm used by this block.
https://in.mathworks.com/help/dsp/ref/unwrap.html?s_tid=gn_loc_drop 3/5
2/2/2018 Unwrap signal phase - Simulink - MathWorks India
Parameters
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 the Tolerance to a value
slightly less than π.
Input processing
Specify how the block should process the input. You can set this parameter to one of the following options:
• Columns as channels (frame based) (default) — When you select this option, the block treats each column
of the input as a separate channel.
• Elements as channels (sample based) — When you select this option, the block treats each element of the
input as a separate channel.
https://in.mathworks.com/help/dsp/ref/unwrap.html?s_tid=gn_loc_drop 4/5
2/2/2018 Unwrap signal phase - Simulink - MathWorks India
This parameter is available only when you configure the block to perform frame-based processing. In sample-based
processing mode, the block does not reset the initial phase value to zero for each new input. See Sample-Based
Processing for more information.
See Also
unwrap MATLAB
https://in.mathworks.com/help/dsp/ref/unwrap.html?s_tid=gn_loc_drop 5/5