Commit 5ace75e2 authored by Christian Rohlfing's avatar Christian Rohlfing
Browse files

- added small explanation to GDET3 L Trafo

parent 7b99db0d
%% Cell type:code id: tags:
``` python
# Copyright 2019 Institut für Nachrichtentechnik, RWTH Aachen University
%matplotlib notebook
from ipywidgets import interact, interactive, fixed, HBox, VBox
import ipywidgets as widgets
from IPython.display import clear_output, display, HTML
from IPython.display import Markdown as md
from ient_nb.ient_plots import *
from ient_nb.ient_signals import *
from src.laplace.laplace_plot import pzPoint, pzPlot
from src.funcs import calc_Hf, calc_ht
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
t = np.linspace(-6,6,1024)
f = np.linspace(-6,6,1024)
```
%% Cell type:markdown id: tags:
<div>
<img src="ient_nb/figures/rwth_ient_logo@2x.png" style="float: right;height: 5em;">
</div>
# Laplace-Transformation
%% Cell type:markdown id: tags:
Beispiele
$s_1(t) = \mathrm{e}^{-bt}\cdot\epsilon(t)$
transformiert sich zu
$S_1(p) = \frac{1}{b+p}$ mit Konvergenzbereich $\mathrm{Re}\{p\}>\mathrm{Re}\{-b\}$
%% Cell type:code id: tags:
``` python
b = 2
pp = np.array([-b]); pz = np.array([])
roc = np.array([-b, np.inf])
fig,axs = plt.subplots(1,2)
# Laplace-Bereich
ax = axs[0]
ient_plot_lroc(ax, roc)
ax.plot(np.real(pp), np.imag(pp), **ient_style_poles); ax.plot(np.real(pp), -np.imag(pp), **ient_style_poles)
ax.set_xlabel(r'$\rightarrow \mathrm{Re}$'); ax.set_ylabel(r'$\uparrow \mathrm{Im}$');
ax.set_xlim(-5, 5); ax.set_ylim(-5, 5); ient_grid(ax); ient_axis(ax)
# Zeitbereich
ax = axs[1]
s1, _ = calc_ht(t, 1, pp, pz, [1], [], roc)
ax.plot(t, np.real(s1), **ient_style_graph);
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s_1(t)$'); ient_grid(ax); ient_axis(ax)
```
%% Cell type:markdown id: tags:
Konvergenzbereich umschließt imaginäre Achse, also existiert auch die Fouriertransformierte $S_1(f)$
%% Cell type:code id: tags:
``` python
# Frequenzbereich
S1f = 10**(calc_Hf(f, 1, pp, pz, [1], [])/20)
fig, ax = plt.subplots(1,1)
ax.plot(f, S1f, **ient_style_graph);
ax.set_xlabel(r'$\rightarrow f$'); ax.set_ylabel(r'$\uparrow S_1(f)$');
ax.set_xlim([-5.5,5.5]); ax.set_ylim([-0.1,0.55]); ient_grid(ax); ient_axis(ax)
```
%% Cell type:markdown id: tags:
$s_2(t) = -\mathrm{e}^{-bt}\cdot\epsilon(-t)$
transformiert sich zu
$S_2(p) = \frac{1}{b+p}$ mit Konvergenzbereich $\mathrm{Re}\{p\}<\mathrm{Re}\{-b\}$
%% Cell type:code id: tags:
``` python
roc = np.array([-np.inf, -b])
fig,axs = plt.subplots(1,2)
# Laplace-Bereich
ax = axs[0]
ient_plot_lroc(ax, roc); ient_annotate_order(ax, pp, [1]);
ax.plot(np.real(pp), np.imag(pp), **ient_style_poles); ax.plot(np.real(pp), -np.imag(pp), **ient_style_poles)
ax.set_xlabel(r'$\rightarrow \mathrm{Re}$'); ax.set_ylabel(r'$\uparrow \mathrm{Im}$');
ax.set_xlim(-5, 5); ax.set_ylim(-5, 5); ient_axis(ax); ient_grid(ax)
# Zeitbereich
ax = axs[1]
s2, _ = calc_ht(t, 1, pp, pz, [1], [], roc)
ax.plot(t, np.real(s2), **ient_style_graph);
ax.set_ylim([-45,5]); ax.grid();
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s_2(t)$'); ient_axis(ax)
```
%% Cell type:markdown id: tags:
## Interaktive Demo
%% Cell type:markdown id: tags:
Laplace-Übertragungsfunktion
$$
H(p) = H_0 \frac{
\prod\limits_{q=1}^Q \left( p-p_{\mathrm{N},q} \right)
}{
\prod\limits_{r=1}^R \left( p-p_{\mathrm{P},r} \right)
}
$$
mit $Q$ Nullstellen $p_{\mathrm{N},q}$ und $R$ Polstellen $p_{\mathrm{P},r}$.
%% Cell type:code id: tags:
``` python
pzp = pzPlot()
filter_type = interactive(pzp.update_filter,filtr=widgets.Dropdown(options=list(pzp.filter_types.keys()), value="Sprungfunktion", description='Filter'))
action_type = interactive(pzp.update_action,action=widgets.Dropdown(options=list(pzp.action_types.keys()),value="Hinzufügen", description='Modus'))
point_type = interactive(pzp.update_mode,mode=widgets.Dropdown(options=list(pzp.mode_types.keys()), value="Polstelle", description='Typ'))
amp_type = interactive(pzp.update_amp, H0=widgets.IntSlider(min=1,max=10,step=1,value=1), description="H0")
left_box = VBox([filter_type, amp_type])
right_box = VBox([action_type, point_type])
HBox([left_box, right_box])
```
%% Cell type:markdown id: tags:
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).
Please attribute the work as follows:
*Emin Kosar, Christian Rohlfing, Übungsbeispiele zur Vorlesung "Grundgebiete der Elektrotechnik 3 - Signale und Systeme"*, gehalten von Jens-Rainer Ohm, 2019, Institut für Nachrichtentechnik, RWTH Aachen University.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment