# Unwrap Phase (G Dataflow)

Unwraps an array of phases by eliminating discontinuities whose absolute values exceed either pi or 180.

## input phase

Input array of phases to unwrap.

## phase unit

Units for the input phases and unwrapped phases.

Name Value Description
degree in, degree out 2 Degree in, degree out

## error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

## unwrapped phase

Unwrapped phases.

## error out

Error information. The node produces this output according to standard error behavior.

## Algorithm for Unwrapping Phases

When the difference between two adjacent values in input phase exceeds $\pi$, and phase unit is Radian in, radian out, this node uses the following equation to calculate unwrapped phase:

$P_Out\left[i\right]=\left\{\begin{array}{cc}P\left[i\right]-⌊\frac{P\left[i\right]-P\left[i-1\right]}{2\pi }+0.5⌋*2\pi & i=1,\dots ,\text{\hspace{0.17em}}N-1\\ P\left[i\right]& i=0\end{array}$

where

• P_out is unwrapped phase
• P is input phase
• N is the length of input phase
• $⌊⌋$ is the floor operation

This node uses similar equations to calculate unwrapped phase for the other units you specify in phase unit.

## Effects of Unwrapping Phases

The following two graphs show the effects of unwrapping the phase. The first graph shows the original phase before unwrapping, and the second graph shows the phase after unwrapping.

## Unwrapping Phase Response of a Linear Time-Invariant System

You can apply this node to the computed phase response of a linear time-invariant system. The phase response is defined as the complex angle of the frequency response of a system. You compute the phase response as angles within [- $\pi$, $\pi$], or, in other words, as angles within one circle of 2* $\pi$ radians. Because multiples of 2* $\pi$ wrap when you compute the phase response, often there are discontinuities in the phase response from one frequency bin to the next.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported