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 --- .gitignore | 1 + doc/thesis/Fading.tex | 2 +- doc/thesis/Makefile | 14 +++- doc/thesis/chapters/implementation.tex | 20 ++--- ...am_sim_dynamic_grblock_los_etsi_doppler5_k5.dat | Bin 0 -> 4539896 bytes ...m_sim_dynamic_grblock_los_etsi_doppler70_k5.dat | Bin 0 -> 3447912 bytes ..._qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat | Bin 0 -> 3857296 bytes ...qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat | Bin 0 -> 5823256 bytes ...am_sim_dynamic_grblock_los_etsi_doppler5_k5.dat | Bin 0 -> 1134648 bytes ...m_sim_dynamic_grblock_los_etsi_doppler70_k5.dat | Bin 0 -> 861648 bytes ..._qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat | Bin 0 -> 964000 bytes ...qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat | Bin 0 -> 1455488 bytes ...am_sim_dynamic_grblock_los_etsi_doppler5_k5.dat | Bin 0 -> 1134360 bytes ...m_sim_dynamic_grblock_los_etsi_doppler70_k5.dat | Bin 0 -> 861480 bytes ..._qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat | Bin 0 -> 963720 bytes ...qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat | Bin 0 -> 1455480 bytes ...am_sim_dynamic_grblock_los_etsi_doppler5_k5.dat | Bin 0 -> 1134648 bytes ...m_sim_dynamic_grblock_los_etsi_doppler70_k5.dat | Bin 0 -> 861648 bytes ..._qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat | Bin 0 -> 964000 bytes ...qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat | Bin 0 -> 1455488 bytes doc/thesis/figures/data/qam_hw_lab.py | 12 ++- ...qam_sim_dynamic_grblock_los_etsi_doppler5_k5.py | 35 +++++++++ ...am_sim_dynamic_grblock_los_etsi_doppler70_k5.py | 35 +++++++++ .../qam_sim_dynamic_grblock_nlos_etsi_doppler5.py | 35 +++++++++ .../qam_sim_dynamic_grblock_nlos_etsi_doppler70.py | 31 ++++++++ doc/thesis/figures/data/qpsk_hw_lab.py | 6 +- ...psk_sim_dynamic_grblock_los_etsi_doppler5_k5.py | 6 +- ...sk_sim_dynamic_grblock_los_etsi_doppler70_k5.py | 6 +- .../qpsk_sim_dynamic_grblock_nlos_etsi_doppler5.py | 6 +- ...qpsk_sim_dynamic_grblock_nlos_etsi_doppler70.py | 6 +- doc/thesis/figures/tikz/hardware.tex | 84 ++++++++++++++++++++ .../figures/tikz/qam-simulations-dynamic.tex | 85 +++++++++++++++++++++ doc/thesis/figures/tikz/qpsk-hardware.tex | 83 -------------------- .../figures/tikz/qpsk-simulations-dynamic.tex | 3 +- flowgraphs/qam_sim.grc | 10 +-- flowgraphs/qam_sim.py | 5 +- 36 files changed, 370 insertions(+), 115 deletions(-) create mode 100644 doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat create mode 100644 doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat create mode 100644 doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat create mode 100644 doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat create mode 100644 doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat create mode 100644 doc/thesis/figures/data/qam_sim_dynamic_grblock_los_etsi_doppler5_k5.py create mode 100644 doc/thesis/figures/data/qam_sim_dynamic_grblock_los_etsi_doppler70_k5.py create mode 100644 doc/thesis/figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler5.py create mode 100644 doc/thesis/figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler70.py create mode 100644 doc/thesis/figures/tikz/hardware.tex create mode 100644 doc/thesis/figures/tikz/qam-simulations-dynamic.tex delete mode 100644 doc/thesis/figures/tikz/qpsk-hardware.tex diff --git a/.gitignore b/.gitignore index 5c1c951..54b90f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ doc/thesis/Fading.pdf +doc/thesis/figures/externalized doc/projectplan/ProjectPlan.pdf *.figlist diff --git a/doc/thesis/Fading.tex b/doc/thesis/Fading.tex index f78c8db..3a9eaca 100644 --- a/doc/thesis/Fading.tex +++ b/doc/thesis/Fading.tex @@ -53,7 +53,7 @@ arrows, patterns, } -\tikzexternalize[mode=graphics if exists]{Fading} +\tikzexternalize[prefix=figures/externalized/]{Fading} \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} diff --git a/doc/thesis/Makefile b/doc/thesis/Makefile index a44ecc6..8e0d1da 100644 --- a/doc/thesis/Makefile +++ b/doc/thesis/Makefile @@ -1,5 +1,5 @@ TEX := xelatex -TEXARGS := -halt-on-error -interaction=nonstopmode -shell-escape=1 +TEXARGS := --halt-on-error --interaction=nonstopmode --shell-escape=1 --enable-write18 SOURCES := \ Fading.tex \ @@ -28,7 +28,8 @@ SOURCES := \ figures/tikz/packet-frame.tex \ figures/tikz/qpsk-simulations-static.tex \ figures/tikz/qpsk-simulations-dynamic.tex \ - figures/tikz/qpsk-hardware.tex + figures/tikz/qam-simulations-dynamic.tex \ + figures/tikz/hardware.tex DATA := \ figures/data/multipath_frequency_response.dat \ @@ -47,7 +48,12 @@ DATA := \ figures/data/qpsk_sim_dynamic_grblock_los_etsi_doppler5_k5.dat \ figures/data/qpsk_sim_dynamic_grblock_los_etsi_doppler70_k5.dat \ figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler5.dat \ - figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler70.dat + figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler70.dat \ + \ + figures/data/qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat \ + figures/data/qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat \ + figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat \ + figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat # Get the main file from the file @@ -66,6 +72,7 @@ all: $(PDF) /usr/bin/env python3 $< %.pdf: %.tex $(SOURCES) $(DATA) + mkdir -p figures/externalized $(TEX) $(TEXARGS) $< # bibliography biber $(basename $(MAIN)) @@ -79,6 +86,7 @@ clean: @rm -vf tex/*.aux @rm -vf chapters/*.aux @rm -vf figures/tikz/*.aux + @rm -vfrd figures/externalized cleanall: clean @rm -vf $(PDF) diff --git a/doc/thesis/chapters/implementation.tex b/doc/thesis/chapters/implementation.tex index a4419dd..c22f6d3 100644 --- a/doc/thesis/chapters/implementation.tex +++ b/doc/thesis/chapters/implementation.tex @@ -447,26 +447,26 @@ Without those only the amplitudes could be seen in the Plots, with all the noise \newpage \begin{figure} \centering - \label{fig:qpsk-simulations-dynamic} \input{figures/tikz/qpsk-simulations-dynamic} \caption{ Simulations with a dynamic fading channel model using PDP values of the Extended Typical Urban model (ETU) of the ETSI standard normative Annex B.2 in \cite{ETSI}. The color gradient represents progression in time. + \label{fig:qpsk-simulations-dynamic} } \end{figure} \newpage \begin{figure} \centering - \input{figures/tikz/qpsk-hardware} + \input{figures/tikz/qam-simulations-dynamic} + \caption{ + TODO QAM simulation + } +\end{figure} +\begin{figure} + \centering + \input{figures/tikz/hardware} \caption{ TODO QPSK hardware } \end{figure} -% \newpage -% \begin{figure} -% \centering -% \input{figures/tikz/qam-simulations-static} -% \caption{ -% TODO QPSK hardware -% } -% \end{figure} +\newpage \restoregeometry diff --git a/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat b/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat new file mode 100644 index 0000000..49070d5 Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat b/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat new file mode 100644 index 0000000..13a6201 Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat b/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat new file mode 100644 index 0000000..207213c Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat b/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat new file mode 100644 index 0000000..3a01a87 Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/channel_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat b/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat new file mode 100644 index 0000000..c235697 Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat b/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat new file mode 100644 index 0000000..59d13f2 Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat b/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat new file mode 100644 index 0000000..db59982 Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat b/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat new file mode 100644 index 0000000..2f0b72c Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/equalized_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat b/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat new file mode 100644 index 0000000..ecd61c9 Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat b/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat new file mode 100644 index 0000000..7dc562e Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat b/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat new file mode 100644 index 0000000..3a48c8a Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat b/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat new file mode 100644 index 0000000..e6ead95 Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/locked_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat b/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat new file mode 100644 index 0000000..32ed9d0 Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat b/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat new file mode 100644 index 0000000..f642f4f Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat b/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat new file mode 100644 index 0000000..a1418dd Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat differ diff --git a/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat b/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat new file mode 100644 index 0000000..842c36a Binary files /dev/null and b/doc/thesis/figures/data/flowgraphs/synchronized_qam_sim_dynamic_grblock_nlos_etsi_doppler70.dat differ 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 diff --git a/doc/thesis/figures/data/qam_sim_dynamic_grblock_los_etsi_doppler5_k5.py b/doc/thesis/figures/data/qam_sim_dynamic_grblock_los_etsi_doppler5_k5.py new file mode 100644 index 0000000..a644402 --- /dev/null +++ b/doc/thesis/figures/data/qam_sim_dynamic_grblock_los_etsi_doppler5_k5.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 = 10e3 +end = start +40000 + +# select every second samples +select_samples = lambda arr: arr[int(start):int(end):200] +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.concatenate([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) diff --git a/doc/thesis/figures/data/qam_sim_dynamic_grblock_los_etsi_doppler70_k5.py b/doc/thesis/figures/data/qam_sim_dynamic_grblock_los_etsi_doppler70_k5.py new file mode 100644 index 0000000..8f35d50 --- /dev/null +++ b/doc/thesis/figures/data/qam_sim_dynamic_grblock_los_etsi_doppler70_k5.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 = 25e3 +end = start +1e3 + +# select every second samples +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", + "samplenr" +] + +# save to file +utils.save_to_file(__file__, data, headers) diff --git a/doc/thesis/figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler5.py b/doc/thesis/figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler5.py new file mode 100644 index 0000000..e434809 --- /dev/null +++ b/doc/thesis/figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler5.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 = 20e3 +end = start +10000 + +# select every second samples +select_samples = lambda arr: arr[int(start):int(end):100] +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) diff --git a/doc/thesis/figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler70.py b/doc/thesis/figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler70.py new file mode 100644 index 0000000..5b93750 --- /dev/null +++ b/doc/thesis/figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler70.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 +800 + +# select every second samples +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] + +# 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) diff --git a/doc/thesis/figures/data/qpsk_hw_lab.py b/doc/thesis/figures/data/qpsk_hw_lab.py index 741f32f..f6f816b 100644 --- a/doc/thesis/figures/data/qpsk_hw_lab.py +++ b/doc/thesis/figures/data/qpsk_hw_lab.py @@ -18,13 +18,17 @@ values = map(select_samples, samples) 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 diff --git a/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_los_etsi_doppler5_k5.py b/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_los_etsi_doppler5_k5.py index f621fd0..819800f 100644 --- a/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_los_etsi_doppler5_k5.py +++ b/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_los_etsi_doppler5_k5.py @@ -18,13 +18,17 @@ values = map(select_samples, samples) 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 diff --git a/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_los_etsi_doppler70_k5.py b/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_los_etsi_doppler70_k5.py index c82fbd1..d2147df 100644 --- a/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_los_etsi_doppler70_k5.py +++ b/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_los_etsi_doppler70_k5.py @@ -18,13 +18,17 @@ values = map(select_samples, samples) 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 diff --git a/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler5.py b/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler5.py index c82fbd1..15e8fd0 100644 --- a/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler5.py +++ b/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler5.py @@ -18,13 +18,17 @@ values = map(select_samples, samples) 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 diff --git a/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler70.py b/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler70.py index eae2afc..5194407 100644 --- a/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler70.py +++ b/doc/thesis/figures/data/qpsk_sim_dynamic_grblock_nlos_etsi_doppler70.py @@ -18,13 +18,17 @@ values = map(select_samples, samples) 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 diff --git a/doc/thesis/figures/tikz/hardware.tex b/doc/thesis/figures/tikz/hardware.tex new file mode 100644 index 0000000..d13926b --- /dev/null +++ b/doc/thesis/figures/tikz/hardware.tex @@ -0,0 +1,84 @@ +% vim: set ts=2 sw=2 noet: + +\newcommand{\makeplot}[5]{% + \hfill + \begin{tikzpicture} + \begin{axis}[ + width = {\linewidth / 3.3}, + height = {\linewidth / 3.3}, + grid = major, + xmin = {-#4}, xmax = {#4}, + ymin = {-#4}, ymax = {#4}, + colormap name=viridis, + #5 + ] + + \addplot[only marks, scatter, point meta = \thisrow{samplenr}] + table [x index = #2, y index = #3] {#1}; + \end{axis} + \end{tikzpicture} + \hfill +} + +% ------------------------------------------------------------------- + +\noindent +\makeplot{figures/data/qpsk_hw_lab.dat}{0}{1}{.25}{ + ylabel = {Channel with ISI}, + yticklabel style = { + text width = 3em, + align = right, + }, + title = {QPSK LOS, Indoors (Lab)}, +} +% +\makeplot{figures/data/qpsk_hw_lab.dat}{0}{1}{.25}{ + title = {TODO}, +} +% +\makeplot{figures/data/qam_hw_lab.dat}{0}{1}{2}{ + title = {QAM LOS, Indoors (Lab)}, +} +\newline + +% ------------------------------------------------------------------- + +\noindent +\makeplot{figures/data/qpsk_hw_lab.dat}{2}{3}{.25}{% + ylabel = {Synchronized}, + yticklabel style = { + text width = 3em, + align = right, + }, +} +\makeplot{figures/data/qpsk_hw_lab.dat}{2}{3}{.25}{} +\makeplot{figures/data/qam_hw_lab.dat}{2}{3}{2}{} +\newline + +% ------------------------------------------------------------------- + +\noindent +\makeplot{figures/data/qpsk_hw_lab.dat}{4}{5}{2}{% + ylabel = {Equalized}, + yticklabel style = { + text width = 3em, + align = right, + }, +} +\makeplot{figures/data/qpsk_hw_lab.dat}{4}{5}{2}{} +\makeplot{figures/data/qam_hw_lab.dat}{4}{5}{2}{} +\newline + +% ------------------------------------------------------------------- + +\noindent +\makeplot{figures/data/qpsk_hw_lab.dat}{6}{7}{2}{% + ylabel = {Locked}, + yticklabel style = { + text width = 3em, + align = right, + }, +} +\makeplot{figures/data/qpsk_hw_lab.dat}{6}{7}{2}{} +\makeplot{figures/data/qam_hw_lab.dat}{6}{7}{2}{} +\newline diff --git a/doc/thesis/figures/tikz/qam-simulations-dynamic.tex b/doc/thesis/figures/tikz/qam-simulations-dynamic.tex new file mode 100644 index 0000000..88bea4a --- /dev/null +++ b/doc/thesis/figures/tikz/qam-simulations-dynamic.tex @@ -0,0 +1,85 @@ +% vim: set ts=2 sw=2 noet: + +\newcommand{\makeplot}[5]{% + \hfill + \tikzset{external/force remake} + \begin{tikzpicture} + \begin{axis}[ + width = {\linewidth / 3.3}, + height = {\linewidth / 3.3}, + grid = major, + xmin = {-#4}, xmax = {#4}, + ymin = {-#4}, ymax = {#4}, + colormap name=viridis, + #5 + ] + + \addplot[only marks, scatter, point meta = \thisrow{samplenr}] + table [x index = #2, y index = #3] {#1}; + \end{axis} + \end{tikzpicture} + \hfill +} + +% ------------------------------------------------------------------- + +\noindent +\makeplot{figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat}{0}{1}{4}{ + ylabel = {Channel with ISI}, + yticklabel style = { + text width = 3em, + align = right, + }, + title = {NLOS, \(\Delta f = \SI{5}{\hertz}\)}, +} +% +\makeplot{figures/data/qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat}{0}{1}{4}{ + title = {LOS, \(\Delta f = \SI{5}{\hertz}, K = 5\)}, +} +% +\makeplot{figures/data/qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat}{0}{1}{4}{ + title = {LOS, \(\Delta f = \SI{70}{\hertz}, K = 5\)}, +} +\newline + +% ------------------------------------------------------------------- + +\noindent +\makeplot{figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat}{2}{3}{4}{% + ylabel = {Synchronized}, + yticklabel style = { + text width = 3em, + align = right, + }, +} +\makeplot{figures/data/qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat}{2}{3}{4}{} +\makeplot{figures/data/qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat}{2}{3}{4}{} +\newline + +% ------------------------------------------------------------------- + +\noindent +\makeplot{figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat}{4}{5}{2}{% + ylabel = {Equalized}, + yticklabel style = { + text width = 3em, + align = right, + }, +} +\makeplot{figures/data/qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat}{4}{5}{2}{} +\makeplot{figures/data/qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat}{4}{5}{2}{} +\newline + +% ------------------------------------------------------------------- + +\noindent +\makeplot{figures/data/qam_sim_dynamic_grblock_nlos_etsi_doppler5.dat}{6}{7}{2}{% + ylabel = {Locked}, + yticklabel style = { + text width = 3em, + align = right, + }, +} +\makeplot{figures/data/qam_sim_dynamic_grblock_los_etsi_doppler5_k5.dat}{6}{7}{2}{} +\makeplot{figures/data/qam_sim_dynamic_grblock_los_etsi_doppler70_k5.dat}{6}{7}{2}{} +\newline diff --git a/doc/thesis/figures/tikz/qpsk-hardware.tex b/doc/thesis/figures/tikz/qpsk-hardware.tex deleted file mode 100644 index 68a31a6..0000000 --- a/doc/thesis/figures/tikz/qpsk-hardware.tex +++ /dev/null @@ -1,83 +0,0 @@ -% vim: set ts=2 sw=2 noet: - -\newcommand{\makeplot}[5]{% - \hfill - \begin{tikzpicture} - \begin{axis}[ - width = {\linewidth / 3.3}, - height = {\linewidth / 3.3}, - grid = major, - xmin = {-#4}, xmax = {#4}, - ymin = {-#4}, ymax = {#4}, - colormap name=viridis, - #5 - ] - - \addplot[only marks, scatter] table [x index = #2, y index = #3] {#1}; - \end{axis} - \end{tikzpicture} - \hfill -} - -% ------------------------------------------------------------------- - -\noindent -\makeplot{figures/data/qpsk_hw_lab.dat}{0}{1}{.25}{ - ylabel = {Channel with ISI}, - yticklabel style = { - text width = 3em, - align = right, - }, - title = {LOS, Indoors (Lab)}, -} -% -\makeplot{figures/data/qpsk_hw_lab.dat}{0}{1}{.25}{ - title = {LOS, Indoors (Lab)}, -} -% -\makeplot{figures/data/qpsk_hw_lab.dat}{0}{1}{.25}{ - title = {LOS, Indoors (Lab)}, -} -\newline - -% ------------------------------------------------------------------- - -\noindent -\makeplot{figures/data/qpsk_hw_lab.dat}{2}{3}{.25}{% - ylabel = {Synchronized}, - yticklabel style = { - text width = 3em, - align = right, - }, -} -\makeplot{figures/data/qpsk_hw_lab.dat}{2}{3}{.25}{} -\makeplot{figures/data/qpsk_hw_lab.dat}{2}{3}{.25}{} -\newline - -% ------------------------------------------------------------------- - -\noindent -\makeplot{figures/data/qpsk_hw_lab.dat}{4}{5}{2}{% - ylabel = {Equalized}, - yticklabel style = { - text width = 3em, - align = right, - }, -} -\makeplot{figures/data/qpsk_hw_lab.dat}{4}{5}{2}{} -\makeplot{figures/data/qpsk_hw_lab.dat}{4}{5}{2}{} -\newline - -% ------------------------------------------------------------------- - -\noindent -\makeplot{figures/data/qpsk_hw_lab.dat}{6}{7}{2}{% - ylabel = {Locked}, - yticklabel style = { - text width = 3em, - align = right, - }, -} -\makeplot{figures/data/qpsk_hw_lab.dat}{6}{7}{2}{} -\makeplot{figures/data/qpsk_hw_lab.dat}{6}{7}{2}{} -\newline diff --git a/doc/thesis/figures/tikz/qpsk-simulations-dynamic.tex b/doc/thesis/figures/tikz/qpsk-simulations-dynamic.tex index 4d01c92..0764c2a 100644 --- a/doc/thesis/figures/tikz/qpsk-simulations-dynamic.tex +++ b/doc/thesis/figures/tikz/qpsk-simulations-dynamic.tex @@ -13,7 +13,8 @@ #5 ] - \addplot[only marks, scatter] table [x index = #2, y index = #3] {#1}; + \addplot[only marks, scatter, point meta = \thisrow{samplenr}] + table [x index = #2, y index = #3] {#1}; \end{axis} \end{tikzpicture} \hfill diff --git a/flowgraphs/qam_sim.grc b/flowgraphs/qam_sim.grc index f5724be..6ef347a 100644 --- a/flowgraphs/qam_sim.grc +++ b/flowgraphs/qam_sim.grc @@ -536,18 +536,18 @@ blocks: - name: channels_selective_fading_model_0 id: channels_selective_fading_model parameters: - K: '4.0' + K: '5' LOS: 'False' N: '8' affinity: '' alias: '' comment: '' - delays: (0,1.8) - fDTs: ((2*carrier_freq)/(3*10e8))/samp_rate - mags: (1,0.12) + delays: (0,0.05e-6/samp_rate,0.12e-6/samp_rate,0.2e-6/samp_rate,0.23e-6/samp_rate,0.5e-6/samp_rate,1.6e-6/samp_rate,2.3e-6/samp_rate,5e-6/samp_rate) + fDTs: 70/samp_rate + mags: (0.7943282347242815,0.7943282347242815,0.7943282347242815,1,1,1,0.5011872336272722,0.31622776601683794,0.19952623149688797) maxoutbuf: '0' minoutbuf: '0' - ntaps: '8' + ntaps: '9' seed: '21' states: bus_sink: false diff --git a/flowgraphs/qam_sim.py b/flowgraphs/qam_sim.py index d3b6580..3a218f3 100755 --- a/flowgraphs/qam_sim.py +++ b/flowgraphs/qam_sim.py @@ -195,7 +195,7 @@ class qam_sim(gr.top_block, Qt.QWidget): verbose=False, log=False) self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(qam_const) - self.channels_selective_fading_model_0 = channels.selective_fading_model( 8, ((2*carrier_freq)/(3*10e8))/samp_rate, False, 4.0, 21, (0,1.8), (1,0.12), 8 ) + self.channels_selective_fading_model_0 = channels.selective_fading_model( 8, 70/samp_rate, False, 5, 21, (0,0.05e-6/samp_rate,0.12e-6/samp_rate,0.2e-6/samp_rate,0.23e-6/samp_rate,0.5e-6/samp_rate,1.6e-6/samp_rate,2.3e-6/samp_rate,5e-6/samp_rate), (0.7943282347242815,0.7943282347242815,0.7943282347242815,1,1,1,0.5011872336272722,0.31622776601683794,0.19952623149688797), 9 ) self.channels_channel_model_0 = channels.channel_model( noise_voltage=100e-3, frequency_offset=1e-3, @@ -298,7 +298,7 @@ class qam_sim(gr.top_block, Qt.QWidget): def set_samp_rate(self, samp_rate): self.samp_rate = samp_rate self.blocks_throttle_0.set_sample_rate(self.samp_rate) - self.channels_selective_fading_model_0.set_fDTs(((2*self.carrier_freq)/(3*10e8))/self.samp_rate) + self.channels_selective_fading_model_0.set_fDTs(70/self.samp_rate) self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate / self.sps) def get_rrc_taps(self): @@ -325,7 +325,6 @@ class qam_sim(gr.top_block, Qt.QWidget): def set_carrier_freq(self, carrier_freq): self.carrier_freq = carrier_freq - self.channels_selective_fading_model_0.set_fDTs(((2*self.carrier_freq)/(3*10e8))/self.samp_rate) def get_access_code(self): return self.access_code -- cgit v1.2.1