From cbf0d8ce166a78e6d05da7253b6272db6f8861eb Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sun, 19 Dec 2021 02:51:04 +0100 Subject: Add samples for QPSK with hardware --- doc/thesis/figures/data/qpsk_hw_lab.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 doc/thesis/figures/data/qpsk_hw_lab.py (limited to 'doc/thesis/figures/data/qpsk_hw_lab.py') diff --git a/doc/thesis/figures/data/qpsk_hw_lab.py b/doc/thesis/figures/data/qpsk_hw_lab.py new file mode 100644 index 0000000..a8170c6 --- /dev/null +++ b/doc/thesis/figures/data/qpsk_hw_lab.py @@ -0,0 +1,31 @@ +#!/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 = 1e3 +end = start +50 + +# select every second samples +select_samples = lambda arr: arr[int(start):int(end):2] +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] + +# 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" +] + +# save to file +utils.save_to_file(__file__, data, headers) -- cgit v1.2.1