From 02ab2bede3ac749fc5ce36315ef4d79200ea37dd Mon Sep 17 00:00:00 2001 From: sara Date: Wed, 22 Dec 2021 16:35:02 +0100 Subject: Plot Hardware --- doc/thesis/Makefile | 1 + doc/thesis/chapters/implementation.tex | 10 +++----- doc/thesis/figures/data/qpsk_hw_outdoors_1.py | 35 +++++++++++++++++++++++++++ doc/thesis/figures/tikz/hardware.tex | 11 +++++---- 4 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 doc/thesis/figures/data/qpsk_hw_outdoors_1.py diff --git a/doc/thesis/Makefile b/doc/thesis/Makefile index 8e0d1da..53dcb01 100644 --- a/doc/thesis/Makefile +++ b/doc/thesis/Makefile @@ -36,6 +36,7 @@ DATA := \ figures/data/rice_pdf.dat \ \ figures/data/qpsk_hw_lab.dat \ + figures/data/qpsk_hw_outdoors_1.dat \ figures/data/qam_hw_lab.dat \ \ figures/data/qpsk_sim_nochannel.dat \ diff --git a/doc/thesis/chapters/implementation.tex b/doc/thesis/chapters/implementation.tex index b95b8bc..50485b9 100644 --- a/doc/thesis/chapters/implementation.tex +++ b/doc/thesis/chapters/implementation.tex @@ -391,11 +391,9 @@ For example one in an indoor environment, the Lab. An other in an outdoor enviro The result of those measurements are illustrated in \figref{fig:hardware-mesurement}. Because of the current set up the distance between the two SDRs were only about \si{2}-\SI{3}{\meter}. The signal were sent with a gain value of 0.4. The phase change and amplitude changes could be seen well. Specially when the transmitter or the receiver were moved, the change of them get faster. -The BER which will be described in detail in the next section was on average 2.37 for the outdoor environment and for the indoor about 2.67. It makes sense that the fading effect occurs more in an indoor environment, because there were more possibility for reflections at this distance as in the outdoor environment. +The BER, which will be described in detail in the next section, was on average 2.37 for the outdoor environment and for the indoor about 2.67. It makes sense that the fading effect occurs more in an indoor environment, because there were more possibility for reflections at this distance as in the outdoor environment. -%TODO.Describe Mesurement - \subsection{Empirical BER} \label{sec:ber} To find out how accurate the simulations are compared with a simulation of the fading effect and measurements, the bit error rate of the system is calculated. This is done with the help of a user specified \(k\)-byte test frame in the beginning of each vector. As seen in listing \ref{lst:ber-work}. Every bit is compared with the test vector at the beginning before the modulation and demodulation part. @@ -465,11 +463,11 @@ Unfortunately the two SDR need an external clock generator. For that a Rubidium %TODO: Right squenz? Without those only the amplitudes could be seen in the plots. -% TODO : Picture of the setup + % TODO: Plots from the Hardware \section{Produced constellation plots} - +In this section the plots from the simulation and the hardware are shown. % TODO anayl %TODO achsenbeschrieftung @@ -509,7 +507,7 @@ Without those only the amplitudes could be seen in the plots. \centering \input{figures/tikz/hardware} \caption{ - HARDWARE + Plots from the different measurements with the two SDRs. \label{fig:hardware-mesurement} } \end{figure} 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) diff --git a/doc/thesis/figures/tikz/hardware.tex b/doc/thesis/figures/tikz/hardware.tex index d13926b..e4c3640 100644 --- a/doc/thesis/figures/tikz/hardware.tex +++ b/doc/thesis/figures/tikz/hardware.tex @@ -2,6 +2,7 @@ \newcommand{\makeplot}[5]{% \hfill + \tikzset{external/force remake} \begin{tikzpicture} \begin{axis}[ width = {\linewidth / 3.3}, @@ -32,8 +33,8 @@ title = {QPSK LOS, Indoors (Lab)}, } % -\makeplot{figures/data/qpsk_hw_lab.dat}{0}{1}{.25}{ - title = {TODO}, +\makeplot{figures/data/qpsk_hw_outdoors_1.dat}{0}{1}{.25}{ + title = {QPSK LOS, Outdoors}, } % \makeplot{figures/data/qam_hw_lab.dat}{0}{1}{2}{ @@ -51,7 +52,7 @@ align = right, }, } -\makeplot{figures/data/qpsk_hw_lab.dat}{2}{3}{.25}{} +\makeplot{figures/data/qpsk_hw_outdoors_1.dat}{2}{3}{.25}{} \makeplot{figures/data/qam_hw_lab.dat}{2}{3}{2}{} \newline @@ -65,7 +66,7 @@ align = right, }, } -\makeplot{figures/data/qpsk_hw_lab.dat}{4}{5}{2}{} +\makeplot{figures/data/qpsk_hw_outdoors_1.dat}{4}{5}{2}{} \makeplot{figures/data/qam_hw_lab.dat}{4}{5}{2}{} \newline @@ -79,6 +80,6 @@ align = right, }, } -\makeplot{figures/data/qpsk_hw_lab.dat}{6}{7}{2}{} +\makeplot{figures/data/qpsk_hw_outdoors_1.dat}{6}{7}{2}{} \makeplot{figures/data/qam_hw_lab.dat}{6}{7}{2}{} \newline -- cgit v1.2.1