Simulate waveform#

Objects from thztools: timebase, wave

[1]:
import numpy as np
from matplotlib import pyplot as plt

import thztools as thz

Set the simulation parameters#

[2]:
n = 256  # Number of samples
dt = 0.05  # Sampling time [ps]

Simulate a waveform#

Use wave to generate a terahertz time-domain waveform mu with n = 256 samples and timebase to generate the timebase.

[3]:
t = thz.timebase(n, dt=dt)
mu = thz.wave(n, dt=dt)

Show the simulated waveform#

[4]:
_, ax = plt.subplots()

ax.plot(t, mu)

ax.set_xlabel("Time (ps)")
ax.set_ylabel(r"Amplitude (units of $\mu_{p})$")

ax.set_xticks(np.arange(0, 11, 5))
ax.set_xlim(0, 10)

plt.show()
../_images/examples_simulate-waveform_7_0.png