Frequency Response


By Prof. Seungchul Lee
http://iai.postech.ac.kr/
Industrial AI Lab at POSTECH

Table of Contents

1. Sinusoidal Steady-State Analysis

  • Previously, we have determined the time response of linear systems to arbitrary inputs and initial conditions

  • We have also studied the character of certain standard systems to certain simple inputs



1.1. Response to a Sinusoidal Input

  • Only focus on steady-state solution
  • Transient solution is not our interest any more
  • Input sine waves of different frequencies and look at the output in steady state
  • If $G(s)$ is linear and stable, a sinusoidal input will generate in steady state a scaled and shifted sinusoidal output of the same frequency



  • When the input $x(t) = e^{j\omega t}$ to an LTI system





$$ \begin{align*} y(t) = h(t) * x(t) = \int^\infty_{-\infty}h(\tau)e^{j\omega(t-\tau)}d\tau &= e^{j\omega t} \underbrace{\int^\infty_{-\infty}h(\tau)e^{-j\omega \tau}d\tau}_{\text{complex function of } \omega} \\\\ &= e^{j\omega t} H(j\omega) \end{align*} $$


  • Output is also a sinusoid
    • same frequency
    • possibly different amplitude, and
    • possibly different phase angle

1.2. Fourier Transform


$$H(j\omega) = \int^\infty_{-\infty}h(\tau)e^{-j\omega \tau}d\tau$$




  • $H(j\omega)e^{j\omega t}$ rotates with the same angular velocity $\omega$


$$H(j\omega)= \lvert H(j\omega) \rvert e^{j\angle H(j\omega)}$$



  • Example
$$ \dot{y} + 5y = x(t)$$
In [1]:
% use lsim

A = -5;
B = 1;
C = 1;
D = 0;
G = ss(A,B,C,D);

w = pi;
t = linspace(0,2*pi,200);

x0 = 0;

x = sin(w*t);

[y,tout] = lsim(G,x,t,x0);

plot(t,x), hold on
plot(tout,y), hold off
grid on
xlabel('t')
axis tight, ylim([-1,1])
leg = legend('input','output');
set(leg, 'fontsize', 12)

In [2]:
% sinusoidal inputs with different w

A = -5;
B = 1;
C = 1;
D = 0;
G = ss(A,B,C,D);

x0 = 0;

t = linspace(0,2*pi,200);

W = [1,5,10,20];
for w = W
    x = sin(w*t);
    [y,tout] = lsim(G,x,t,x0);
    plot(tout,y), hold on
end

hold off
grid on
axis tight, ylim([-0.3,0.3])
xlabel('t')
leg = legend('\omega = 1','\omega = 5','\omega = 10','\omega = 20');
set(leg, 'fontsize', 12)

1.3. Frequency Response to a Sinsoidal Input (Frequency Sweep)



Two primary quantities of interest that have implications for system performance are:

  • the scaling = magnitude of $H(j \omega)$
$$\left\lvert \frac{Y(s)}{X(s)}\right\rvert_{s=j \omega} = \lvert H(j \omega) \rvert$$
  • the phase shift = angle of $H(j \omega)$
$$\phi = \angle H(j \omega)$$


Example

  • Given input $ e^{j\omega t} $
$$ \begin{align*} \dot{y} + 5y &= 5x(t) \\\\ \dot{y} + 5y &= 5e^{j\omega t} \end{align*} $$
  • If $ y = Ae^{j(\omega t + \phi)} $
$$ \begin{align*} j\omega A e^{j(\omega t + \phi)} + 5Ae^{j(\omega t + \phi)} &= 5e^{j\omega t}\\ \left( j\omega + 5 \right)Ae^{j\phi} &= 5\\ \end{align*} $$
  • Therefore,
$$ \begin{align*} \lvert H(j\omega) \rvert = A &= \frac{5}{\mid {j\omega + 5}\mid} \\ \angle H(j\omega) = \phi &= -\angle{(j\omega + 5)} \end{align*} $$
In [3]:
w = 0.1:0.1:100;

