Simple phase unwrapping algorithm (1D)