From: Maarten van der Burgt on
Hallo,

Looking for Mathematica code for phase unwrapping I found the following
1-dimensional phase unwrappers:

from
http://documents.wolfram.com/applications/signals/CepstralAnalysis.html
:

unwrapphase[data_?VectorQ,tol_:Pi,inc_:2 Pi]:=data+inc
FoldList[Plus,0,Sign[Chop[Apply[Subtract,Partition[data,2,1],{1}],tol]]]

and from
http://forums.wolfram.com/mathgroup/archive/2007/Mar/msg00806.html

(***********UnwrapPhase follows*************)
UnwrapPhase[data_?VectorQ,tol_:Pi,inc_:2 Pi]:=
FixedPoint[
#+inc*FoldList[
Plus,0.,Sign[
Chop[
ListCorrelate[{1,-1},#],tol
] (*close Chop*)
] (*close Sign*)
]&,(*close FoldList*)
data] (*close FixedPoint and overall function*)

UnwrapPhase[list:{{_,_}..}]:=Transpose[{list[[All,1]],UnwrapPhase[list[=
[
All,-1]]]}]
(***********UnwrapPhase above*************)

An example of its use:

data = Table[Mod[ 20 Sin[x], 2 \[Pi]], {x, 0, \[Pi], 0.01}];
ListLinePlot[data]
ListLinePlot[UnwrapPhase[data]]

These both work fine when the data is not too noisy and can be easily
used on 2D lists by applying the unwrap function once on the rows and
subsequentially on the columns.

In the presence of noise a lot of different methods have been work out
as e.g. in:
Two-Dimensional Phase Unwrapping: Theory, Algorithms, and Software
by Dennis C. Ghiglia and Mark D. Pritt.

Has anyone implemented any of these methods in Mathematica?
Are there andy Mathematica packages available with more advanced phase
unwrapping routines?

Thanks for any suggestion,

Maarten van der Burgt
Leuven
Belgium