A = 5./abs(1j*w+5);
P = -angle(1j*w+5)*180/pi;

subplot(2,1,1), plot(w, A, 'linewidth', 2)
yticks([0,0.5,1])
ylabel('|H(j\omega)|', 'fontsize', 13)
xlabel('\omega', 'fontsize', 15)

subplot(2,1,2), plot(w, P, 'linewidth', 2)
yticks([-90, -45, 0])
ylabel('\angle H(j\omega)', 'fontsize', 13)
xlabel('\omega', 'fontsize', 15)

% later, we will see that this is kind of a bode plot

2. From Laplace Transform to Fourier Transform

2.1. Eigenfunctions and Eigenvalues

If the output signal is a scalar multiple of the input signal, we refer to the signal as an eigenfunction and the multiplier as the eigenvalue.



Fact: complex exponentials are eigenfunctions of LTI systems

  • If $x(t) = e^{st}$ and $h(t)$ is the impulse response then,
$$ \begin{align*} y(t) &= h(t) * x(t) = \int_{-\infty}^{\infty} h(\tau) e^{s(t-\tau)} \, d\tau = e^{st}\int_{-\infty}^{\infty} h(\tau) e^{-s\tau} \, d\tau = \underbrace{H(s)}_{\text{eigenvalue}} e^{st} \\\\ H(s) &= \int_{-\infty}^{\infty}h(\tau) e^{-s\tau} d \tau \end{align*}$$


  • The eigenvalue associated with eigenfunction $e^{st}$ is $H(s)$




2.2. Rational Transfer Functions

  • Eigenvalues are particularly easy to evaluate for systems represented by linear differential equations with constant coefficients.
  • Then the system function is a ratio of polynomials in $s$
  • Example
$$\ddot y(t) + 3 \dot y(t) + 4 y(t) = 2 \ddot x(t) + 7 \dot x(t) + 8 x(t)$$


$$H(s) = \frac{2s^2 + 7s + 8}{s^2 + 3s + 4}$$

2.3. Vector Diagrams

  • The value of $H(s)$ at a point $s = s_0$ can be determined graphically using vectorial analysis.
  • Factor the numerator and denominator of the system function to make poles and zeros explicit.


$$H(s_0) = K \frac{(s_0 - z_0)(s_0 - z_1)(s_0 - z_2)\cdots}{(s_0 - p_0)(s_0 - p_1)(s_0 - p_2)\cdots}$$




  • Each factor in the numerator/denominator corresponds to a vector from a zero/pole (here $z_0$) to $s_0$, the point of interest in the s-plane

  • The value of $H(s)$ at a point $s = s_0$ can be determined by combining the contributors of the vectors associated with each of the poles and zeros


$$H(s_0) = K \frac{(s_0 - z_0)(s_0 - z_1)(s_0 - z_2)\cdots}{(s_0 - p_0)(s_0 - p_1)(s_0 - p_2)\cdots}$$

  • The magnitude is determined by the product of the magnitudes


$$\lvert H(s_0) \rvert = \lvert K \rvert \frac{\lvert(s_0 - z_0)\rvert \lvert(s_0 - z_1)\rvert \lvert(s_0 - z_2)\rvert \cdots}{\lvert(s_0 - p_0)\rvert \lvert(s_0 - p_1)\rvert \lvert(s_0 - p_2)\rvert \cdots}$$

  • The angle is determined by the sum of the angles


$$\angle H(s_0) = \angle K + \angle(s_0 - z_0) + \angle(s_0 - z_1) + \angle(s_0 - z_2) + \cdots - \angle (s_0 - p_0) - \angle(s_0 - p_1) - \angle(s_0 - p_2)- \cdots$$

2.4. Vector Diagrams for Frequency Response

  • The magnitude and phase of the response of an LTI system to $e^{j \omega t}$ is the magnitude and phase of 𝐻(𝑠) at $s = j \omega$




