Frequency Response

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

• 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 diﬀerent amplitude, and
• possibly diﬀerent 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$