From ef6895554b1c2c5ee4b9582d9123d3300effb519 Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Thu, 8 Nov 2018 16:30:59 +0100 Subject: [PATCH] two eods and an am --- code/eod_sim.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/code/eod_sim.py b/code/eod_sim.py index e69de29..c719a69 100644 --- a/code/eod_sim.py +++ b/code/eod_sim.py @@ -0,0 +1,31 @@ +import numpy as np +import matplotlib.pyplot as plt + +freq = 800 +freq2 = 820 +dt = 0.00001 + +x = np.arange(0.0, 1.0, dt) +eod = np.sin(x * 2 * np.pi * freq) + np.sin(x * 2 * np.pi * freq * 2) * 0.5 +eod2 = np.sin(x * 2 * np.pi * freq2) + np.sin(x * 2 * np.pi * freq2 * 2) * 0.5 + +fig = plt.figure(figsize=(5., 7.5)) +ax = fig.add_subplot(311) +ax.plot(x, eod, color="darkgreen", linewidth=1.0) +ax.set_xlim(0.0, 0.1) +ax.set_ylabel('voltage [mV]') + +ax = fig.add_subplot(312) +ax.plot(x, eod2, color="crimson", linewidth=1.0) +ax.set_xlim(0.0, 0.1) +ax.set_ylabel('voltage [mV]') + +ax = fig.add_subplot(313) +ax.plot(x, eod + eod2 * 0.05, color="lightblue", linewidth=1.0) +ax.set_xlim(0.0, 0.1) +ax.set_xlabel('time [s]') +ax.set_ylabel('voltage [mV]') + +plt.tight_layout() +plt.savefig("eods.pdf") +# plt.show()