What is the difference between phase and angle commands in Matlab? THey seem to giv different results for the same input
Ref:
Matlab help for phase
PHASE Computes the phase of a complex vector
PHI=phase(G)
G is a complex-valued row vector and PHI is returned as its
phase (in radians), with an effort made to keep it continuous
over the pi-borders.
Matlab help for angle
ANGLE Phase angle.
ANGLE(H) returns the phase angles, in radians, of a matrix with
complex elements.
Class support for input X:
float: double, single
Also, can you please explain in simple terms what exactly is the use of the uwrap command?
At first, ANGLE command is from MATLAB core, PHASE from system identification toolbox.
ANGLE command always give result in range [-pi, pi].
PHASE command is more complex. If you have two adjacent points in input vector with phase near pi, for example
X=[-1+0.1i -1-0.1i]
phase(X) command will give answer greater than pi for the second value (difference between phases values should be less than pi).
At this time angle(X) command will give value near -pi for the second argument (wrap values into range [-pi, pi]). E.g.
phase(X(2)) = angle(X(2)) + 2*pi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With