GDET3 RL-Hochpass.ipynb 14.3 KB
 Christian Rohlfing committed Nov 09, 2018 1 2 3 4 5 { "cells": [ { "cell_type": "code", "execution_count": null,  Christian Rohlfing committed Sep 03, 2019 6 7 8 9 10  "metadata": { "jupyter": { "source_hidden": true } },  Christian Rohlfing committed Nov 09, 2018 11 12  "outputs": [], "source": [  Hafiz Emin Kosar committed Mar 19, 2020 13  "# Copyright 2020 Institut für Nachrichtentechnik, RWTH Aachen University\n",  Christian Rohlfing committed Sep 03, 2019 14  "%matplotlib widget\n",  Christian Rohlfing committed Nov 09, 2018 15 16 17 18 19 20 21  "\n", "from ipywidgets import interact, interactive\n", "import ipywidgets as widgets\n", "from IPython.display import clear_output, display, HTML\n", "\n", "from scipy import signal\n", "\n",  Christian Rohlfing committed May 06, 2019 22  "from ient_nb.ient_plots import *\n",  Christian Rohlfing committed May 09, 2019 23  "from ient_nb.ient_signals import *"  Christian Rohlfing committed Nov 09, 2018 24 25 26  ] }, {  Christian Rohlfing committed Apr 29, 2019 27 28  "cell_type": "markdown", "metadata": {},  Christian Rohlfing committed Nov 09, 2018 29  "source": [  Christian Rohlfing committed Apr 29, 2019 30 31 32 33 34  "
\n", "\n", "# RL-Netzwerk"  Christian Rohlfing committed Nov 09, 2018 35 36 37 38 39 40  ] }, { "cell_type": "markdown", "metadata": {}, "source": [  Christian Rohlfing committed Sep 17, 2019 41  "Dieses Notebook dient der Veranschaulichung von Übungsaufgabe 3.1. \n",  Iris Heisterklaus committed Sep 16, 2019 42 43 44  "\n", "Es wird folgendes RL-Netzwerk betrachtet:\n", "\n",  Christian Rohlfing committed Sep 17, 2019 45  "![Blockdiagramm](figures/rl_highpass_block_diagram.png)\n",  Iris Heisterklaus committed Sep 16, 2019 46  "\n",  Christian Rohlfing committed Nov 09, 2018 47 48  "## Berechnung von Betrag und Phase\n", "\n",  Iris Heisterklaus committed Sep 16, 2019 49  "Es gilt für die Spannung \n",  Christian Rohlfing committed Apr 29, 2019 50  "$U_1(F) = R I_1(F)+U_2(F)$ \n",  Iris Heisterklaus committed Sep 16, 2019 51 52  "und den Strom\n", "$\\displaystyle I_1(F) = \\frac{U_2(F)}{\\mathrm{j}2 \\pi F L}$.\n",  Christian Rohlfing committed Nov 09, 2018 53  "\n",  Iris Heisterklaus committed Sep 16, 2019 54  "Dies ergibt\n",  Christian Rohlfing committed Apr 29, 2019 55  "$U_1(F) = U_2(F) \\left[ \\frac{R}{\\mathrm{j} 2\\pi F L} + 1\\right]$ \n",  Christian Rohlfing committed Nov 09, 2018 56  "bzw.\n",  Iris Heisterklaus committed Sep 16, 2019 57  "$\\displaystyle H(F) = \\frac{U_2(F)}{U_1(F)} = \\frac{\\mathrm{j}2 \\pi F L}{R+\\mathrm{j} 2 \\pi F L}$.\n",  Christian Rohlfing committed Nov 18, 2018 58  "\n",  Christian Rohlfing committed Nov 09, 2018 59 60 61 62 63 64 65 66 67 68  "Mit \n", "$T = \\frac{L}{R}$" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [  Christian Rohlfing committed May 06, 2019 69  "T = 1e-6"  Christian Rohlfing committed Nov 09, 2018 70 71 72 73 74 75  ] }, { "cell_type": "markdown", "metadata": {}, "source": [  Christian Rohlfing committed Apr 29, 2019 76  "folgt $\\displaystyle H(F) = \\frac{\\mathrm{j} 2 \\pi FT}{1+\\mathrm{j}2 \\pi F T}$.\n",  Christian Rohlfing committed Nov 18, 2018 77  "\n",  Iris Heisterklaus committed Sep 16, 2019 78  "Eliminiere komplexen Term im Nenner:\n",  Christian Rohlfing committed Apr 29, 2019 79  "$\\displaystyle H(F)\n",  Christian Rohlfing committed Nov 09, 2018 80  "= \\frac{\\mathrm{j} 2 \\pi F T}{1+\\mathrm{j}2 \\pi FT} \\frac{1-\\mathrm{j}2 \\pi FT}{1-\\mathrm{j}2 \\pi FT} \n",  Christian Rohlfing committed Nov 18, 2018 81 82  "= \\frac{\\mathrm{j}2\\pi F T+\\left(2\\pi F T\\right)^2}{1+\\left(2 \\pi F T\\right)^2}$\n", "\n",  Iris Heisterklaus committed Sep 16, 2019 83  "Somit folgt für den Betrag \n",  Christian Rohlfing committed Apr 29, 2019 84 85  "$$|H(F)|\n", "= \\frac{|2\\pi F T|}{\\sqrt{1+\\left(2 \\pi F T\\right)^2}}$$"  Christian Rohlfing committed Nov 09, 2018 86 87 88 89 90 91 92 93  ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [  Christian Rohlfing committed Apr 29, 2019 94  "def Habs(F):\n",  Christian Rohlfing committed May 06, 2019 95  " return abs(2*np.pi*F*T)/np.sqrt(1+(2*np.pi*F*T)**2);"  Christian Rohlfing committed Nov 09, 2018 96 97 98 99 100 101  ] }, { "cell_type": "markdown", "metadata": {}, "source": [  Iris Heisterklaus committed Sep 16, 2019 102  "und die Phase \n",  Christian Rohlfing committed Apr 29, 2019 103 104  "$$\\varphi(F)\n", "= \\mathrm{arctan}\\left(\\frac{\\mathrm{Im}\\left\\{H(F)\\right\\}}{\\mathrm{Re}\\left\\{H(F)\\right\\}}\\right) \n",  Iris Heisterklaus committed Sep 16, 2019 105  "= \\mathrm{arctan}\\left(\\frac{1}{2\\pi F T}\\right)\\text{.}$$"  Christian Rohlfing committed Nov 09, 2018 106 107 108 109 110 111 112 113  ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [  Christian Rohlfing committed Apr 29, 2019 114 115  "def Hphi(F): \n", " return np.arctan(1/(2*np.pi*F*T));"  Christian Rohlfing committed Nov 09, 2018 116 117  ] },  Christian Rohlfing committed May 06, 2019 118 119 120 121  { "cell_type": "markdown", "metadata": {}, "source": [  Iris Heisterklaus committed Sep 16, 2019 122  "Plotte $|H(F)|$ und $\\varphi(F)$:"  Christian Rohlfing committed May 06, 2019 123 124 125 126 127 128 129 130 131 132 133  ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "RL = 1/T; RLF = RL/(2*np.pi);\n", "(F, deltaF) = np.linspace(-.75, .75, 4001, retstep=True) + eps # F-axis in MHz\n", "\n",  Christian Rohlfing committed Aug 22, 2019 134  "# Plot\n",  Christian Rohlfing committed May 09, 2019 135  "fig, axs = plt.subplots(1, 2, figsize=(8,4));\n",  Christian Rohlfing committed May 06, 2019 136 137 138 139 140 141  "ax = axs[0]; ax.plot(F, Habs(F*1e6), 'rwth');\n", "ax.plot([-RLF/1e6, RLF/1e6], [1/np.sqrt(2), 1/np.sqrt(2)], 'k--', \n", " [-RLF/1e6,-RLF/1e6], [0, 1/np.sqrt(2)], 'k--', \n", " [RLF/1e6,RLF/1e6], [0, 1/np.sqrt(2)], 'k--');\n", "ax.set_yticks([0,1/np.sqrt(2), 1]); ax.set_yticklabels([r'$0$', r'$1/\\sqrt{2}$', r'$1$']); \n", "ax.set_xlabel(r'$\\rightarrow F$ [MHz]'); ax.set_ylabel(r'$\\uparrow |H(F)|$'); ient_axis(ax);\n",  Christian Rohlfing committed May 09, 2019 142  "ax.yaxis.get_major_ticks()[1].label.set_verticalalignment('bottom');\n",  Christian Rohlfing committed May 06, 2019 143 144 145 146 147 148 149 150 151 152 153  "\n", "ax = axs[1]; ax.plot(F, Hphi(F*1e6), 'rwth');\n", "ax.plot([-RLF/1e6, 0], [-np.pi/4, -np.pi/4], 'k--', \n", " [-RLF/1e6,-RLF/1e6], [0, -np.pi/4], 'k--', \n", " [RLF/1e6, 0], [np.pi/4, np.pi/4], 'k--', \n", " [RLF/1e6,RLF/1e6], [0, np.pi/4], 'k--');\n", "ax.set_yticks([-np.pi/2,-np.pi/4,0,np.pi/4,np.pi/2]); \n", "ax.set_yticklabels([r'$-\\pi/2$', r'$-\\pi/4$', r'$0$', r'$\\pi/4$',r'$\\pi/2$']); \n", "ax.set_xlabel(r'$\\rightarrow F$ [MHz]'); ax.set_ylabel(r'$\\uparrow \\varphi(F)$'); ient_axis(ax);" ] },  Christian Rohlfing committed Nov 09, 2018 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204  { "cell_type": "markdown", "metadata": {}, "source": [ "Werte Betrag und Phase aus für $F=100\\ \\mathrm{kHz}$" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "F = 100e3; # Hz\n", "print('|H(F)| = {0:.3f}'.format(Habs(F)))\n", "print('phi(F) = {0:.3f}°'.format(Hphi(F)*180/np.pi))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Werte Betrag und Phase aus für $F=300\\ \\mathrm{kHz}$" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print('|H(3F)| = {0:.3f}'.format(Habs(3*F)))\n", "print('phi(3F) = {0:.3f}°'.format(Hphi(3*F)*180/np.pi))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Zusätzlich Betrag für $F=0$" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print('|H(0)| = {0:.3f}'.format(Habs(0)))" ] },  Iris Heisterklaus committed Sep 20, 2019 205 206 207 208 209 210 211  { "cell_type": "markdown", "metadata": {}, "source": [ "Am Plot der Übertragungsfunktion und den berechneten Werten kann eindeutig erkannt werden, dass es sich hierbei um einen Hochpass handelt. Niedrige Frequenzen werden gedämpft, während hohe Frequenzen durchgelassen werden. " ] },  Christian Rohlfing committed Nov 09, 2018 212 213 214 215 216  { "cell_type": "markdown", "metadata": {}, "source": [ "## Berechnung der Ausgangsspannung\n",  Iris Heisterklaus committed Sep 16, 2019 217  "Die Eingangsspannung beträgt laut Aufgabenstellung \n",  Christian Rohlfing committed Nov 09, 2018 218  "\n",  Christian Rohlfing committed Apr 29, 2019 219  "$u_1(t)\n",  Christian Rohlfing committed Nov 09, 2018 220 221  "= 1 \\mathrm{V}\n", "+ 1 \\mathrm{V} \\cos\\left(2 \\pi F t\\right)\n",  Christian Rohlfing committed Apr 29, 2019 222  "- 0{,}3 \\mathrm{V} \\cos\\left(6 \\pi F t\\right)$\n",  Christian Rohlfing committed Nov 09, 2018 223  "\n",  Iris Heisterklaus committed Sep 16, 2019 224 225  "Für die Ausgangsspannung gilt nun\n", "\n",  Christian Rohlfing committed Apr 29, 2019 226  "$u_2(t)\n",  Christian Rohlfing committed Nov 09, 2018 227  "= \\underbrace{ \n",  Christian Rohlfing committed Apr 29, 2019 228 229 230  "|H(0)|\\,1 \\mathrm{V}}_{=0}\n", "+ |H\\left(F\\right)|\\,1 \\mathrm{V}\\, \\cos\\left(2 \\pi F t + \\varphi(F)\\right)\n", "- 0{,}3 \\mathrm{V}\\, |H(3F)| \\cos\\left(2\\cdot3 \\pi F t + \\varphi(3F)\\right)\n",  Christian Rohlfing committed Nov 09, 2018 231 232  "\\\\\n", "= \n",  Christian Rohlfing committed Apr 29, 2019 233 234  "|H(F)| \\, 1 \\mathrm{V}\\, \\cos\\left(2 \\pi F \\left[t - t_0\\right]\\right)\n", "- 0{,}3\\mathrm{V}\\, |H(3F)| \\cos\\left(2\\cdot3 \\pi F \\left[t - t_1\\right]\\right)$\n",  Christian Rohlfing committed Nov 09, 2018 235 236  "\n", "mit Phasenlaufzeiten\n",  Christian Rohlfing committed Apr 29, 2019 237  "$\\displaystyle t_0 = -\\frac{\\varphi(F)}{2\\pi F}$ und $\\displaystyle t_1 = -\\frac{\\varphi(3F)}{6\\pi F}$"  Christian Rohlfing committed Nov 09, 2018 238 239 240 241 242 243 244 245  ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [  Christian Rohlfing committed Nov 18, 2018 246  "phaseDelay = lambda F: -Hphi(F)/(2*np.pi*F);\n",  Christian Rohlfing committed Nov 09, 2018 247 248 249 250 251 252 253 254 255 256 257 258  "print('t0 = {0:.3e} s'.format(phaseDelay(F)))\n", "print('t1 = {0:.3e} s'.format(phaseDelay(3*F)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Skizze der Eingangs- und Ausgangsspannungen\n", "\n", "### Skizze von beiden Komponenten von $u_2\\left(t\\right)$\n", "\n",  Christian Rohlfing committed Nov 18, 2018 259  "Skizze $|H\\left(F\\right)| \\cos\\left(2 \\pi F \\left[t-t_0\\right]\\right)$"  Christian Rohlfing committed Nov 09, 2018 260 261 262 263 264 265 266 267  ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [  Christian Rohlfing committed Apr 29, 2019 268 269  "def u2p1(t,F): # first component of u2(t)\n", " return Habs(F)*np.cos(2*np.pi*F*(t-phaseDelay(F)));\n",  Christian Rohlfing committed Nov 09, 2018 270  "\n",  Christian Rohlfing committed Apr 29, 2019 271 272  "(t,deltat) = np.linspace(-10, 10, 10001, retstep=True) # t-axis\n", "t0 = phaseDelay(F) # Phase Delay\n",  Christian Rohlfing committed Nov 09, 2018 273  "\n",  Christian Rohlfing committed Apr 29, 2019 274  "# Plot\n",  Christian Rohlfing committed May 06, 2019 275  "fig,ax = plt.subplots(1,1,figsize=(6,2)); ax.plot(t, u2p1(t/1e6,F), 'rwth'); \n",  Christian Rohlfing committed Nov 09, 2018 276  "ax.set_xlabel(r'$t/\\mu\\mathrm{s}\\rightarrow$',x=0.9); \n",  Christian Rohlfing committed Nov 18, 2018 277  "ax.set_ylabel(r'$\\uparrow |H\\left(F\\right)| \\cos\\left(2 \\pi F \\left[t-t_0\\right]\\right)$');\n",  Christian Rohlfing committed May 06, 2019 278 279  "ax.plot([t0*1e6, t0*1e6], [0, u2p1(t0,F)], '--', color='grun', lw=1)\n", "ax.text(t0*1e6,0, r'$t_0$', fontsize=14, horizontalalignment='left', verticalalignment='top',color='grun')\n",  Christian Rohlfing committed May 09, 2019 280  "ax.set_xlim(-11, 11); ient_axis(ax);"  Christian Rohlfing committed Nov 09, 2018 281 282 283 284 285 286  ] }, { "cell_type": "markdown", "metadata": {}, "source": [  Christian Rohlfing committed Nov 18, 2018 287  "Skizze $|H\\left(3F\\right)| \\cos\\left(6 \\pi F \\left[t-t_1\\right]\\right)$"  Christian Rohlfing committed Nov 09, 2018 288 289 290 291 292 293 294 295  ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [  Christian Rohlfing committed Apr 29, 2019 296 297  "def u2p2(t,F): # second component of u2(t)\n", " return Habs(3*F)*np.cos(6*np.pi*F*(t-phaseDelay(3*F)));\n",  Christian Rohlfing committed Nov 09, 2018 298  "\n",  Christian Rohlfing committed Apr 29, 2019 299  "t1 = phaseDelay(3*F) # phase delay\n",  Christian Rohlfing committed Nov 09, 2018 300  "\n",  Christian Rohlfing committed Aug 22, 2019 301  "# Plot\n",  Christian Rohlfing committed May 06, 2019 302  "fig,ax = plt.subplots(1,1,figsize=(6,2)); ax.plot(t, u2p2(t/1e6,F), 'rwth');\n",  Christian Rohlfing committed Apr 29, 2019 303  "ax.set_xlabel(r'$t/\\mu\\mathrm{s}\\rightarrow$'); \n",  Christian Rohlfing committed Nov 18, 2018 304  "ax.set_ylabel(r'$\\uparrow |H\\left(3F\\right)| \\cos\\left(6 \\pi F \\left[t-t_1\\right]\\right)$');\n",  Christian Rohlfing committed May 06, 2019 305 306  "ax.plot([t1*1e6, t1*1e6], [0, u2p2(t1,F)], '--', color='grun', lw=1)\n", "ax.text(t1*1e6,0, r'$t_1$', fontsize=14, horizontalalignment='right', verticalalignment='top',color='grun')\n",  Christian Rohlfing committed May 09, 2019 307  "ax.set_xlim(-11, 11); ax.set_ylim(-1.5, 1.5); ient_axis(ax);"  Christian Rohlfing committed Nov 09, 2018 308 309 310 311 312 313 314  ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Skizze von\n",  Christian Rohlfing committed Apr 29, 2019 315  "$$u_1(t) = 1 \\mathrm{V}\n",  Christian Rohlfing committed Nov 09, 2018 316  "+ 1 \\mathrm{V} \\cos\\left(2 \\pi F t\\right)\n",  Christian Rohlfing committed Apr 29, 2019 317  "- 0{,}3 \\mathrm{V} \\cos\\left(6 \\pi F t\\right)\\quad \\text{und}$$\n",  Christian Rohlfing committed Nov 09, 2018 318  "\n",  Christian Rohlfing committed Apr 29, 2019 319 320  "$$\n", "u_2(t)\n",  Christian Rohlfing committed Nov 18, 2018 321  "= |H\\left(F\\right)|1 \\mathrm{V} \\cos\\left(2 \\pi F \\left[t-t_0\\right]\\right)\n",  Christian Rohlfing committed Apr 29, 2019 322 323  "- 0{,}3\\mathrm{V} |H\\left(3F\\right)| \\cos\\left(2\\cdot3 \\pi F \\left[t-t_1\\right]\\right)\n", "$$\n",  Christian Rohlfing committed Nov 09, 2018 324 325 326 327 328 329 330 331 332  "für $F=100\\,\\mathrm{kHz}$ und $F=1\\,\\mathrm{MHz}$" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [  Christian Rohlfing committed May 06, 2019 333  "def u1(t, F): \n",  Christian Rohlfing committed Apr 29, 2019 334  " return 1 + np.cos(2*np.pi*F*t) - 0.3*np.cos(6*np.pi*F*t);\n",  Christian Rohlfing committed May 06, 2019 335  "def u2(t, F): \n",  Christian Rohlfing committed Apr 29, 2019 336  " return u2p1(t,F) - 0.3*u2p2(t,F);\n",  Christian Rohlfing committed Nov 09, 2018 337  "\n",  Christian Rohlfing committed May 09, 2019 338 339  "# Plot\n", "fig, axs = plt.subplots(1,2,figsize=(6,4));\n",  Christian Rohlfing committed Apr 29, 2019 340  "ax = axs[0];\n",  Christian Rohlfing committed May 09, 2019 341 342 343 344  "ax.plot(t, u1(t/1e6,F), 'rwth', label=r'$u_1\\left(t\\right)/\\mathrm{V}$');\n", "ax.plot(t, u2(t/1e6,F), 'grun', label=r'$u_2\\left(t\\right)/\\mathrm{V}$');\n", "ax.set_title(r'$F=100\\,\\mathrm{kHz}$'); ax.set_xlabel(r'$t/\\mu\\mathrm{s}\\rightarrow$'); \n", "ax.set_xlim(-11, 11); ax.legend(); ient_axis(ax);\n",  Christian Rohlfing committed Nov 09, 2018 345 346  "\n", "scale = 10;\n",  Christian Rohlfing committed Apr 29, 2019 347  "ax = axs[1];\n",  Christian Rohlfing committed May 06, 2019 348 349  "ax.plot(t, u1(t/1e6,F*scale), 'rwth', label=r'$u_1\\left(t\\right)/\\mathrm{V}$')\n", "ax.plot(t, u2(t/1e6,F*scale), 'grun', label=r'$u_2\\left(t\\right)/\\mathrm{V}$')\n",  Christian Rohlfing committed May 09, 2019 350 351  "ax.set_title(r'$F=1\\,\\mathrm{MHz}$'); ax.set_xlabel(r'$t/\\mu\\mathrm{s}\\rightarrow$'); \n", "ax.set_xlim(-11/scale, 11/scale); ax.legend(); ient_axis(ax);"  Christian Rohlfing committed Nov 09, 2018 352 353  ] },  Christian Rohlfing committed Nov 18, 2018 354  {  Christian Rohlfing committed Apr 29, 2019 355  "cell_type": "markdown",  Christian Rohlfing committed Nov 18, 2018 356 357  "metadata": {}, "source": [  Christian Rohlfing committed Apr 29, 2019 358  "## Interaktive Demo"  Christian Rohlfing committed Nov 18, 2018 359 360  ] },  Christian Rohlfing committed Nov 19, 2018 361 362 363  { "cell_type": "code", "execution_count": null,  Christian Rohlfing committed Sep 03, 2019 364 365 366 367 368  "metadata": { "jupyter": { "source_hidden": true } },  Christian Rohlfing committed Nov 19, 2018 369  "outputs": [],  Christian Rohlfing committed Apr 29, 2019 370 371 372 373  "source": [ "(f,deltaf) = np.linspace(-2, 2, 10001, retstep=True) # f-axis\n", "fig,axs = plt.subplots(1,2,figsize=(8,4));\n", "\n",  Christian Rohlfing committed May 06, 2019 374 375 376 377 378  "@widgets.interact(Fsel=widgets.FloatSlider(min=.1, max=2, step=.1, value=.1, description='$F$ [MHz]'))\n", "def update_plot(Fsel):\n", " u1scaled = u1(t/1e6, Fsel*1e6);\n", " u2scaled = u2(t/1e6, Fsel*1e6)\n", " if not axs[0].lines: # Call plot() and decorate axes. Usually, these functions take some processing time\n",  Christian Rohlfing committed Apr 29, 2019 379  " ax = axs[0];\n",  Christian Rohlfing committed May 06, 2019 380 381  " p1, = ax.plot(t, u1scaled, 'rwth', label=r'$u_1\\left(t\\right)/\\mathrm{V}$');\n", " p2, = ax.plot(t, u2scaled, 'grun', label=r'$u_2\\left(t\\right)/\\mathrm{V}$');\n",  Christian Rohlfing committed May 06, 2019 382 383 384  " ax.set_xlim(-1.1/Fsel, 1.1/Fsel); \n", " ax.set_xlabel(r'$t/\\mu\\mathrm{s}\\rightarrow$'); \n", " ax.set_title(r'$F={}\\mathrm{{MHz}}$'.format(Fsel)); ient_axis(ax); ax.legend(); \n",  Christian Rohlfing committed Apr 29, 2019 385 386  "\n", " ax = axs[1]; ax.plot(f,Habs(f*1e6))\n",  Christian Rohlfing committed May 06, 2019 387  " ax.plot([Fsel, Fsel], [0, Habs(Fsel*1e6)], 'ko--', lw=1);\n",  Christian Rohlfing committed Apr 29, 2019 388  " ax.set_xlabel(r'$\\rightarrow F/\\mathrm{MHz}$'); ax.set_ylabel(r'$\\uparrow |H(F)|$'); \n",  Christian Rohlfing committed May 06, 2019 389 390 391 392 393 394 395 396  " ax.set_title(r'Übertragungsfunktion'); ient_axis(ax); \n", " \n", " else: # If lines exist, replace only xdata and ydata since plt.plot() takes longer time\n", " axs[0].lines[0].set_ydata(u1scaled)\n", " axs[0].lines[1].set_ydata(u2scaled)\n", " axs[1].lines[1].set_xdata([Fsel, Fsel])\n", " axs[1].lines[1].set_ydata([0, Habs(Fsel*1e6)])\n", " axs[0].set_xlim(-1.1/Fsel, 1.1/Fsel); \n",  Christian Rohlfing committed May 09, 2019 397  " axs[0].set_title(r'$F={}\\mathrm{{MHz}}$'.format(Fsel))"  Christian Rohlfing committed Apr 29, 2019 398  ]  Christian Rohlfing committed Nov 19, 2018 399  },  Christian Rohlfing committed Nov 09, 2018 400  {  Christian Rohlfing committed Apr 29, 2019 401  "cell_type": "markdown",  Iris Heisterklaus committed Sep 20, 2019 402 403 404 405 406 407 408  "metadata": {}, "source": [ "In dieser Demo kann beobachtet werden, wie sich die Ausgangsspannung verändert, je nachdem welcher Wert für $F$ gewählt wird. Für kleine Werte von $F$ wird die Ausgangsspannung gedämpft, während sie für größere Werte eine zur Eingangsspannung ähnliche Charakteristik aufweist." ] }, { "cell_type": "markdown",  Christian Rohlfing committed Nov 09, 2018 409  "metadata": {},  Christian Rohlfing committed Apr 29, 2019 410  "source": [  Hafiz Emin Kosar committed Mar 19, 2020 411  "___\n",  Christian Rohlfing committed Apr 29, 2019 412 413 414  "This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources) (OER). Feel free to use the notebook for your own purposes. The code is licensed under the [MIT license](https://opensource.org/licenses/MIT). \n", "\n", "Please attribute the work as follows: \n",  Hafiz Emin Kosar committed Mar 19, 2020 415  "*Christian Rohlfing, Übungsbeispiele zur Vorlesung \"Grundgebiete der Elektrotechnik 3 - Signale und Systeme\"*, gehalten von Jens-Rainer Ohm, 2020, Institut für Nachrichtentechnik, RWTH Aachen University."  Christian Rohlfing committed Apr 29, 2019 416  ]  Christian Rohlfing committed Nov 09, 2018 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434  } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3",  Hafiz Emin Kosar committed Mar 19, 2020 435  "version": "3.8.1"  Christian Rohlfing committed Nov 09, 2018 436 437 438  } }, "nbformat": 4,  Christian Rohlfing committed Sep 03, 2019 439  "nbformat_minor": 4  Christian Rohlfing committed Nov 09, 2018 440 }