From 00213b1684aea25de3ef35ae36fc50f5439efa5d Mon Sep 17 00:00:00 2001
From: Philipp Le <philipp-le-prviat@freenet.de>
Date: Tue, 19 May 2020 14:58:37 +0200
Subject: Solutions of exercise 2

---
 exercise02/exercise02.tex | 348 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 341 insertions(+), 7 deletions(-)

(limited to 'exercise02/exercise02.tex')

diff --git a/exercise02/exercise02.tex b/exercise02/exercise02.tex
index 580ac67..db2fa8c 100644
--- a/exercise02/exercise02.tex
+++ b/exercise02/exercise02.tex
@@ -107,11 +107,13 @@
 		\task
 		\begin{equation*}
 			x(t) = \begin{cases}
-				\SI{-0.2}{V}, &\quad \text{ if} \; \left(\SI{-0.5}{s} + n \cdot \SI{2}{s}\right) \leq t < \left(\SI{0.5}{s} + n \cdot \SI{2}{s}\right)  \\
-				\SI{-0.2}{V}, &\quad \text{ if} \; \left(\SI{0.5}{s} + n \cdot \SI{2}{s}\right) \leq t < \left(\SI{1.5}{s} + n \cdot \SI{2}{s}\right) \\
+				\SI{0.8}{V}, &\quad \text{ if} \; \left(-\frac{T_0}{4} + n \cdot T_0\right) \leq t < \left(\frac{T_0}{4} + n \cdot T_0\right) \\
+				\SI{-0.2}{V}, &\quad \text{ if} \; \left(\frac{T_0}{4} + n \cdot T_0\right) \leq t < \left(\frac{3T_0}{4} + n \cdot T_0\right) \\
 			\end{cases} \qquad \forall \; n \in \mathbb{Z}
 		\end{equation*}
 		
+		with $T_0 = \SI{2}{s}$
+		
 		\task
 		\begin{itemize}
 			\item Period: $T_0 = \SI{2}{s}$
@@ -119,6 +121,207 @@
 			\item Base angular frequency: $\omega_0 = \SI{3.14}{s^{-1}}$
 		\end{itemize}
 	
