aboutsummaryrefslogtreecommitdiffstats
path: root/doc/thesis/figures/data
diff options
context:
space:
mode:
authorsara <sara.halter@gmx.ch>2021-12-22 16:35:02 +0100
committersara <sara.halter@gmx.ch>2021-12-22 16:35:02 +0100
commit02ab2bede3ac749fc5ce36315ef4d79200ea37dd (patch)
tree87665f140ab9300dfa8d7847bfdb59cbd61a63d3 /doc/thesis/figures/data
parentDoku mesuremnet (diff)
downloadFading-02ab2bede3ac749fc5ce36315ef4d79200ea37dd.tar.gz
Fading-02ab2bede3ac749fc5ce36315ef4d79200ea37dd.zip
Plot Hardware
Diffstat (limited to '')
-rw-r--r--doc/thesis/figures/data/qpsk_hw_outdoors_1.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/thesis/figures/data/qpsk_hw_outdoors_1.py b/doc/thesis/figures/data/qpsk_hw_outdoors_1.py
new file mode 100644
index 0000000..f6f816b
--- /dev/null
+++ b/doc/thesis/figures/data/qpsk_hw_outdoors_1.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+
+import utils
+import numpy as np
+
+# get array of samples [channel, synchronized, equalized, locked]
+samples = utils.load_samples(__file__)
+
+# range of samples we want to show
+start = 250e3
+end = start +400
+
+# select every second samples
+select_samples = lambda arr: arr[int(start):int(end):6]
+values = map(select_samples, samples)
+
+# split into imaginary and real parts
+get_parts = lambda v: (np.real(v), np.imag(v))
+parts = [p for v in map(get_parts, values) for p in v]
+
+# add 'samplenr' metadata
+parts += [np.arange(0, len(parts[0]))]
+
+# zip data and add header
+data = np.array(list(zip(*parts)))
+headers = [
+ "channel_re", "channel_im",
+ "synchronized_re", "synchronized_im",
+ "equalized_re", "equalized_im",
+ "locked_re", "locked_im",
+ "samplenr",
+]
+
+# save to file
+utils.save_to_file(__file__, data, headers)