# Dragon Notes

UNDER CONSTRUCTION
Latest content:
 Apr 05 Deep Learning Mar 19 Anomaly Detection - ML Mar 13 +Data Tables Mar 08 Clustering - Machine Learning Feb 28 Support Vector Machines - ML Feb 20 Regression - Data Science

# Fourier Series Circuit Analysis

• [1] Express $$v_{\t{s}}(t)$$ in terms of an amplitude/phase Fourier series:
$$\ds \qq{v}{s}(t)=a_0+\sum_{n=1}^{\infty}c_n\cos{(n\omega_0t+\phi_n)}\quad$$
• [2] Transform circuit to phasor domain
• [3] Obtain the transfer function at frequency $$\omega$$:
$$\ds \bn{H}(\omega)=\bns{V}{out},\quad \qq{v}{s}=1\cos{(\omega t)}$$
• (a) Set $$\vpl \qq{v}{s}(t)=1\cos{\left(\omega t\right)}$$, which corresponds to $$\sml{\bns{V}{s}(\omega)=1}$$ in the phasor domain
(b) Apply circuit analysis to obtain the expression for $$\vphantom{\int} \sml{\bns{V}{out}/\bns{V}{s}=\bns{V}{out}=\bn{H}}$$

• [4] Compile the time-domain solution:
• $$\ds \qq{v}{out}(t)=a_0\ \bn{H}(\omega = 0)+\sum_{n=1}^{\infty}c_n\Ree\left\{\bn{H}(\omega=n\omega_0 )e^{\lrg{}j(n\omega_0 t+\phi_n)}\right\}$$

 \begin{align} a_0 \vphantom{\ds \int_{0}^{\int^{\int}}} & =\frac{1}{T_0}\int_{0}^{T_0}x(t)dt \\ a_n & = \frac{2}{T_0}\int_{0}^{T_0}x(t)\cos{(n\omega_0 t)} \\ b_n & = \frac{2}{T_0}\int_{0}^{T_0}x(t)\sin{(n\omega_0 t)}dt \end{align} $$\vpL c_n\angle{\phi_n}=a_n-jb_n$$$$\vpl \ds c_n=\sqrt{a_n^2+b_n^2}\quad$$ $$\ds {\phi }_n=\left\{ \begin{array}{c} -{{\mathrm{tan}}^{-1} \left(\lfrac{b_n}{a_n}\right)},\ a_n>0 \\ \pi -{{\mathrm{tan}}^{-1} \left(\lfrac{b_n}{a_n}\right)},\ a_n<0 \end{array} \right.$$

[Ex]: RC Circuit driven by Pulse Train

GIVEN:
$$R=20\ k\Omega,\ C=0.1\ m\t{F}$$

DETERMINE: $$v_{\t{out}}(t)$$
SOLUTION:

Step 1: The period of $$v_s(t)$$ is $$4\ \t{s}$$. Hence, $$\omega_0=2\pi/4=\pi/2\text{ rad/s}$$, and by Eq.[1] we have
\begin{align} \ds a_0 & = \frac{1}{T}\int_0^T v_s(t)dt=\frac{1}{4}\int_0^1 10dt=2.5\t{ [V],} \\ a_n & = \frac{2}{4}\int_0^1 10\Cos{\frac{n\pi}{2}t}dt=\frac{10}{n\pi}\Sinf{n\pi}{2}\t{ [V],} \\ b_n & = \frac{2}{4}\int_0^1 10\Sin{\frac{n\pi}{2}t}dt=\frac{10}{n\pi}\left(1-\Cosf{n\pi}{2}\right)\t{ [V], and} \\ c_n\angle{\phi_n} & = a_n-jb_n=\frac{10}{n\pi}\left[\Sinf{n\pi}{2}-j\left(1-\Cosf{n\pi}{2}\right)\right]. \end{align}
The values of $$c_n\angle{\phi_n}$$ for the first four terms are
\begin{align} \ds c_1\angle{\phi_1} & = \frac{10\sqrt{2}}{\pi}\adegg{-45}\t{,} \\ c_2\angle{\phi_2} & = \frac{10}{\pi}\adegg{-90}\t{,} \\ c_3\angle{\phi_3} & = \frac{10\sqrt{2}}{3\pi}\adegg{-135}\t{,} \\ c_4\angle{\phi_4} & = 0. \vphantom{\frac{10\sqrt{2}}{3\pi}} \end{align}
Step 2: The phasor domain circuit equivalent is
Step 3: Applying voltage division in the phasor domain, the circuit transfer function is
\begin{align} \ds \bn{H}(\omega) & = \bns{V}{out} \vphantom{\frac{{\int}^{\int}}{A}}\\ & = \frac{1}{1+j\omega RC} \\ & = \frac{1}{\sqrt{1+\omega^2 R^2C^2}}e^{-j\atan{\omega RC}}\Rightarrow \end{align}
$$\vpL \hspace{17px}\boxed{\bn{H}(\omega) = \frac{1}{\sqrt{1+4\omega^2}}e^{-j\atan{2\omega}}}$$
where we used $$RC=(20k\Omega)(0.1m\t{F}) = 2\t{ s}$$.

Step 4: The time-domain output voltage is
$$\ds v_{\t{out}}(t)=2.5+\sum_{n=1}^{\infty}\Ree \left\{ c_n\frac{1}{\sqrt{1+4n^2\omega_0^2}}e^{\lrg{\ j[n\omega_0 t\ +\ \phi_n-\ \atan{2n\omega_0}]}}\right\}\Rightarrow$$
Using the values of $$c_n\angle{\phi_n}$$ determined earlier for the first four terms and replacing $$\omega_0$$ with its numerical value of $$\pi/2\t{ rad/s}$$, the expression becomes
\begin{align} \ds && v_{\t{out}}(t) & = 2.5\\ && + & \frac{10\sqrt{2}}{\pi \sqrt{1+\pi^2}}\cos{\left[\frac{\pi t}{2}-\deg{45}-\atan{\pi}\right]} \\ && + & \frac{10}{\pi \sqrt{1+4\pi^2}}\cos{[\pi t-\deg{90}-\atan{2\pi}]} \\ && + & \frac{10\sqrt{2}}{\pi \sqrt{1+9\pi^2}}\cos{\left[\frac{3\pi t}{2}-\deg{135}-\atan{3\pi}\right]}\t{ ...}\Rightarrow \\ \end{align} $\Bxred{v_{\t{out}}(t)=\ 2.5+1.37\Cos{\frac{\pi t}{2}-\deg{117}}+0.5\cos{(\pi t-\deg{171})}+0.16\Cos{\frac{3\pi t}{2}+\deg{141}}\text{ ... [V]}}$
The output response $$v_{\t{out}}(t)$$, computed using the series solution with $$n_{\t{max}}=1000$$, is shown below