In [1]:
import matplotlib
import matplotlib.pyplot as plt
import numpy as np

import warnings
# Ignore all warnings
warnings.simplefilter('ignore')

Ähnlichkeitssatz¶

In [11]:
t = np.linspace(-2,8,1001)
# wir benutzen als Beispiel eine einfache Sinusfunktion

def rectangle(t,a):
    return np.heaviside(a*t,1) - np.heaviside(a*t-2,1) 

fig, axs = plt.subplots(2,2,figsize=(14,6), sharex=True, sharey=True)
cax = axs[0][0]
a = 1
cax.plot(t,rectangle(t,a))
cax.set_title('Rechteckimpuls')
cax.grid()
cax.set_ylabel('$f(t)$')

cax = axs[0][1]
a = 1/3
cax.plot(t,rectangle(t,a))
cax.set_title('Rechteckimpuls mit a=1/3 (Dehnung)')
cax.grid()

cax = axs[1][0]
a = 3
cax.plot(t,rectangle(t,a))
cax.set_title('Rechteckimpuls mit a=3 (Stauchung)')
cax.grid()
cax.set_ylabel('$f(t)$')
cax.set_xlabel('$t$')

cax = axs[1][1]
a = -1
cax.plot(t,rectangle(t,a))
cax.set_title('Rechteckimpuls mit a=-1 (Spiegelung)')
cax.grid()
cax.set_xlabel('$t$')

plt.show()
No description has been provided for this image
In [21]:
# frequenzbereich
w = np.linspace(-10,10,202)
# FT: originale funktion
ft_orig = 1j*(np.exp(-1j*2*w) - 1)/w
# FT: funktion mit a = 1/3
ft_aehn = 1j*(np.exp(-1j*6*w) - 1)/w

fig, axs = plt.subplots(1,2,figsize=(12,4))
cax = axs[0]
a = 1
cax.plot(t,rectangle(t,a), color='darkorange', label='original')
a = 1/3
cax.plot(t,rectangle(t,a), color='limegreen', label='transformiert', linestyle='--')
cax.grid()
cax.set_ylabel('$f(t)$')
cax.set_xlabel('$t$')
cax.legend()

cax = axs[1]
cax.plot(w, np.abs(ft_orig), color='darkorange', label='original')
cax.plot(w, np.abs(ft_aehn), color='limegreen', label='transformiert', linestyle='--')
cax.grid()
cax.set_ylabel('$|F(\omega)|$')
cax.set_xlabel('$\omega$')
cax.legend()
plt.show()
No description has been provided for this image

Zeitverschiebung¶

In [47]:
# Zeitbereich
t = np.linspace(-3,4,1001)
def timeshift(a,t):
    return np.exp(-(t-a)**2)

# Frequenzbereich
w = np.linspace(-5,5,1001)
def freqshift(a,w):
    return np.exp(-1j*a*w)*np.sqrt(np.pi)*np.exp(-0.25*w**2)

fig,axs = plt.subplots(2,3, figsize=(14,6), sharey='row')
cax = axs[0][0]
a = 0
cax.plot(t,timeshift(a,t))
cax.grid()
cax.set_ylabel('$f(t)$')
cax.set_xlabel('$t$')
cax = axs[1][0]
ft = freqshift(a,w)
cax.plot(w, np.real(ft), label='real-part')
cax.plot(w, np.imag(ft), label='imag-part')
cax.plot(w, np.abs(ft), label='betrag', linestyle='--')
cax.grid()
cax.set_ylabel('$F(\omega)$')
cax.set_xlabel('$\omega$')
cax.legend()

cax = axs[0][1]
a = 1.5  # Verschiebung nach rechts
cax.plot(t,timeshift(a,t))
cax.grid()
cax.set_xlabel('$t$')
cax = axs[1][1]
ft = freqshift(a,w)
cax.plot(w, np.real(ft), label='real-part')
cax.plot(w, np.imag(ft), label='imag-part')
cax.plot(w, np.abs(ft), label='betrag', linestyle='--')
cax.grid()
cax.set_xlabel('$\omega$')
cax.legend()

cax = axs[0][2]
a = -0.5  # Verschiebung nach links
cax.plot(t,timeshift(a,t))
cax.grid()
cax.set_xlabel('$t$')
cax = axs[1][2]
ft = freqshift(a,w)
cax.plot(w, np.real(ft), label='real-part')
cax.plot(w, np.imag(ft), label='imag-part')
cax.plot(w, np.abs(ft), label='betrag', linestyle='--')
cax.grid()
cax.set_xlabel('$\omega$')
cax.legend()
plt.show()
No description has been provided for this image
In [ ]: