www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/UnwrapInputPhaseDataExample.m

    %% Unwrap input phase data
%%
% *Note*: This example runs only in R2016b or later. If you are using an
% earlier release, replace each call to the function with the equivalent
% |step| syntax. For example, myObject(x) becomes step(myObject,x).

%%
hunwrap = dsp.PhaseUnwrapper;
p = [0 2/5 4/5 -4/5 -2/5 0 2/5 4/5 -4/5 -2/5 0 2/5 ...
    4/5 -4/5, -2/5]*pi;
y = hunwrap(p');
figure,stem(p); hold
stem(y, 'r');
legend('Input (blue)','Unwrapped data (red)');
hold off;