The problem of unwrapping 1D phase often comes up in Fourier analysis: someone computes a DFT of some data, the resulting phase values fall between $-\pi$ and $\pi$, and they'd like to "unwrap" these phase values to not be bounded to (-$\pi$,$\pi$]. It's fairly straightforward in the case of low noise and sufficient discrete sampling, as seen in the excellent answers here.
However, by working more with the continuous case and/or no noise, the essential problems typically associated with 1D phase unwrapping are not dealt with. Here's an example of where things can go wrong in a discrete case with some noise and limited sampling.
phaseUnwrap[vec_?VectorQ] := (*translation of Matlab's implementation*)
Module[{n = Length[vec], ph = Arg[vec], df},
df = Differences[ph];
Do[ph -=
2 Pi Sign[df[[k]]] PadRight[ConstantArray[0, k], n, 1],
{k, Flatten[
Position[
Abs[df], _?(# > Pi &)]]}]; ph];
data = Import["http://pastebin.com/raw/haAxt0br", "Package"];
ListPlot[phaseUnwrap[data[[;; , 2]]], Joined -> True]
Even with noise and low-ish sampling the algorithm does a pretty good job, but there are still some obvious jumps in the phase unwrapping process, notably just after point 300 and just before point 500.
Given how easy it is to pick these out by eye, it seems like there could be a simple way to correct them. Maybe minimizing the derivative somehow? Checking afterward for deviations from a linear fit?
f = BSplineFunction[ReIm[data[[All, 2]]]]; ListLinePlot[phaseUnwrap[Table[{1, I}. f[x], {x, 0, 1, 1/671}]]]
$\endgroup$