From 57cac49a0b3b0378245f02903d6bfdeaf58980da Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 20 Dec 2021 22:57:10 +0100 Subject: Add data and flowgraph for (broken) QAM on hardware --- doc/thesis/figures/data/qam_hw_lab.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 doc/thesis/figures/data/qam_hw_lab.py (limited to 'doc/thesis/figures/data/qam_hw_lab.py') diff --git a/doc/thesis/figures/data/qam_hw_lab.py b/doc/thesis/figures/data/qam_hw_lab.py new file mode 100644 index 0000000..d49cfd1 --- /dev/null +++ b/doc/thesis/figures/data/qam_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 = 20e3 +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] + +# 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 From 1de862c5e2ac6e2baa76daf9fbe6b64050da12fc Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 21 Dec 2021 00:32:06 +0100 Subject: Add more data for QAM, fix colormap --- doc/thesis/figures/data/qam_hw_lab.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'doc/thesis/figures/data/qam_hw_lab.py') diff --git a/doc/thesis/figures/data/qam_hw_lab.py b/doc/thesis/figures/data/qam_hw_lab.py index d49cfd1..fde109a 100644 --- a/doc/thesis/figures/data/qam_hw_lab.py +++ b/doc/thesis/figures/data/qam_hw_lab.py @@ -7,24 +7,28 @@ import numpy as np samples = utils.load_samples(__file__) # range of samples we want to show -start = 20e3 -end = start +400 +start = 25e3 +end = start +800 # select every second samples -select_samples = lambda arr: arr[int(start):int(end):6] +select_samples = lambda arr: arr[int(start):int(end):8] 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" + "locked_re", "locked_im", + "samplenr", ] # save to file -- cgit v1.2.1