Commit 5a5e1e12 by Christian Rohlfing

### - added dirac in Fourier Transform

parent 92a8967f
 ... ... @@ -55,16 +55,18 @@ "\n", "signal_types_t = {'Rechteck' : rect, \n", " 'Dreieck' : tri, \n", " 'Dirac' : lambda t: [1],\n", " 'si-Funktion' : lambda t: si(2*np.pi*t),\n", " 'Gauß-Signal' : gauss}\n", "\n", "signal_types_f = {'Rechteck' : lambda f,T: np.abs(T)*si(np.pi*T*f),\n", " 'Dreieck' : lambda f,T: np.abs(T)*si(np.pi*T*f)**2, \n", " 'Dirac' : lambda f,T: np.abs(T),\n", " 'si-Funktion' : lambda f,T: np.abs(T)/2*rect(f*T/2),\n", " 'Gauß-Signal' : lambda f,T: np.abs(T)*gauss(f*T)}\n", "\n", "# Plot\n", "plt.close(); fig, axs = plt.subplots(3, 1)\n", "plt.close(); fig, axs = plt.subplots(3, 1); plt.tight_layout();\n", "@widgets.interact(s_type=widgets.Dropdown(options=list(signal_types_t.keys()), description=r'Wähle $s(t)$:'),\n", " T=widgets.FloatSlider(min=0.5, max=4, value=1, step=.1, description=r'Dehnung T', style=ient_wdgtl_style), \n", " t0=widgets.FloatSlider(min=-2, max=2, value=0, step=.1, description=r'Verschiebung $t_0$', style=ient_wdgtl_style))\n", ... ... @@ -77,6 +79,8 @@ " \n", " if not axs[0].lines: # plot s(t)\n", " ax = axs[0]; ax.plot(t, s(t), 'rwth');\n", " ient_plot_dirac(axs[0], [], [])\n", " ient_dirac_weights(axs[0],0,1,2);axs[0].texts[0].set_text('');\n", " ax.set_xlabel(r'$\\rightarrow t$'); ax.set_ylabel(r'$\\uparrow s(t)$')\n", " ax.set_xlim([-2.9, 2.9]); ax.set_ylim([-1.19, 1.19]); ient_axis(ax); ient_grid(ax);\n", " \n", ... ... @@ -88,30 +92,19 @@ " ax.set_xlabel(r'$\\rightarrow f$'); ax.set_ylabel(r'$\\uparrow \\angle S(f)$')\n", " ax.set_xlim([-20,20]); ax.set_ylim([-4, 4]); ient_axis(ax); ient_grid(ax); ax.set_yticks([-np.pi, np.pi]); ax.yaxis.set_ticklabels([r'$-\\pi$', r'$\\pi$'])\n", " else: # update lines\n", " axs[0].lines[0].set_ydata(s(t)); \n", " axs[1].lines[0].set_ydata(Sabs)\n", " axs[2].lines[0].set_ydata(Sangle)\n", " \n", " ient_update_ylim(axs[0], s(t), 0.19, np.max(s(t))); ient_update_ylim(axs[1], Sabs, 0.19, np.max(Sabs)); " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "jupyter": { "source_hidden": true } }, "outputs": [], "source": [ "#t0 = 0.1\n", "#z = np.exp(-2j*np.pi*f*t0)\n", "#\n", "## Plot\n", "#fig,ax=plt.subplots();\n", "#ax.plot(f, np.angle(z), 'rwth')\n", "#ax.set_xlabel(r'$\\rightarrow f$'); ax.set_ylabel(r'$\\uparrow \\angle \\mathrm{e}^{-\\mathrm{j}2\\pi f t_0}$'); ient_axis(ax)" " if s_type == 'Dirac':\n", " axs[0].lines[0].set_ydata(0)\n", " ient_dirac_set_data(axs[0].containers, [t0], [np.abs(T)])\n", " axs[1].lines[0].set_ydata(Sabs)\n", " axs[0].set_ylim(0, np.abs(T)*1.5); axs[1].set_ylim(0, np.abs(T)*1.5)\n", " axs[0].texts[0].set_text('({})'.format(np.abs(T))); axs[0].texts[0].set_x(t0); axs[0].texts[0].set_y(np.abs(T))\n", " else:\n", " ient_dirac_set_data(axs[0].containers, [], [])\n", " axs[0].lines[0].set_ydata(s(t)); \n", " axs[1].lines[0].set_ydata(Sabs)\n", " ient_update_ylim(axs[0], s(t), 0.19, np.max(s(t))); ient_update_ylim(axs[1], Sabs, 0.19, np.max(Sabs));\n", " axs[0].texts[0].set_text('')\n", " axs[2].lines[0].set_ydata(Sangle)" ] }, { ... ...
 ... ... @@ -8,21 +8,26 @@ " \n", "\n", "\n", "# Übungsbeispiele zur Vorlesung Grundgebiete der Elektrotechnik 3 – Signale und Systeme\n", "# Übungsbeispiele zu Grundgebiete der Elektrotechnik 3 – Signale und Systeme\n", "\n", "## Jupyter Quick Start\n", "\n", "* Zum Ausführen aller Cells eines Notebooks: Im Menü: Run Run All Cells\n", "* Zum Neustart: -Button\n", "* Zum Ausführen einer einzelnen Cell: -Button\n", "\n", "## Inhaltsverzeichnis\n", "* Zum Ausführen einer einzelnen Cell: -Button\n", "\n", "## Inhaltsverzeichnis" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1. Determinierte Signale in linearen zeitinvarianten Systemen\n", " * [Elementarsignale](GDET3%20Elementarsignale.ipynb) (Elementarsignale sowie Zeitverschiebung, -spiegelung, -dehnung)\n", " * [Demo Zeitverschiebung, -spiegelung, -dehnung](GDET3%20Zeitverschiebung-Dehnung%20GUI.ipynb)\n", " * [Beispiel zur Berechnung des Faltungsintegrals](GDET3%20Faltungsbeispiel.ipynb)\n", " * [Demo Faltungsintegral](GDET3%20Faltung%20GUI.ipynb)\n" " * [Demo Faltungsintegral](GDET3%20Faltung%20GUI.ipynb)" ] }, { ... ... @@ -31,26 +36,54 @@ "source": [ "2. Laplace-Transformation\n", " * [Beispiele Laplace-Transformation](GDET3%20Laplace-Transformation.ipynb) \n", " * [Demo Laplace-Transformation](GDET3%20Laplace-Transformation%20GUI.ipynb)\n", " * [Demo Laplace-Transformation](GDET3%20Laplace-Transformation%20GUI.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "3. Fourier-Bechreibung von Signalen und Systemen\n", " * [RL-Hochpass](GDET3%20RL-Hochpass.ipynb)\n", " * [Fourier-Reihe](GDET3%20Fourier-Reihenkoeffizienten.ipynb)\n", " * [Demo Fourier-Transformation](GDET3%20Fourier-Transformation.ipynb)\n", " * [Demo Übertragungsfunktion](GDET3%20Übertragungsfunktion.ipynb)\n", " * [Demo Übertragungsfunktion](GDET3%20Übertragungsfunktion.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "4. Diskrete Signale und Systeme\n", " * [Abtastung](GDET3%20Abtastung.ipynb)\n", " * [Diskrete Fourier-Transformation](GDET3%20Diskrete%20Fourier-Transformation.ipynb)\n", " * [Diskrete Fourier-Transformation](GDET3%20Diskrete%20Fourier-Transformation.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "5. Systemtheorie der Tiefpass- und Bandpasssysteme\n", " * [Äquivalenter Tiefpass](GDET3%20Äquivalenter%20Tiefpass.ipynb)\n", " * [Äquivalenter Tiefpass](GDET3%20Äquivalenter%20Tiefpass.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "6. Korrelationsfunktionen determinierter Signale\n", " * [Demo Auto- und Korrelationsfunktion](GDET3%20Autokorrelationsfunktion.ipynb)\n", " * [Demo Korrelationsempfänger](GDET3%20Korrelationsempfänger.ipynb)\n", " * [Demo Auto- und Korrelationsfunktion](GDET3%20Autokorrelationsfunktion.ipynb)\n", " * [Demo Korrelationsempfänger](GDET3%20Korrelationsempfänger.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "7. Statistische Signalbeschreibung\n", " * [Weißes Rauschen](GDET3%20Weißes%20Rauschen.ipynb)\n", " * [Zufallssignale in LTI-Systemen](GDET3%20Zufallssignale%20in%20LTI-Systemen.ipynb)\n", " * [Verteilungs- und Verteilungsdichtefunktion](GDET3%20Verteilungsfunktion.ipynb)\n", " \n", " " " * [Weißes Rauschen](GDET3%20Weißes%20Rauschen.ipynb)\n", " * [Zufallssignale in LTI-Systemen](GDET3%20Zufallssignale%20in%20LTI-Systemen.ipynb)\n", " * [Verteilungs- und Verteilungsdichtefunktion](GDET3%20Verteilungsfunktion.ipynb)" ] }, { ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!