Commit 005b0123 authored by Christian Rohlfing's avatar Christian Rohlfing
Browse files

- index: jupyter quick start

- hide cell nbextension added to requirements and postbuild
parent 9b1306ee
%% Cell type:code id: tags:
``` python
# Copyright 2019 Institut für Nachrichtentechnik, RWTH Aachen University
%matplotlib notebook
from ipywidgets import interact, interactive
import ipywidgets as widgets
import scipy as sp
import scipy.special
import scipy.signal
from ient_nb.ient_plots import *
from ient_nb.ient_signals import *
```
%% Cell type:markdown id: tags:
<div>
<img src="ient_nb/figures/rwth_ient_logo@2x.png" style="float: right;height: 5em;">
</div>
# Elementarsignale
Folgende Signale wurden bereits in `ient_signals` definiert:
``` python
gauss = lambda t: np.exp(-(t)**2)
unitstep = lambda t: np.where(t>=0, 1, 0)
rect = lambda t: unitstep(t+0.5) - unitstep(t-0.5)
tri = lambda t: rect(t/2)*(1-abs(t))
si = lambda t: np.sinc(t/np.pi) # English notation sinc(t) = sin(pi t)/(pi t)
```
%% Cell type:markdown id: tags:
## Signale
Jedes der oben definierten Elementarsignale wird im Folgenden geplottet.
### Gauß-Signal
$\displaystyle s(t) = \mathrm{e}^{\pi t^2}$
%% Cell type:code id: tags:
``` python
fig,ax = plt.subplots(1,1); ax.plot(t, gauss(t));
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s(t)=\mathrm{e}^{-\pi t^2}$', bbox=ient_wbbox)
ax.axis('equal'); ax.set_xlim([-2.75, 2.75]); ient_grid(ax); ient_axis(ax);
```
%% Cell type:markdown id: tags:
### Sprungfunktion
$\epsilon(t)=\begin{cases}
0\quad\text{für}\ t<0 \\
1\quad\text{für}\ t\geq 0 \text{ .}
\end{cases}$
%% Cell type:code id: tags:
``` python
fig,ax = plt.subplots(1,1); ax.plot(t, unitstep(t));
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s(t)=\epsilon(t)$', bbox=ient_wbbox)
ax.axis('equal'); ax.set_xlim([-2.25,2.25]); ient_grid(ax); ient_axis(ax);
```
%% Cell type:markdown id: tags:
### Rechteckimpuls
$\mathrm{rect}(t) = \begin{cases}
1\quad\text{für}\ |t| \leq 1/2\\
0\quad\text{für}\ |t| > 1/2\text{ .}
\end{cases}$
%% Cell type:code id: tags:
``` python
fig,ax = plt.subplots(1,1); ax.plot(t, rect(t));
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s(t)=\mathrm{rect}(t)$', bbox=ient_wbbox)
ax.axis('equal'); ax.set_xlim([-2.25,2.25]); ient_grid(ax); ient_axis(ax);
```
%% Cell type:markdown id: tags:
### Dreieckimpuls
$\Lambda(t) = \begin{cases}
1-|t|\quad\text{für}\ |t|\leq 1\\
0\quad\text{für}\ |t| > 1\text{ .}
\end{cases}$
%% Cell type:code id: tags:
``` python
fig,ax = plt.subplots(1,1); ax.plot(t, tri(t));
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s(t)=\Lambda(t)$', bbox=ient_wbbox)
ax.axis('equal'); ax.set_xlim([-2.25,2.25]); ient_grid(ax); ient_axis(ax);
```
%% Cell type:markdown id: tags:
### Si-Funktion
$\displaystyle \mathrm{si}(t) = \frac{\sin(t)}{t}$
%% Cell type:code id: tags:
``` python
fig,ax = plt.subplots(1,1); ax.plot(t, si(np.pi*t));
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s(t)=\mathrm{si}(\pi t)$', bbox=ient_wbbox)
ax.set_xlim([-5.5,5.5]); ient_grid(ax); ient_axis(ax);
```
%% Cell type:markdown id: tags:
## Zeitverschiebung, -dehnung und -spiegelung
%% Cell type:markdown id: tags:
Verschobener Rechteckimpuls $s(t) = \mathrm{rect}\left(t-\frac{1}{2}\right)$
%% Cell type:code id: tags:
``` python
s = lambda t: rect(t-1/2)
# Plot
fig,ax = plt.subplots(1,1); ax.plot(t, s(t));
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s(t)$', bbox=ient_wbbox)
ax.axis('equal'); ax.set_xlim([-2.25,2.25]); ient_grid(ax); ient_axis(ax);
```
%% Cell type:markdown id: tags:
Gedehnter Rechteckimpuls $s(t) = \mathrm{rect}\left(\frac{t}{2}\right)$
%% Cell type:code id: tags:
``` python
s = lambda t: rect(t/2)
# Plot
fig,ax = plt.subplots(1,1); ax.plot(t, s(t));
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s(t)$', bbox=ient_wbbox)
ax.axis('equal'); ax.set_xlim([-2.25,2.25]); ient_grid(ax); ient_axis(ax);
```
%% Cell type:markdown id: tags:
Zur Verdeutlichung der Zeitspiegelung wird $s(t) = t \cdot \mathrm{rect}\left(t-\frac{1}{2}\right)$ betrachtet:
%% Cell type:code id: tags:
``` python
s = lambda t: rect(t-0.5)*t
# Plot
fig,ax = plt.subplots(1,1); ax.plot(t, s(t));
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s(t)$', bbox=ient_wbbox)
ax.axis('equal'); ax.set_xlim([-2.25,2.25]); ient_grid(ax); ient_axis(ax);
```
%% Cell type:markdown id: tags:
Betrachte nun $s(-t)$:
%% Cell type:code id: tags:
``` python
# Plot
fig,ax = plt.subplots(1,1); ax.plot(t, s(-t));
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s(-t)$', bbox=ient_wbbox)
ax.axis('equal'); ax.set_xlim([-2.25,2.25]); ient_grid(ax); ient_axis(ax);
```
%% Cell type:markdown id: tags:
### Demo: Zeitverschiebung, -dehnung und -spiegelung
$\displaystyle s\left(\pm\frac{t-t_0}{T}\right)$
%% Cell type:code id: tags:
``` python
s = lambda t: rect(t-0.5)*t
# Plot & demo
fig, ax = plt.subplots(1, 1, figsize=(8, 4))
@widgets.interact(T=widgets.FloatSlider(min=0.25, max=4, value=1, step=.1, description=r'Dehnung T', style=ient_wdgtl_style),
t0=widgets.FloatSlider(min=-2, max=2, value=0, step=.1, description=r'Verschiebung $t_0$', style=ient_wdgtl_style),
reflection=widgets.Checkbox(value=False, description='Spiegelung', style=ient_wdgtl_style))
def update_signals(T, t0, reflection):
if reflection:
T = -T
s_plot = s((t-t0)/T)
if not ax.lines: # plot s(t) and g(t)
ax.plot(t, s_plot, 'rwth');
ax.set_xlabel(r'$\rightarrow t$'); ax.set_ylabel(r'$\uparrow s\left(\pm\frac{t-t_0}{T}\right)$')
ax.axis('equal'); ax.set_xlim([-4.75, 4.75]); ient_axis(ax); ient_grid(ax); ax.minorticks_on()
else: # update lines
ax.lines[0].set_ydata(s_plot);
```
%% 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:
*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.
......
%% Cell type:markdown id: tags:
<div>
<img src="ient_nb/figures/rwth_ient_logo@2x.png" style="float: right;height: 5em;">
</div>
# Übungsbeispiele zur Vorlesung Grundgebiete der Elektrotechnik 3 &ndash; Signale und Systeme
## Inhaltsverzeichnis
1. Determinierte Signale in linearen zeitinvarianten Systemen
* [Elementarsignale](GDET3%20Elementarsignale.ipynb) (Elementarsignale sowie Zeitverschiebung, Spiegelung, Dehnung)
* [Beispiel zur Berechnung des Faltungsintegrals](GDET3%20Faltungsbeispiel.ipynb)
* [Demonstrator Faltungsintegral](GDET3%20Faltung%20GUI.ipynb)
2. Laplace-Transformation
* [Demonstrator Laplace-Transformation](GDET3%20Laplace-Transformation.ipynb)
3. Fourier-Bechreibung von Signalen und Systemen
* [RL-Hochpass](GDET3%20RL-Hochpass.ipynb)
4. Diskrete Signale und Systeme
5. Systemtheorie der Tiefpass- und Bandpasssysteme
6. Korrelationsfunktionen determinierter Signale
7. Statistische Signalbeschreibung
* [Weißes Rauschen](GDET3%20Weißes%20Rauschen.ipynb)
* [Verteilungs- und Verteilungsdichtefunktion](GDET3%20Verteilungsfunktion.ipynb)
## Jupyter Quick Start
* Zum Ausführen einer einzelnen Cell auf <span class="fa-step-forward fa"></span>-Button klicken
* Zum Ausführen aller Cells eines Notebooks im Menü "Cell" -> "Run All"
* Zum Neustart (und erneutem Ausführen) <span class="fa-forward fa"></span>-Button klicken
## Mitwirkende
* Christian Rohlfing
* Emin Kosar
%% 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:
*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.
......
jupyter contrib nbextension install --user
jupyter nbextension enable hide_input/main
\ No newline at end of file
Markdown is supported
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