Example: find the response of the system described by
$$H(s) = \frac{1}{s+2}$$ to the input $x(t) = e^{2jt}$


1) Isolated zero $$H(s) = s - z_1$$

2) Isolated pole

$$H(s) = \frac{9}{s - p_1}$$


3) More complicated systems: pole and zero

$$H(s) = 3\frac{s-z_1}{s - p_1}$$


4) More complicated systems: two poles

$$H(s) = \frac{15}{(s-p_1))s - p_2)}$$


In [4]:
r = 0:0.05:4;

zeta = 0.1:0.2:1;
A = [];
for i = 1:length(zeta)
    A(i,:) = 1./sqrt((1-r.^2).^2 + (2*zeta(i)*r).^2); 
end

plot(r, A)
xlabel('\gamma')
ylabel('A')
legend('0.1','0.3','0.5','0.7','0.9')

In [5]:
phi = [];
for i = 1:length(zeta)
    phi(i,:) = -atan2((2*zeta(i).*r),(1-r.^2));
end

plot(r,phi*180/pi)
xlabel('\gamma')
ylabel('\phi')
legend('0.1','0.3','0.5','0.7','0.9')

In [6]:
%%html
<center><iframe src="https://www.youtube.com/embed/ZGPtPkTft8g?rel=0" 
width="560" height="315" frameborder="0" allowfullscreen></iframe></center>

3. Frequency Response and Bode Plots

Frequency response


$$H(j\omega) = H(s) \vert_{s \leftarrow j\omega}$$




Poles and zeros

  • Thinking about systems as collections of poles and zeros is an important design concept.

    • Simple: just a few numbers characterize entire system

    • Powerful: complete information about frequency response

3.1. Bode Plots: Magnitude

1) Asymptotic Behavior: Isolated Zero


$$ H(s) = s - z_1$$


  • The magnitude response is simple at low and high frequencies



- Two asymptotes provide a good approximation on log-log axes


$$ \begin{align*} \lim_{\omega \rightarrow 0} \lvert H(j \omega ) \rvert &= \lvert z_1 \rvert \\\\ \lim_{\omega \rightarrow \infty} \lvert H(j \omega ) \rvert &= \omega \end{align*} $$

2) Asymptotic Behavior: Isolated Pole


$$H(s) = \frac{9}{s - p_1}$$


  • The magnitude response is simple at low and high frequencies



  • Two asymptotes provide a good approximation on log-log axes



$$ \begin{align*} \lim_{\omega \rightarrow 0} \lvert H(j \omega ) \rvert &= \frac{9}{\lvert p_1 \rvert} \\\\ \lim_{\omega \rightarrow \infty} \lvert H(j \omega ) \rvert &= \frac{9}{\omega} \end{align*} $$

3) Asymptotic Behavior of More Complicated Systems


$$H(s_0) = K \frac{\prod_{m=1}^{M}(s_0 - z_m)}{\prod_{n=1}^{N}(s_0 - p_n)}$$


  • The magnitude of a product is the product of the magnitudes


$$ \lvert H(s_0) \rvert = \lvert K \rvert \frac{\prod_{m=1}^{M}\lvert s_0 - z_m \rvert }{\prod_{n=1}^{N} \lvert s_0 - p_n\rvert }$$




  • The log of the magnitude is a sum of logs


$$\log \lvert H(j \omega) \rvert = \log \lvert K \rvert + \sum_{m=1}^{M} \log \lvert j \omega - z_m\rvert - \sum_{n=1}^{N} \log \lvert j \omega - p_n \rvert$$


  • Bode Plot: Adding Instead of Multiplying


$$H(s) = \frac{s}{(s+1)(s+10)}$$





3.2. Bode Plots: Angle

1) Asymptotic Behavior: Isolated zero


$$ H(s) = s - z_1$$


  • The angle response is simple at low and high frequencies



  • Three straight lines provide a good approximation versus $\log \omega$



