The unwrapping algorithm in 1-D ensures a more or less continous result, i.e. discontinuities are between or values, if the data or function being unwrapped is well behaved.function unwrap1D(phase_array) Nbins=length(phase_array) unwrapped=copy(phase_array) for i in 2:Nbins while unwrapped[i] - unwrapped[i-1] >= pi unwrapped[i] -= 2pi end while unwrapped[i] - unwrapped[i-1] <= -pi unwrapped[i] += 2pi end end return unwrapped end;Example of usage:using PyPlotplot(phase_data) #raw dataw1d=unwrap1D(phase_data) plot(w1d);-------Don't think that unwrapping an array always leads to continuous and smooth curves, for it only leads to curves that have at the most discontinuities of 2π. The previous example had great data to work with and therefore the resulting plot was smooth. However, if the raw data happen to be noisy or changing fastly, then the resulting array would rather have notorious discontinuities (still between π and -π) or some wiggles. Check the next example:using PyPlotplot(phase_data) #raw dataw1d=unwrap1D(phase_data) plot(w1d);
Julia: Notes and Examples
a blog for julia users
miércoles, 1 de marzo de 2017
Phase Unwrapping Function 1D
Suscribirse a:
Entradas (Atom)