aboutsummaryrefslogtreecommitdiffstats
path: root/src/tone-test-sim/analyse.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/tone-test-sim/analyse.py')
-rwxr-xr-xsrc/tone-test-sim/analyse.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tone-test-sim/analyse.py b/src/tone-test-sim/analyse.py
new file mode 100755
index 0000000..a67644c
--- /dev/null
+++ b/src/tone-test-sim/analyse.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+import numpy as np
+import matplotlib.pyplot as plt
+
+dat = np.loadtxt("tone.csv", dtype=np.int32, delimiter=",")
+# columns :"freq, threshold, num_samples, detector_output"
+
+fig, ax = plt.subplots()
+plt.scatter(dat[...,0], dat[...,1], c=dat[...,3].astype(np.float32))
+plt.show()
+
+if 0:
+ thresholds = [800, 2000, 4000, 8000]
+
+ fig, ax = plt.subplots()
+
+ for th in thresholds:
+ dat_th = dat[dat[...,1] == th]
+ dat_th[...,1]
+ ax.plot(dat_th[...,0], dat_th[...,3], label="{}".format(th))
+
+ legend = ax.legend(loc='upper left', shadow=True)
+ plt.show()