This Jupyter notebook is part of a collection of notebooks in the bachelors module Signals and Systems, Communications Engineering, Universität Rostock. Please direct questions and suggestions to Sascha.Spors@uni-rostock.de.
The phase and group delay characterize the phase and delay properties of an LTI system. Both quantify the frequency dependent delay that is imprinted on a signal when passing through a system. In many applications the delay introduced by a system should be as small as possible or within reasonable limits.
For an LTI system with transfer function $H(j \omega)$ the phase delay is defined as follows
\begin{equation} t_p(\omega) = - \frac{\varphi(j \omega)}{\omega} \end{equation}where $\varphi(j \omega) = \arg \{ H(j \omega) \}$ denotes the phase of the transfer function. The phase delay quantifies the delay of a single harmonic exponential signal $e^{j \omega t}$ with frequency $\omega$ when passing through the system. The negative sign in the definition of the phase delay results in a positive phase delay $t_p(\omega) > 0$ when a signal is delayed by a system. Note that the phase delay may not be defined for $\omega = 0$.
Example
As example, the phase delay $t_p(\omega)$ is computed for the 2nd order low-pass filter introduced before. First the transfer function $H(j \omega)$ is defined in SymPy
%matplotlib inline
import sympy as sym
sym.init_printing()
L, R, C = sym.symbols('L R C', positive=True)
w = sym.symbols('omega', real=True)
s = sym.I * w
H = 1 / (C*L*s**2 + C*R*s + 1)
H
Now the phase delay $t_p(\omega)$ is computed
phi = sym.arg(H)
tp = - phi/w
tp
and the result is visualized using the normalized values $R=1$, $L=0.5$ and $C=0.4$ for the elements of the low-pass filter
RLC = {R: 1, L: sym.Rational('.5'), C: sym.Rational('.4')}
sym.plot(tp.subs(RLC), (w, -10, 10),
xlabel='$\omega$', ylabel='$t_p(j \omega)$')
<sympy.plotting.plot.Plot at 0x106658208>
The group delay is defined as the derivative of the phase with respect to the frequency
\begin{equation} t_g(\omega) = - \frac{d \varphi(j \omega)}{d \omega} \end{equation}The group delay quantifies the delay the amplitude envelope of a group of exponential signals observes when passing through a system. The negative sign in above definition results in a positive group delay for a system imposing a delay onto the input signal. Note that the phase $\varphi(j \omega)$ is in general only unique for $- \pi < \varphi(j \omega) \leq \pi$. If the phase exceeds this range it is wrapped back. For meaningful results it is required to unwrap the phase before computing the group delay.
Example
The group delay $t_g(\omega)$ of above 2nd order low-pass filter is computed and plotted for the normalized values
tg = - sym.diff(phi, w)
sym.plot(tg.subs(RLC), (w, -10, 10),
xlabel='$\omega$', ylabel='$t_g(j \omega)$')
<sympy.plotting.plot.Plot at 0x11686aeb8>
Copyright
The notebooks are provided as Open Educational Resource. Feel free to use the notebooks for your own educational purposes. The text is licensed under Creative Commons Attribution 4.0, the code of the IPython examples under the MIT license. Please attribute the work as follows: Lecture Notes on Signals and Systems by Sascha Spors.