aboutsummaryrefslogtreecommitdiffstats
path: root/doc/thesis/figures/data/qpsk_sim_constellations_static_symb.py
diff options
context:
space:
mode:
authorsara <sara.halter@gmx.ch>2021-12-16 16:43:31 +0100
committersara <sara.halter@gmx.ch>2021-12-16 16:43:31 +0100
commit2c0214f3e8d7ff15cacb2acd5f9c04308d5c86ec (patch)
tree64f3404258bf42d826c74c1debad0c5bd7693e84 /doc/thesis/figures/data/qpsk_sim_constellations_static_symb.py
parentCorrect parameters for every flowgraph (diff)
downloadFading-2c0214f3e8d7ff15cacb2acd5f9c04308d5c86ec.tar.gz
Fading-2c0214f3e8d7ff15cacb2acd5f9c04308d5c86ec.zip
Doku bilder
Diffstat (limited to '')
-rw-r--r--doc/thesis/figures/data/qpsk_sim_constellations_static_symb.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/thesis/figures/data/qpsk_sim_constellations_static_symb.py b/doc/thesis/figures/data/qpsk_sim_constellations_static_symb.py
new file mode 100644
index 0000000..416a017
--- /dev/null
+++ b/doc/thesis/figures/data/qpsk_sim_constellations_static_symb.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+import os
+import numpy as np
+
+DATA_DIR = "./figures/data/flowgraphs"
+SPS = 4
+
+channel = np.fromfile(f"{DATA_DIR}/qpsk_channel_static_symb.dat", dtype=np.complex64)[::SPS]
+sync = np.fromfile(f"{DATA_DIR}/qpsk_sync_static_symb.dat", dtype=np.complex64)
+equalized = np.fromfile(f"{DATA_DIR}/qpsk_equalized_static_symb.dat", dtype=np.complex64)
+locked = np.fromfile(f"{DATA_DIR}/qpsk_locked_static_symb.dat", dtype=np.complex64)
+
+samples = [channel, sync, equalized, locked]
+
+# print(list(map(len, samples)))
+
+start = 1e3
+end = start + 200
+
+get_range = lambda arr: arr[int(start):int(end)]
+get_parts = lambda v: (np.real(v), np.imag(v))
+
+values = map(get_range, samples)
+parts = [p for v in map(get_parts, values) for p in v]
+data = np.array(list(zip(*parts)))
+
+# save to file
+location = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
+name, _ = os.path.splitext(os.path.basename(__file__))
+filename = os.path.join(location, name + ".dat")
+np.savetxt(filename, data, fmt='%.6e')