$$ \begin{align*} \lim_{\omega \rightarrow 0} \angle H(j \omega ) &= 0 \\\\ \lim_{\omega \rightarrow \infty} \angle H(j \omega ) &= \frac{\pi}{2} \end{align*} $$


2) Asymptotic Behavior: Isolated Pole


$$ H(s) = \frac{9}{s - p_1}$$


  • The angle response is simple at low and high frequencies



  • Three straight lines provide a good approximation versus $\log \omega$



$$ \begin{align*} \lim_{\omega \rightarrow 0} \angle H(j \omega ) &= 0 \\\\ \lim_{\omega \rightarrow \infty} \angle H(j \omega ) &= -\frac{\pi}{2} \end{align*} $$

3) Asymptotic Behavior of More Complicated Systems


$$H(s_0) = K \frac{\prod_{m=1}^{M}(s_0 - z_m)}{\prod_{n=1}^{N}(s_0 - p_n)}$$


  • The angle of a product is the sum of the angles
$$ \angle H(s_0) = \angle K + \sum_{m=1}^{M} \angle (s_0 - z_m) - \sum_{n=1}^{N} \angle (s_0 - p_n) $$


$$ \angle H(j \omega) = \angle K + \sum_{m=1}^{M} \angle (j \omega - z_m) - \sum_{n=1}^{N} \angle (j \omega - p_n) $$




  • The angle of $K$ can be $0$ or $\pi$ for systems described by linear differential equations with constant, real-value coefficients


$$H(s) = \frac{s}{(s+1)(s+10)}$$





3.3. Bode Plot in dB

  • Bode plot (logarithmic plot) : separate plots for magnitude and phase


$$20 \log_{10} \lvert H(j\omega) \rvert$$


  • Example


$$H(s) = \frac{10s}{(s+1)(s+10)}$$







In [7]:
%%html
<center><iframe src="https://www.youtube.com/embed/_eh1conN6YM?rel=0"
width="560" height="315" frameborder="0" allowfullscreen></iframe></center>
In [8]:
%%html
<center><iframe src="https://www.youtube.com/embed/CSAp9ooQRT0?rel=0"
width="560" height="315" frameborder="0" allowfullscreen></iframe></center>
In [9]:
%%html
<center><iframe src="https://www.youtube.com/embed/E6R2XUEyRy0?rel=0"
width="560" height="315" frameborder="0" allowfullscreen></iframe></center>
In [10]:
%%html
<center><iframe src="https://www.youtube.com/embed/O2Cw_4zd-aU?rel=0"
width="560" height="315" frameborder="0" allowfullscreen></iframe></center>
In [11]:
%%html
<center><iframe src="https://www.youtube.com/embed/4d4WJdU61Js?rel=0"
width="560" height="315" frameborder="0" allowfullscreen></iframe></center>
In [12]:
%%html
<center><iframe src="https://www.youtube.com/embed/GIlx9Yu__y8?rel=0"
width="560" height="315" frameborder="0" allowfullscreen></iframe></center>

4. Frequency Response and Nyquist Plots

  • If we only want a single plot we can use $\omega$ as a parameter
  • A plot of $Re\{G(\omega)\}$ vs. $Im\{G(\omega)\}$ as a function of $\omega$
    • Advantage: all information in a single plot



$$G(s) = \frac{1}{s+1}$$
In [13]:
G = tf([1],[1,1]);

In [14]:
bode(G)
grid on

In [15]:
nyquist(G)
axis equal

$$G(s) = \frac{1}{(s+1)(0.1s + 1)}$$
In [16]:
G = tf([1],conv([1,1],[0.1,1]));

In [17]:
bode(G)
grid on

In [18]:
nyquist(G)
axis equal

$$G(s) = \frac{1}{(s+1)^3}$$
In [19]:
s = tf('s');
G = 1/(s+1)^3;

In [20]:
bode(G)
grid on

In [21]:
nyquist(G)
axis equal

In [22]:
%%javascript
$.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js')