#!/usr/bin/env python # coding: utf-8 # # System Properties # # *This Jupyter notebook is part of a [collection of notebooks](../index.ipynb) in the bachelors module Signals and Systems, Communications Engineering, Universität Rostock. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).* # ## Classes of Systems # # The spectral and temporal characteristics of a linear-time invariant (LTI) system are given by its impulse response $h(t)$ and transfer function $H(s) = \mathcal{L} \{ h(t) \}$, respectively. However it is useful to introduce some classes of LTI systems with specific higher-level properties. These are for instance useful for the design of systems with specific desired properties. # ### Real-Valued System # # A real-valued system is a system whose output signal $y(t) = \mathcal{H} \{ x(t) \}$ is real-valued $y(t) \in \mathbb{R}$ for a real-valued input signal $x(t) \in \mathbb{R}$. Since the output signal $y(t)$ of an LTI system is given by convolving the input signal $x(t)$ with its impulse response $h(t)$, the impulse response $h(t)$ of a real-valued system has to be real-valued # # \begin{equation} # h(t) \in \mathbb{R} # \end{equation} # # If existing, the transfer function $H(s) = \mathcal{L} \{ h(t) \}$ shows conjugate complex symmetry # # \begin{equation} # H(s) = H^*(s^*) # \end{equation} # # due to the [symmetry of the Laplace transform for real-valued signals](../laplace_transform/properties.ipynb#Symmetry-for-Real-Valued-Signals). It follows, that the poles and zeros of a rational transfer function $H(s)$ are either real-valued or complex conjugate pairs. # # If existing, the transfer function $H(j \omega) = \mathcal{F} \{ h(t) \}$ in the Fourier domain shows also conjugate complex symmetry # # \begin{equation} # H(j \omega) = H^*(-j \omega) # \end{equation} # # due to the [symmetry of the Fourier transform for real-valued signals](../fourier_transform/properties.ipynb#Real-valued-signals). The magnitude spectrum $|H(j \omega)|$ shows even symmetry and the phase $\varphi(j \omega)$ odd symmetry # # \begin{align} # |H(j \omega)| &= |H(-j \omega)| \\ # \varphi(j \omega) &= - \varphi(-j \omega) # \end{align} # # Due to these symmetries often only the positive part $\omega \geq 0$ of the magnitude and phase of the transfer function are plotted. Note that such a representation is ambiguous without the additional knowledge that the system is real-valued. # # Since physically existing signals are real-valued, real-valued systems are of paramount importance in practical applications. The symmetry relations derived above have to be considered when designing real-valued systems in the spectral domain. # ### Distortionless System # # A distortionless system is a system whose output signal $y(t)$ is the attenuated and delayed version of the input signal $x(t)$ # # \begin{equation} # y(t) = H_0 \cdot x(t - \tau) # \end{equation} # # where $H_0 \in \mathbb{R}$ denotes the attenuation and $\tau \in \mathbb{R}$ the delay. The impulse response of a distortionless system is consequently given as # # \begin{equation} # h(t) = H_0 \cdot \delta(t - \tau) # \end{equation} # # This can be concluded from the [sifting property of the Dirac pulse](../continuous_signals/standard_signals.ipynb#Dirac-Impulse). Its transfer function $H(j \omega) = \mathcal{F} \{ h(t) \}$ reads # # \begin{equation} # H(j \omega) = H_0 \cdot e^{- j \omega \tau} # \end{equation} # # It follows that the magnitude response of a distortonless system is constant $| H(j \omega) | = H_0$, the phase response is linearly dependent on the frequency $\varphi_\text{H}(j \omega) = - \omega \tau$, and the [phase and group delay](../systems_spectral_domain/phase_group_delay.ipynb) are constant $t_p = t_g = \tau$. # # The characteristics of a distortionless system are often the desired properties of sensors, actuators, amplifiers and transmission paths. In this context the distortionless system serves as an idealized model for such elements or is used as goal for the equalization of non-ideal elements. # ### Linear-Phase System # # Systems whose unwrapped phase $\varphi_\text{H}(j \omega) = \arg \{ H(j \omega) \}$ scales linearly with frequency # # \begin{equation} # \varphi_\text{H}(j \omega) = - c \cdot \omega + d # \end{equation} # # with $c, d \in \mathbb{R}$ are termed *linear-phase systems*. There are no constraints with respect to their magnitude response $|H(j \omega)|$. The transfer function $H(j \omega)$ is given as # # \begin{equation} # H(j \omega) = |H(j \omega)| \; e^{j (- c \omega + d)} # \end{equation} # # The group delay of a linear-phase system is constant # # \begin{equation} # t_g(\omega) = - \frac{\partial (- c \cdot \omega + d)}{\partial \omega} = c # \end{equation} # # Systems with a linear phase are often desired in practical applications, since all spectral components of a signal are delayed by the same amount when passing the system. The distortionless system introduced above can be seen as a special linear-phase system with $|H(j \omega)| = H_0$, $c = \tau$ and $d=0$. # # The impulse response of a linear-phase system shows a specific symmetry. Let's first assume that $c=0$ and $d=0$. Splitting $|H(j \omega)| \in \mathbb{R}$ into its odd and even part, and considering the [symmetries of the Fourier transform](../fourier_transform/properties.ipynb#Symmetries) yields # # \begin{equation} # h(t) = h^*(-t) # \end{equation} # # This result can be generalized to the case $c \neq 0$ by considering the [temporal shift theorem](../fourier_transform/theorems.ipynb#Temporal-Shift-Theorem) when deriving the impulse response from the transfer function. Above symmetry generalizes to # # \begin{equation} # h(t - c) = h^*(-t + c) # \end{equation} # # The impulse response of a linear-phase system exhibits complex conjugate symmetry with respect to the time instant $t-c$. In the general case $d \neq 0$, a constant phase shift is added. # **Example** # # A real-valued linear-phase system with the following transfer function # # \begin{equation} # H(j \omega) = \Lambda(\omega) \cdot e^{-j c \omega} # \end{equation} # # is considered. Its impulse response $h(t) = \mathcal{F}^{-1} \{ H(j \omega) \}$ is derived by applying the [duality principle](../fourier_transform/properties.ipynb#Duality) to the [Fourier transformation of the triangular signal](../fourier_transform/theorems.ipynb#Transformation-of-the-triangular-signal) and considering the [shift theorem](../fourier_transform/theorems.ipynb#Temporal-Shift-Theorem) # # \begin{equation} # h(t) = \frac{1}{2 \pi} \text{sinc}^2 \left( \frac{t - c}{2} \right) # \end{equation} # # It is straightforward to show that the impulse response fulfills the properties stated above. For illustration, the impulse response is plotted for $c=5$ # In[1]: import sympy as sym get_ipython().run_line_magic('matplotlib', 'inline') sym.init_printing() t = sym.symbols('t', real=True) c = 5 h = 1/(2*sym.pi) * sym.sinc((t-c)/2)**2 sym.plot(h, (t, -5, 15), xlabel='$t$', ylabel='$h(t)$') # **Exercise** # # The linear-phase system with transfer function # # \begin{equation} # H(j \omega) = \text{rect}(\omega - \frac{1}{2}) \cdot e^{-j c \omega} # \end{equation} # # is investigated in this exercise. # # * Is the system real-valued? # * Derive the impulse response $h(t)$ of the linear-phase system. Is the system causal? Is it stable in the BIBO sennse? # * Do the above derived symmetries hold for the impulse response? # ### Minimum-Phase System # # For a given magnitude response $|H(j \omega)|$ often the realization which has the minimum possible group delay $t_g(\omega)$ is desired. The group delay quantifies the frequency dependent delay a system introduces to a signal. For many applications this delay should be as small as possible. A [causal and stable system](causality_stability.ipynb) with rational transfer function $H(s)$ is minimum-phase iff it has no zeros and poles in the right $s$-half-plane. Such a system is termed [*minimum-phase system*](https://en.wikipedia.org/wiki/Minimum_phase). It has the minimum possible group delay for a given magnitude response. # # In order to proof this, the dependence of the magnitude response $|H(j \omega)|$ and phase $\varphi_\text{H}(j \omega)$ on the locations of the poles and zeros of $H(s)$ is analyzed. It is assumed in the following that the poles of the system are located in the left $s$-half-plane, hence that the system is stable. The magnitude response of the system can then be written as # # \begin{equation} # |H(j \omega)| = |K| \cdot \frac{\prod_{\mu=0}^{Q} | j \omega - s_{0 \mu} |}{\prod_{\nu=0}^{P} | j \omega - s_{\infty \nu}|} # = |K| \cdot \frac{\prod_{\mu=0}^{Q} \sqrt{\Re \{ s_{0 \mu} \}^2 + (\omega - \Im \{ s_{0 \mu} \} )^2 }}{\prod_{\nu=0}^{P} \sqrt{\Re \{ s_{\infty \nu} \}^2 + (\omega - \Im \{ s_{\infty \nu} \} )^2 }} # \end{equation} # # where $s_{0 \mu}$ and $s_{\infty \nu}$ denote the $\mu$-th zero and $\nu$-th pole of $H(s)$, and $Q$ and $P$ the total number of zeros and poles, respectively. The magnitude response for a given frequency $\omega$ is determined by the relative distances of the poles and zeros to the point $s = j \omega$ on the imaginary axis. Mirroring the zeros at the imaginary axis does not change the magnitude response. This is due to the fact that $| j \omega - s_{0 \mu} | = | j \omega + s^*_{0 \mu} |$ holds since only the sign of the real part inside the magnitude changes. # # However, the group delay is different for zeros in the left and right $s$-half-plane. In the [foundations of Bode plots](../systems_spectral_domain/bode_plot.ipynb#Bode-Plots) it has been shown that the phase $\varphi_\text{H}(j \omega)$ of a rational transfer function $H(s)$ can be written as # # \begin{equation} # \varphi_H(j \omega) = \sum_{\mu=0}^{Q} \arg (j \omega - s_{0 \mu}) - \sum_{\nu=0}^{P} \arg (j \omega - s_{\infty \nu}) # \end{equation} # # Since the contributions of the individual zeros are superimposed, let's first look at the contribution of a single zero. The group delay for a single zero $s_0 = \Re \{ s_0 \} + j \Im \{ s_0 \}$ can be derived as # # \begin{equation} # t_g(\omega) = - \frac{d}{d \omega} \arg (j \omega - s_0) = # \frac{\Re \{ s_0 \}}{(\omega - \Im \{ s_0 \})^2 + \Re \{s_0\}} = # \frac{\Re \{ s_0 \}}{\omega^2 - 2 \omega \Im \{ s_0 \} + |s_0|^2} # \end{equation} # # For a given magnitude response, the denominator is invariant to a mirroring of the zero at the imaginary axis. However, the numerator $\Re \{ s_0 \} < 0$ for a zero in the left $s$-half-plane and $\Re \{ s_0 \} > 0$ for a zero in the right $s$-half-plane. Hence, the group delay for the zero in the left $s$-half-plane is always smaller than for its mirror-imaged zero in the right $s$-half-plane. Minimizing the group delay for each zero minimizes the overall group delay. # # A system where zeros are located in the left and right $s$-half-plane is called *non-minimum-phase system* or *mixed-phase system*. A system where all zeros are located in the right $s$-half-plane is called *maximum-phase system*. # **Example** # # A stable real-valued minimum-phase system (MPS) with the following transfer function is investigated # # \begin{equation} # H_\text{MPS}(j \omega) = \frac{(j \omega - s_0)(j \omega - s_0^*)}{(j \omega - s_\infty)^2} # \end{equation} # # The system has a real-valued pole $s_\infty$ of order two, and a pair of complex conjugate zeros $s_0$ and $s_0^*$. The corresponding non-minimum-phase system (NMPS) with equal magnitude response $|H_\text{MPS}(j \omega)| = |H_\text{NMPS}(j \omega)|$ is yielded by mirroring the zeros at the imaginary axis # # \begin{equation} # H_\text{NMPS}(j \omega) = \frac{(j \omega + s_0^*)(j \omega + s_0)}{(j \omega - s_\infty)^2} # \end{equation} # # The magnitude response and group delay for both systems are computed and plotted for $s_\infty = -2$ and $s_0 = - 1 + j$. First the transfer functions are defined and the group delays are computed # In[2]: w = sym.symbols('omega', real=True) jw = sym.I * w s_0 = - 1 + sym.I s_inf = -2 H_MPS = (jw - s_0)*(jw - sym.conjugate(s_0))/(jw - s_inf)**2 H_NMPS = (jw + sym.conjugate(s_0))*(jw + s_0)/(jw - s_inf)**2 tg_MPS = - sym.diff(sym.arg(H_MPS), w) tg_NMPS = - sym.diff(sym.arg(H_NMPS), w) # The magnitude response $|H_\text{MPS}(j \omega)|$ of the MPS is illustrated by the green line and the magnitude response $|H_\text{NMPS}(j \omega)|$ of the NMPS by the red line, respectively. Note that both overlap. # In[3]: p1 = sym.plot(sym.Abs(H_MPS), (w, -5, 5), line_color='g', xlabel='$\omega$', ylabel='$|H(j \omega)|$', show=False) p2 = sym.plot(sym.Abs(H_NMPS), (w, -5, 5), line_color='r', show=False) p1.extend(p2) p1.show() # The same color scheme is used for the group delay of both systems # In[4]: p1 = sym.plot(tg_MPS, (w, -5, 5), line_color='g', xlabel='$\omega$', ylabel='$t_g(\omega)$', show=False) p2 = sym.plot(tg_NMPS, (w, -5, 5), line_color='r', show=False) p1.extend(p2) p1.show() # **Exercise** # # * Add a second pair of complex conjugate zeros and a pair of complex conjugate poles to above MPS. # * For your MPS system derive the transfer function $H(j \omega)$ of the corresponding maximum-phase and one mixed-phase system. # * Compute the group delays for all three systems. # * In what range is the group delay of the mixed-phase system located with respect to the minimum- and maximum-phase system? # ### All-Pass # # An [all-pass](https://en.wikipedia.org/wiki/All-pass_filter) is a system with constant magnitude response $|H(j \omega)| = H_0$ but frequency dependent phase $\varphi_\text{H}(j \omega)$. It allows to modify the phase of a signal without modifying its magnitude. The [distortionless system](#Distortionless-System) is a special case of an all-pass with $\varphi_\text{H}(j \omega) = - \omega \tau$. A stable system with rational transfer function $H(s)$ is an causal all-pass iff for each pole in the left $s$-half-plane there exists a zero in the right $s$-half-plane which is mirrored at the imaginary axis $\Re \{ s \} = 0$. # # The magnitude response $|H(j \omega)|$ of a system $H(s)$ with respect to its poles and zeros has already been derived before as # # \begin{equation} # |H(j \omega)| = |K| \cdot \frac{\prod_{\mu=0}^{Q} | j \omega - s_{0 \mu} |}{\prod_{\nu=0}^{P} | j \omega - s_{\infty \nu}|} # \end{equation} # # For a pole $s_{\infty \mu}$ and its mirror-imaged zero $s_{0 \nu} = - s_{\infty \mu}^*$ the following holds # # \begin{equation} # |j \omega - s_{\infty \mu}| = |j \omega - s_{0 \nu}| # \end{equation} # # since only the sign of the real part of the mirror-imaged zero changes. Introducing this result into $|H(j \omega)|$ above for all pole/zero pairs yields that the magnitude response of an all-pass is constant. # **Example** # # The properties of a stable real-valued 2nd-order all-pass with transfer function # # \begin{equation} # H(j \omega) = \frac{(j \omega - s_0)(j \omega - s_0^*)}{(j \omega - s_\infty)(j \omega - s_\infty^*)} # \end{equation} # # are investigated. The pole is chosen as $s_\infty = -1 + j$, and the zero due to the required symmetry as $s_0 = - s_\infty^*$. First the transfer function is defined # In[5]: s_inf = -1 + sym.I s_0 = - sym.conjugate(s_inf) H = (jw - s_0)*(jw - sym.conjugate(s_0)) / \ ((jw - s_inf)*(jw - sym.conjugate(s_inf))) H # The magnitude response $|H(j \omega)|$ of the all-pass is plotted # In[6]: sym.plot(sym.Abs(H), (w, -5, 5), xlabel='$\omega$', ylabel='$|H(j \omega)|$', ylim=(0, 1.2)); # as well as its phase $\varphi_\text{H}(j \omega)$ # In[7]: sym.plot(sym.arg(H), (w, -5, 5), xlabel='$\omega$', ylabel=r'$\varphi(j \omega)$'); # **Copyright** # # This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources). Feel free to use the notebook for your own purposes. The text is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/), the code of the IPython examples under the [MIT license](https://opensource.org/licenses/MIT). Please attribute the work as follows: *Sascha Spors, Continuous- and Discrete-Time Signals and Systems - Theory and Computational Examples*.