+		\task
+		\begin{equation*}
+			\begin{split}
+				a_n &= \frac{2}{T_0} \left( \int\limits_{-\frac{T_0}{4}}^{\frac{T_0}{4}} \SI{0.8}{V} \cdot \cos\left(n\frac{2\pi}{T_0}t\right) \, \mathrm{d} t - \int\limits_{\frac{T_0}{4}}^{\frac{3T_0}{4}} \SI{0.2}{V} \cdot \cos\left(n\frac{2\pi}{T_0}t\right) \, \mathrm{d} t \right) \\
+				 &= \frac{2}{T_0} \frac{T_0}{2 \pi n} \left( \SI{0.8}{V} \cdot \left[\sin\left(n\frac{2\pi}{T_0}t\right)\right]_{-\frac{T_0}{4}}^{\frac{T_0}{4}} - \SI{0.2}{V} \cdot \left[\sin\left(n\frac{2\pi}{T_0}t\right)\right]_{\frac{T_0}{4}}^{\frac{3T_0}{4}} \right) \\
+				 &= \frac{1}{\pi n} \left(
+				 	\SI{0.8}{V} \cdot \left(
+				 		\sin\left(\frac{\pi}{2}n\right)
+				 		- \underbrace{\sin\left(-\frac{\pi}{2}n\right)}_{= \sin\left(\frac{\pi}{2}n\right)}
+				 	\right)
+				 	- \SI{0.2}{V} \cdot \left(
+				 		\underbrace{\sin\left(\frac{3\pi}{2}n\right)}_{= \sin\left(\frac{\pi}{2}n\right)}
+				 		- \sin\left(\frac{\pi}{2}n\right)
+				 	\right)
+				 \right) \\
+				 &= \frac{2}{\pi n} \left( \SI{0.8}{V} \cdot \sin\left(\frac{\pi}{2}n\right) - \SI{0.2}{V} \cdot \sin\left(\frac{\pi}{2}n\right) \right) \\
+				 &= \frac{\SI{2,0}{V}}{\pi n} \cdot \sin\left(\frac{\pi}{2}n\right) \\
+				 &= \begin{cases}
+				 	\frac{\SI{2,0}{V}}{\pi n} (-1)^{\frac{n+3}{2}} &\quad \; \forall n \text{ odd}, \\
+				 	0 &\quad \; \forall n \text{ even}.
+				 \end{cases}
+			\end{split}
+		\end{equation*}
+		
+		$a_0$ (DC bias) needs special treatment.
+		\begin{equation*}
+			\begin{split}
+				a_0 &= \frac{1}{T_0} \left( \int\limits_{-\frac{T_0}{4}}^{\frac{T_0}{4}} \SI{0.8}{V} \, \mathrm{d} t - \int\limits_{\frac{T_0}{4}}^{\frac{3T_0}{4}} \SI{0.2}{V}  \, \mathrm{d} t \right) \\
+				 &= \frac{1}{T_0} \left( \SI{0.8}{V} \cdot \left[t\right]_{-\frac{T_0}{4}}^{\frac{T_0}{4}} - \SI{0.2}{V} \cdot \left[t\right]_{\frac{T_0}{4}}^{\frac{3T_0}{4}} \right) \\
+				 &= \frac{1}{T_0} \left( \SI{0.8}{V} \cdot \left(\frac{T_0}{4} - \left(-\frac{T_0}{4}\right)\right) - \SI{0.2}{V} \cdot \left(\frac{3T_0}{4} - \frac{T_0}{4}\right) \right) \\
+				 &= \frac{1}{T_0} \left( \SI{0.8}{V} \cdot \frac{T_0}{2} - \SI{0.2}{V} \cdot \frac{T_0}{2} \right) \\
+				 &= \SI{0.3}{V}
+			\end{split}
+		\end{equation*}
+		
+		\begin{equation*}
+			\begin{split}
+				b_n &= \frac{2}{T_0} \left( \int\limits_{-\frac{T_0}{4}}^{\frac{T_0}{4}} \SI{0.8}{V} \cdot \sin\left(n\frac{2\pi}{T_0}t\right) \, \mathrm{d} t - \int\limits_{\frac{T_0}{4}}^{\frac{3T_0}{4}} \SI{0.2}{V} \cdot \sin\left(n\frac{2\pi}{T_0}t\right) \, \mathrm{d} t \right) \\
+				 &= \frac{2}{T_0} \frac{T_0}{2 \pi n} \left( \SI{0.8}{V} \cdot \left[-\cos\left(n\frac{2\pi}{T_0}t\right)\right]_{-\frac{T_0}{4}}^{\frac{T_0}{4}} - \SI{0.2}{V} \cdot \left[-\cos\left(n\frac{2\pi}{T_0}t\right)\right]_{\frac{T_0}{4}}^{\frac{3T_0}{4}} \right) \\
+				 &= \frac{1}{\pi n} \left(
+					\SI{0.8}{V} \cdot \left(
+						-\cos\left(\frac{\pi}{2}n\right)
+						+ \underbrace{\cos\left(-\frac{\pi}{2}n\right)}_{= \cos\left(\frac{\pi}{2}n\right)}
+					\right)
+					- \SI{0.2}{V} \cdot \left(
+						-\underbrace{\cos\left(\frac{3\pi}{2}n\right)}_{= \cos\left(\frac{\pi}{2}n\right)}
+						+ \cos\left(\frac{\pi}{2}n\right)
+					\right)
+				\right) \\
+				 &= 0
+			\end{split}
+		\end{equation*}
+		
+		\task
+		$\underline{c}_n$:
+		\begin{equation*}
+			\begin{split}
+				b_n &= \frac{1}{T_0} \left( \int\limits_{-\frac{T_0}{4}}^{\frac{T_0}{4}} \SI{0.8}{V} \cdot e^{-j n\frac{2\pi}{T_0}t} \, \mathrm{d} t - \int\limits_{\frac{T_0}{4}}^{\frac{3T_0}{4}} \SI{0.2}{V} \cdot e^{-j n\frac{2\pi}{T_0}t} \, \mathrm{d} t \right) \\
+				&= \frac{1}{T_0} \frac{T_0}{2 \pi n (-j)} \left(
+					\SI{0.8}{V} \cdot \left[e^{-j n\frac{2\pi}{T_0}t}\right]_{-\frac{T_0}{4}}^{\frac{T_0}{4}}
+					- \SI{0.2}{V} \cdot \left[e^{-j n\frac{2\pi}{T_0}t}\right]_{\frac{T_0}{4}}^{\frac{3T_0}{4}}
+				\right) \\
+				&= j \frac{1}{2 \pi n} \left(
+					\SI{0.8}{V} \left(
+						e^{-j n\frac{\pi}{2}}
+						- e^{+j n\frac{\pi}{2}}
+					\right)
+					- \SI{0.2}{V} \left(
+						e^{-j n\frac{3 \pi}{2}}
+						- e^{-j n\frac{\pi}{2}}
+					\right)
+				\right) \\
+				&=  \begin{cases}
+					\frac{\SI{1,0}{V}}{\pi n} e^{j\frac{n+3}{2}\pi} &\quad \; \forall n \text{ odd}, \\
+					0 &\quad \; \forall n \text{ even}.
+				\end{cases}
+			\end{split}
+		\end{equation*}
+		Following has been used:
+		\begin{equation*}
+			\begin{split}
+				\left(e^{-j n\frac{\pi}{2}} - e^{+j n\frac{\pi}{2}}\right) &= \begin{cases}
+					-j &\quad \forall n = 4 k + 1, k \in \mathbb{Z}, \\
+					+j &\quad \forall n = 4 k + 3, k \in \mathbb{Z}, \\
+					0 &\quad \forall n = 2 k, k \in \mathbb{Z}.
+				\end{cases} \\
+				\left(e^{-j n\frac{3 \pi}{2}} - e^{-j n\frac{\pi}{2}}\right) &= \begin{cases}
+					+j &\quad \forall n = 4 k + 1, k \in \mathbb{Z}, \\
+					-j &\quad \forall n = 4 k + 3, k \in \mathbb{Z}, \\
+					0 &\quad \forall n = 2 k, k \in \mathbb{Z}.
+				\end{cases}
+			\end{split}
+		\end{equation*}
+		
+		\task
+		\begin{figure}[H]
+			\centering
+			\begin{tikzpicture}
+				\begin{axis}[
+					height={0.25\textheight},
+					width=0.9\linewidth,
+					scale only axis,
+					xlabel={$n$},
+					ylabel={$\left|\underline{c}_n\right| in \si{V}$},
+					%grid style={line width=.6pt, color=lightgray},
+					%grid=both,
+					grid=none,
+					legend pos=north east,
+					axis y line=middle,
+					axis x line=middle,
+					every axis x label/.style={
+						at={(ticklabel* cs:1.05)},
+						anchor=north,
+					},
+					every axis y label/.style={
+						at={(ticklabel* cs:1.05)},
+						anchor=east,
+					},
+					xmin=-5.5,
+					xmax=5.5,
+					xtick={-5, -4, ..., 5},
+					ymin=0,
+					ymax=0.45,
+					ytick={0, 0.1, ..., 0.4}
+				]
+					\addplot[red, thick] coordinates {(-5,0) (-5,0.064)};
+					\addplot[red, thick] coordinates {(-3,0) (-3,0.106)};
+					\addplot[red, thick] coordinates {(-1,0) (-1,0.318)};
+					\addplot[red, thick] coordinates {(0,0) (0,0.3)};
+					\addplot[red, thick] coordinates {(1,0) (1,0.318)};
+					\addplot[red, thick] coordinates {(3,0) (3,0.106)};
+					\addplot[red, thick] coordinates {(5,0) (5,0.064)};
+					
+					\addplot[red, thick, only marks, mark=o] coordinates {(-5,0.064)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(-4,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(-3,0.106)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(-2,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(-1,0.318)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(0,0.3)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(1,0.318)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(2,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(3,0.106)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(4,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(5,0.064)};
+				\end{axis}
+			\end{tikzpicture}
+		\end{figure}
+	
+		\begin{figure}[H]
+			\centering
+			\begin{tikzpicture}
+				\begin{axis}[
+					height={0.25\textheight},
+					width=0.9\linewidth,
+					scale only axis,
+					xlabel={$\omega \text{ in } \si{s^{-1}}$},
+					ylabel={$\left|\underline{H}\left(j \omega\right)\right|$},
+					%grid style={line width=.6pt, color=lightgray},
+					%grid=both,
+					grid=none,
+					legend pos=north east,
+					axis y line=middle,
+					axis x line=middle,
+					every axis x label/.style={
+						at={(ticklabel* cs:1.05)},
+						anchor=north,
+					},
+					every axis y label/.style={
+						at={(ticklabel* cs:1.05)},
+						anchor=east,
+					},
+					xmin=-5.5,
+					xmax=5.5,
+					ymin=-3.5,
+					ymax=3.5,
+					ytick={-3.14159, -1.5708, 1.5708, 3.14159},
+					yticklabels={$-\pi\hspace{0.30cm}$, $-\frac{\pi}{2}$, $\frac{\pi}{2}$, $\pi\hspace{0.10cm}$},
+				]
+					\addplot[red, thick] coordinates {(-5,0) (-5,0)};
+					\addplot[red, thick] coordinates {(-3,0) (-3,-3.14159)};
+					\addplot[red, thick] coordinates {(-1,0) (-1,0)};
+					\addplot[red, thick] coordinates {(0,0) (0,0)};
+					\addplot[red, thick] coordinates {(1,0) (1,0)};
+					\addplot[red, thick] coordinates {(3,0) (3,3.14159)};
+					\addplot[red, thick] coordinates {(5,0) (5,0)};
+					
+					\addplot[red, thick, only marks, mark=o] coordinates {(-5,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(-4,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(-3,-3.14159)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(-2,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(-1,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(0,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(1,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(2,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(3,3.14159)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(4,0)};
+					\addplot[red, thick, only marks, mark=o] coordinates {(5,0)};
+				\end{axis}
+			\end{tikzpicture}
+		\end{figure}
+	
 		%TODO
 	\end{tasks}
 \end{solution}
@@ -238,7 +441,7 @@
 						height={0.25\textheight},
 						width=0.9\linewidth,
 						scale only axis,
-						xlabel={$\omega \text{ in } \si{Hz}$},
+						xlabel={$\omega \text{ in } \si{s^{-1}}$},
 						ylabel={$\left|\underline{X}\left(j \omega\right)\right| \text{ in } \si{V/Hz}$},
 						%grid style={line width=.6pt, color=lightgray},
 						%grid=both,
@@ -278,7 +481,7 @@
 						height={0.25\textheight},
 						width=0.9\linewidth,
 						scale only axis,
-						xlabel={$\omega \text{ in } \si{Hz}$},
+						xlabel={$\omega \text{ in } \si{s^{-1}}$},
 						ylabel={$\arg\left(\underline{X}\left(j \omega\right)\right) \text{ in } \si{\degree}$},
 						%grid style={line width=.6pt, color=lightgray},
 						%grid=both,
@@ -343,7 +546,64 @@
 \end{question}
 
 \begin{solution}
-	%TODO
+	\begin{tasks}
+		\task
+		Network analysis:
+		\begin{figure}[H]
+			\centering
+			\begin{circuitikz}
+				\draw (0, 0) to[L, l=$L$, v=$u_L(t)$, i=$i_C(t)$, o-] ++(2,0) to[short, i=$i_o(t)$, *-o] ++(2,0);
+				\draw (2, 0) to[C, l=$C$, i=$i_C(t)$, -*] ++(0,-2);
+				\draw (0, -2) to[short, o-o] ++(4,0);
+				
+				\draw (0, 0) to[open, v=$u_i(t)$] (0, -2);
+				\draw (4, 0) to[open, v^=$u_o(t)$] (4, -2);
+			\end{circuitikz}
+		\end{figure}
+		\begin{itemize}
+			\item Kirchhoff's current law at the only point in the circuit:
+			\begin{equation*}
+				i_L(t) = i_C(t) + i_o(t)
+			\end{equation*}
+			\item No load at the output: $i_o(t) = 0$
+			\item Kirchhoff's coltage law at the only closed loop in the circuit:
+			\begin{equation*}
+				u_i(t) = u_L(t) + u_o(t)
+			\end{equation*}
+			\item Differential equation for capacitors:
+			\begin{equation*}
+				i_C(t) = C \frac{\mathrm{d} u_o(t)}{\mathrm{d} t}
+			\end{equation*}
+			\item Differential equation for inductors:
+			\begin{equation*}
+				u_L(t) = L \frac{\mathrm{d} u_L(t)}{\mathrm{d} t} = L C \frac{\mathrm{d}^2 u_o(t)}{\mathrm{d} t^2}
+			\end{equation*}
+		\end{itemize}
+		Finally,
+		\begin{equation*}
+			u_i(t) = L C \frac{\mathrm{d}^2 u_o(t)}{\mathrm{d} t^2} + u_o(t)
+		\end{equation*}
+		
+		\task
+		\begin{equation*}
+			\begin{split}
+				u_i(t) &= L C \frac{\mathrm{d}^2 u_o(t)}{\mathrm{d} t^2} + u_o(t) \\
+				\underline{U}_i \left(j \omega\right) &= \left( \left(j \omega\right)^2 L C + 1 \right) \underline{U}_o \left(j \omega\right)
+			\end{split}
+		\end{equation*}
+		\begin{equation*}
+			\begin{split}
+			\underline{H} \left(j \omega\right) &= \frac{\underline{U}_o \left(j \omega\right)}{\underline{U}_i \left(j \omega\right)} \\
+			 &= \frac{1}{\left(j \omega\right)^2 L C + 1}
+			\end{split}
+		\end{equation*}
+		
+		\task
+		Yes, this is a real circuit which can be implemented with electronic components. Real components do not have knowledge of the future.
+		
+		\task
+		Second order low pass filter
+	\end{tasks}
 \end{solution}
 
 \begin{question}[subtitle={Amplitude and Phase Response}]
@@ -430,6 +690,40 @@
 			\end{split}
 		\end{equation*}
 		
+		\begin{figure}[H]
+			\centering
+			\begin{tikzpicture}
+				\begin{axis}[
+					height={0.25\textheight},
+					width=0.9\linewidth,
+					scale only axis,
+					xlabel={$\omega \text{ in } \si{s^{-1}}$},
+					ylabel={$\left|\underline{H}\left(j \omega\right)\right|$},
+					%grid style={line width=.6pt, color=lightgray},
+					%grid=both,
+					grid=none,
+					legend pos=north east,
+					axis y line=middle,
+					axis x line=middle,
+					every axis x label/.style={
+						at={(ticklabel* cs:1.05)},
+						anchor=north,
+					},
+					every axis y label/.style={
+						at={(ticklabel* cs:1.05)},
+						anchor=east,
+					},
+					xmin=-21e3,
+					xmax=21e3,
+					ymin=0,
+					ymax=1.2,
+					ytick={0, 0.5, 1}
+				]
+					\addplot[blue, thick, smooth, domain=-20e3:20e3, samples=100] plot (\x, {sqrt( (4.7e-5 * \x)^2 / ((4.7e-5 * \x)^2 + 1) )});
+				\end{axis}
+			\end{tikzpicture}
+		\end{figure}
+		
 		\task
 		\begin{equation*}
 			\begin{split}
@@ -446,6 +740,48 @@
 			\end{split}
 		\end{equation*}
 		
+		\begin{figure}[H]
+			\centering
+			\begin{tikzpicture}
+				\begin{axis}[
+					height={0.25\textheight},
+					width=0.9\linewidth,
+					scale only axis,
+					xlabel={$\omega \text{ in } \si{s^{-1}}$},
+					ylabel={$\left|\underline{H}\left(j \omega\right)\right|$},
+					%grid style={line width=.6pt, color=lightgray},
+					%grid=both,
+					grid=none,
+					legend pos=north east,
+					axis y line=middle,
+					axis x line=middle,
+					every axis x label/.style={
+						at={(ticklabel* cs:1.05)},
+						anchor=north,
+					},
+					every axis y label/.style={
+						at={(ticklabel* cs:1.05)},
+						anchor=east,
+					},
+					xmin=-21e3,
+					xmax=21e3,
+					%ymin=-3.5,
+					%ymax=3.5,
+					%ytick={-3.14159, -1.5708, 1.5708, 3.14159},
+					%yticklabels={$-\pi\hspace{0.30cm}$, $-\frac{\pi}{2}$, $\frac{\pi}{2}$, $\pi\hspace{0.10cm}$},
+					%yticklabels={$\SI{-180}{\degree}$, $\SI{-90}{\degree}$, $\SI{90}{\degree}$, $\SI{180}{\degree}$},
+					ymin=-1.7,
+					ymax=1.7,
+					ytick={-1.5708, 1.5708},
+					yticklabels={$\SI{-90}{\degree}$, $\SI{90}{\degree}$},
+				]
+					%\addplot[blue, thick, smooth, domain=-20e3:20e3, samples=100] plot (\x, {(2*pi/360) * atan2(((4.7e-05*\x)/((4.7e-05*\x)^2+1)), ((4.7e-05)^2/((4.7e-05*\x)^2+1)))});
+					\addplot[blue, thick, smooth, domain=1:20e3, samples=50] plot (\x, {(2*pi/360) * atan(1/((4.7e-5)*\x))});
+					\addplot[blue, thick, smooth, domain=-20e3:-1, samples=50] plot (\x, {(2*pi/360) * atan(1/((4.7e-5)*\x))});
+				\end{axis}
+			\end{tikzpicture}
+		\end{figure}
+		
 		\task
 		\begin{equation*}
 			\underline{U}_i\left(j \omega\right) = \mathcal{F}\left\{u_i(t)\right\} = \SI{2}{V} \pi \left(\delta\left(\omega - 2 \pi \cdot \SI{2.5}{kHz}\right) + \delta\left(\omega + 2 \pi \cdot \SI{2.5}{kHz}\right)\right)
@@ -463,7 +799,5 @@
 			u_o(t) = \mathcal{F}^{-1}\left\{\underline{U}_i\left(j \omega\right)\right\} = \SI{1.19}{V} \cdot \cos\left(2 \pi \cdot \SI{2.5}{kHz} \cdot t - \SI{53.6}{\degree}\right)
 		\end{equation*}
 		The signal has been attenuated and phase-shifted.
-		
-		%TODO
 	\end{tasks}
 \end{solution}
-- 
cgit v1.1

