Extract the unwrapped phase of a complex input
The dsp.PhaseExtractor
System
object™ extracts the unwrapped phase of a real or a complex input.
To extract the unwrapped phase of a signal input:
Create the dsp.PhaseExtractor
object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects? (MATLAB).
phase = dsp.PhaseExtractor
phase = dsp.PhaseExtractor(Name,Value)
For versions earlier than R2016b, use the step
function to run the System object algorithm. The arguments to
step
are the object you created, followed by
the arguments shown in this section.
For example, y = step(obj,x)
and y = obj(x)
perform equivalent operations.
p = phase(input)
To use an object function, specify the
System
object as the first input argument. For
example, to release system resources of a System
object named obj
, use
this syntax:
release(obj)
Consider an input frame of length N:
The step
method acts on this frame and produces this output:
where:
Here, i runs from 1 to N. The angle
function returns the phase angle in radians.
If the input signal consists of multiple frames:
If you set TreatFramesIndependently
to true
,
the step
method treats each frame independently. Therefore, in each
frame, the step
method calculates the phase using the preceding
formula where:
is 0.
is 1.
If you set TreatFramesIndependently
to
false
, the step
method ignores boundaries between
frames. Therefore, in each frame, the step
method calculates the
phase using the preceding formula where:
is the last unwrapped phase from the previous frame.
is the last sample from the previous frame.