p_margin — phase margin and associated crossover frequency
[phm,fr] = p_margin(h) phm=p_margin(h)
a SISO linear system (see :syslin).
a number, the phase margin in degree if it exists or an empty matrix.
a number, the corresponding frequency ( in hz) or an empty matrix.
Given a SISO linear system in continuous or discrete time,
p_margin
returns phm
, the
phase margin in degree of h
and
fr
, the achieved corresponding frequency in
hz.
The phase margin is the values of the phase at frequency
points where the nyquist plot of h
crosses the
unit circle. In other words the phase margin is the difference
between the phase of the frequency response of
h
and -180° when the gain of
h
is 1.
The algorithm uses polynomial root finder to solve the equations:
for the continuous time case.
for the discrete time case.