The “correct” phase of the frequency response

When plotting the phase of a model’s frequency response there will always be ambiguity on representing angles, after all angles are equivalent modulus $2 \pi$. However, when plotting the frequency response in a Bode plot, it is customary to unwrap the phase and display the plot as a curve whose image often spans more than $2 \pi$. In that sense, one should also care about any potential integer multiples of $2 \pi$ shifts of the curve. Yet, I have never seen a discussion on what the “correct” shift should be.

The convention I shall propose is the one I have adopted when plotting phase diagrams throughout the book. To my surprise, I found out that computer programs that can be used to draw Bode plots are often inconsistent in their plots, e.g. Matlab or Mathematica, and even for very simple examples produce plots that I would consider “incorrect.”

Take for example the non-minimum phase transfer-function

$$G(s) = \frac{s+2}{s(s^2-9s -10)}$$

which I have used in one of the step-by-step Bode plot examples. Here’s what you would get out of Matlab’s bode command:

and just the phase from Mathematica’s BodePlot command:

As you can see, the phase shift produced by Matlab and Mathematica are not the same. Compare these with my own sketch:

which agrees with Mathematica’s plot.

So why is it “correct” to start at $90^\circ$ but it is “not correct” to start at $-270^\circ$? Aren’t those angles the same? Would there be any other “correct” answer?

My explanation is based on the following observation: if $G$ is a transfer-functions with real coefficients then it is reasonable to expect that $$\angle G(-j \omega) = -\angle G(j \omega),$$ as opposed to $\angle G(-j \omega) = -\angle G(j \omega) + 2 \pi$ or some other multiple of $2\pi$.

The above expectation settles the question when $G(0)$ is finite and not zero. In this case:

  1. If $G(0) > 0$ then $$-\angle G(j0^{-}) = \angle G(j0^{+}) =0;$$
  2. If $G(0) < 0$ then $$-\angle G(j0^{-}) = \angle G(j0^{+}) = \pi^{-}$$ or $$-\angle G(j0^{-}) = \angle G(j0^{+}) = -\pi^{+}.$$

Note that which one is “correct” depends not on $\angle G(0)$ but on $\angle G(j0^+)$ which is unambiguous! If $\angle G(j\omega)$ gets smaller after departing from $G(0)<0$ then $\angle G(j0^{+}) = \pi^{-}$, otherwise, if $\angle G(j\omega)$ gets bigger after departing from $G(0)<0$ then $\angle G(j0^{+}) = -\pi^{+}$.

For instance, $G(s)=-1/(s+1)$ is such that $\angle G(j0^{+}) = \pi^{-}$, whereas $G(s)=1/(s-1)$ is such that $\angle G(j0^{+}) = -\pi^{+}$. When sketching straight-line approximations, one would add $\pi$ in the first case and subtract $\pi$ in the second! By the way, both Matlab and Mathematica produce the “right” phase plots in both cases.

If $G(0)$ is infinite, then it must have, say, $k$ poles at the origin. Using a reasoning similar to the one used to produce Nyquist plots, that is indenting the imaginary axis at the origin as done in Section 7.6, one can then expect that the phase difference

$$|\angle G(j0^{+}) – \angle G(j0^{-})| = 2|\angle G(j0^{+})| = k \pi.$$

Recall that the indentation produces a continuous change in phase, albeit one associate with a large arc. This is again enough to settle the question.

For example, consider the example and phase diagrams shown at the beginning of the post. The above argument explains why the “correct” phase should start at $90^\circ$ and not at $-270^\circ$ or any other possible offset of $360^\circ$. Indeed if $\angle G(j0^+)=-270^\circ$ then

$$2|\angle G(j0^{+})| = 2|-270^\circ| = 540^\circ = 3 \times 180^\circ$$

which is incompatible with the fact that the transfer-function has only one pole at the origin, not three. On the other hand if $\angle G(j0^+)=90^\circ$ then

$$2|\angle G(j0^{+})| = 2|90^\circ| = 180^\circ = 1 \times 180^\circ$$

which is the only answer that matches the correct numbers of poles at the origin, in this case one.

Finally the case when $G(0)=0$ with $k$ zeros at the origin can be handled similarly by again indenting the imaginary axis, this time to identify a continuous infinitesimal arc also with phase variation equal to

$$|\angle G(j0^{+}) – \angle G(j0^{-})| = 2|\angle G(j0^{+})| = k \pi.$$

Simple examples here are $G(s)=s/(s-1)$ and $G(s)=-s/(s+1)$. Both transfer-functions must be such that $\angle G(j0^{+}) = -\pi/2$. Both Matlab and Mathematica get the first one “right” and the second one “wrong.”

2 thoughts on “The “correct” phase of the frequency response”

  1. Hello Professor,

    Is there a type in the last section about G(o)=0?
    The equation you stated 2|phase G|=k*pi, but in the examples phase G=-pi/2. Where does the negative comes from?

    Jing Chen

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.