From 0d9af1f937ae7baf95052bcb30261fc92cefc0f2 Mon Sep 17 00:00:00 2001
From: sara <sara.halter@gmx.ch>
Date: Tue, 14 Dec 2021 22:48:10 +0100
Subject: Doku

---
 doc/thesis/chapters/implementation.tex | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

(limited to 'doc/thesis/chapters/implementation.tex')

diff --git a/doc/thesis/chapters/implementation.tex b/doc/thesis/chapters/implementation.tex
index ae4571f..9b8d543 100644
--- a/doc/thesis/chapters/implementation.tex
+++ b/doc/thesis/chapters/implementation.tex
@@ -256,8 +256,9 @@ In this part the fading blocks for the simulation are added. Tow different types
 
 \subsection{Fading with Discrete-time model}
 
-For the statical version according to \ref{sec:discrete-time-model} to implement and illustrat the fading effect, a separate block was created and implemented in the channel. Nearer shown in \ref{lst:fir-block}. This block is based on a FIR filter. It can be displayed with a direct path or without one. With the help of this filter, the delay of the line of side paths are illustrated. In this block it is possible to simulate any number of these paths with different strengths, as long as there is an associated amplitude specified for each delayed path. Unfortunately, these simulation values do not correspond to the realety, because too many incalculable side effects occur, which aren't possiple to ilustrate in this simulation.
-This block was additionally implemented with the method described in \ref{sec:fractional-delay} to allow non-integer delay values compared to the samples shown in \figref{fig:fractional-delay-sinc-plot}. Where the sinc function does not select an integer sample. Which in turn means that the other sampled values do not add up to zero.
Thus, they will be distributed among the other whole numbers. A window function could also be implemented to limit these values. Here none was implemented because the sinc function is restricted.
+For the statical version according to \ref{sec:discrete-time-model} to implement and illustrat the fading effect, a separate block was created and implemented in the channel. Nearer shown in \ref{lst:fir-block}. This block is based on a FIR filter. It can be displayed with a direct path or without one. With the help of this filter, the delay of the line of side paths are illustrated. In this block it is possible to simulate any number of these paths with different strengths, as long as there is an associated amplitude specified for each delayed path. Unfortunately, these simulation values do not correspond to the realety, because too many incalculable side effects occur, which aren't possiple to ilustrate in this simulation.
+This block was additionally implemented with the method described in \ref{sec:fractional-delay} to allow non-integer delay values compared to the samples shown in \figref{fig:fractional-delay-sinc-plot}. Where the sinc function does not select an integer sample. Which in turn means that the other sampled values do not add up to zero.
+Thus, they will be distributed among the other whole numbers. A window function could also be implemented to limit these values. Here none was implemented because the sinc function is restricted.
 
 \skelpar[5]{
 	Discrabe a perfect plot
@@ -316,17 +317,21 @@ This block was additionally implemented with the method described in \ref{sec:fr
 
 % TODO: Quelle https://ch.mathworks.com/help/comm/ug/fading-channels.html?searchHighlight=rician%20fading&s_tid=srchtitle_rician%2520fading_2#a1070327427b1
 
+In order to represent the effect of the multipaht fading not only statically, a second model was created using the Frequency Selective Fading Model from Gnu Radio, according to \ref{statistical_model}.which was implemented after the algorithm from the paper \cite{Alimohammad2009}. It is based on the sum-of sinusoid principal(SOS)
 
 \begin{german}
-	Um den effect des multipaht fadinngs nicht nur statisch darzu stellen, wurde ein zweites model kreiert mit hilfe des Frequency Selective Fading Models von Gnu Radio, gemäss \ref{statistical_model}.
-	Welcher nach dem Algorthmus aud dem paper \cite{Alimohammad2009} implementiert wurde. 
+	Um den effect des multipaht fadinngs nicht nur statisch darzu stellen, wurde ein zweites model kreiert mit hilfe des Frequency Selective Fading Models von Gnu Radio, gemäss \ref{statistical_model}.Welcher nach dem Algorthmus aud dem paper \cite{Alimohammad2009} implementiert wurde. Er basiert auf dem sum-of sinusoid princip(SOS)
+	
 	Um die resultate einigermassse nach vollziehen zu können wurde ein MATLAP model zur veranschaulichung erstelle.
 	Um ein realistisches beispiel zu haben wurden werte aus dem Skript \cite{Mathis} genomen
 	
 \end{german}
 
 Some realistic value for this block are:
-The first delay when theirs non line of side is zero. The second delayed path depend on the environment of measurement. In an indoor enviroment it is usaely between \(1\cdot10^{-9}\) to \(1\cdot10^{-7}\) and in an outdoor environment between \(1\cdot10^{-7}\) to \(1\cdot10^{-5}\). The rest depends on on the bandwith 
+The first delay when theirs non line of side should be zero. The second delayed path depend on the environment of measurement. In an indoor enviroment it is usually between \(1\cdot10^{-9}\) to \(1\cdot10^{-7}\) and in an outdoor environment between \(1\cdot10^{-7}\) to \(1\cdot10^{-5}\). The rest depends on on the bandwidth. 
+
+
+Rician fading factor K = 0 = Rylehnt Model 
 
 \skelpar[5]{
 	Simulation mit Werten aus dem Skript
-- 
cgit v1.2.1


From c46403fcb087bab828c66486309d8f859a14d9ca Mon Sep 17 00:00:00 2001
From: SARA <sara.halter@ost.ch>
Date: Wed, 15 Dec 2021 09:21:12 +0100
Subject: More doku work

---
 doc/thesis/chapters/implementation.tex | 58 ++++++++++++++++++++++++++++------
 1 file changed, 49 insertions(+), 9 deletions(-)

(limited to 'doc/thesis/chapters/implementation.tex')

diff --git a/doc/thesis/chapters/implementation.tex b/doc/thesis/chapters/implementation.tex
index 9b8d543..ff073ee 100644
--- a/doc/thesis/chapters/implementation.tex
+++ b/doc/thesis/chapters/implementation.tex
@@ -48,7 +48,7 @@ Also as a side effect, in theory this setup allows to have one computer running
 \section{Hardware}
 
 \begin{table}[b]
-	%To DO sepzifikationen ampssen / genauer? https://www.ettus.com/wp-content/uploads/2019/01/b200-b210_spec_sheet.pdf
+	%TODO sepzifikationen ampssen / genauer? https://www.ettus.com/wp-content/uploads/2019/01/b200-b210_spec_sheet.pdf
 	% https://kb.ettus.com/B200/B210/B200mini/B205mini#FAQ
 	\centering
 	\begin{tabular}{ll}
@@ -91,7 +91,7 @@ GR provides a constellation modulator block, that already implements several sta
 What is here referred to as envelope detector has the purpose of synchronizing the symbols and equalizing the input signal amplitude. This is accomplished in GRC using two blocks: a polyphase clock sync and a CMA equalizer. The input signal for the envelope detector has 4 samples per symbol, while the output has only one sample per symbol.
 
 \paragraph{Polyphase Clock Sync}
-%% To Do : nochmals anschauen ob dieese erklärung verständlich ist und richtig interpretiert wurde.
+%TODO : nochmals anschauen ob dieese erklärung verständlich ist und richtig interpretiert wurde.
 With the the polyphase clock sync the symbols can be synchronized by preforming a time synchronization with the help of multiple filterbanks. For that the derivative of the filtered signal should be minimized which turns to a better SNR. 
 % This works with the help of two filterbanks, one of them contains the filters of the signal adapted to the pulse shaping with several phases. The other contains its derivative. So in the time domain it has a sinc shape, for the output Signal the sinc peak should be on a sample, with the fact that sinc(0) = 1 and sinc(0)' = 0 an error signal can be generated which tells how far away from the peak it is. This error Signal should be zero this is possible with the help of a loop second order whish constants the number of the filterbank and the rate. This rate is generated because of the clock difference between the transmitter and receiver to synchronized the receiver the filter goes through the phases. For the output one sample per symbol is enough.
 
@@ -177,7 +177,7 @@ def work(self, inputs, outputs):
 
 \begin{figure}
 	\centering
-	%% TODO: move code into separate file
+	% TODO: move code into separate file
 	\begin{tikzpicture}[
 			blk/.style = {
 				draw, rectangle, thick, black,
@@ -248,6 +248,7 @@ In this part the fading blocks for the simulation are added. Tow different types
 	Discuss the multitap FIR model we used. How it is possible to set the delay etc. Also mathematics for the interpolation.
 }
 
+%TODO find out what to do with this text in the comment
 %To get a basic line for further simulations a 16QAM has been made. The results of this simulation are shown in \figref{fig:simul16QAM} and \figref{fig:simul16QAM_1} as the red Signal. In \tabref{tab:modulation_settings} some importer Parameter settings for a different modulation scheme are mentioned.
 %
 %A FIR-Filter was added in the Channel to create a time delay between tow paths. In \figref{fig:simul16QAM} the result includes a direct path and a delayed one. In the plot of \figref{fig:simul16QAM_1} the transmission line dosn't include a direct path. %It's impotent to mention that the delay should be smaller than the symbol rate or a multiple of it. (Stimmt dies , not sure any more)
@@ -314,13 +315,14 @@ Thus, they will be distributed among the other whole numbers. A window function
 \subsection{Fading with Statistical model}
 
 	
-
+\skelpar[5]{
+	Discuss how i did that 
+}
 % TODO: Quelle https://ch.mathworks.com/help/comm/ug/fading-channels.html?searchHighlight=rician%20fading&s_tid=srchtitle_rician%2520fading_2#a1070327427b1
 
 In order to represent the effect of the multipaht fading not only statically, a second model was created using the Frequency Selective Fading Model from Gnu Radio, according to \ref{statistical_model}.which was implemented after the algorithm from the paper \cite{Alimohammad2009}. It is based on the sum-of sinusoid principal(SOS)
 
 \begin{german}
-	Um den effect des multipaht fadinngs nicht nur statisch darzu stellen, wurde ein zweites model kreiert mit hilfe des Frequency Selective Fading Models von Gnu Radio, gemäss \ref{statistical_model}.Welcher nach dem Algorthmus aud dem paper \cite{Alimohammad2009} implementiert wurde. Er basiert auf dem sum-of sinusoid princip(SOS)
 	
 	Um die resultate einigermassse nach vollziehen zu können wurde ein MATLAP model zur veranschaulichung erstelle.
 	Um ein realistisches beispiel zu haben wurden werte aus dem Skript \cite{Mathis} genomen
@@ -341,9 +343,47 @@ Rician fading factor K = 0 = Rylehnt Model
 
 \subsection{Empirical BER} \label{sec:ber}
 
-%
-%
-%
+To find out how accurate the simulations are comparer with a simulation of the fadinng effect and test measurements, the byte 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. Implemented according to the code in \ref{lst:ber-block}. Every bit is compared with the test vector at the beginning  before the modulation and demodulation part. 
+Because of the fact that the test vector has some random bit at the end the bit error rate has always a value on average 32. 
+
+
+
+\begin{lstlisting}[
+	texcl = true, language = python, escapechar = {`},
+	float, captionpos = b, label = {lst:ber-block},
+	caption = {
+		Block FIR Filter function referenced in listing \ref{lst:phasecorr-work}.
+	},
+	]
+	def work(self, input_items, output_items):
+		inp = input_items[0]
+		# input vector
+	
+		for i in inp:
+			i = np.array(i, dtype=np.uint8)
+			v = np.array(self.vgl, dtype=np.uint8) ^ i
+			# XOR comparsion to find the diviation for the bits 
+			ber = sum(np.unpackbits(v))
+	
+			trueber = ber - 32
+			if trueber < 0:
+			trueber = 0
+	
+			self.ber_samples.appendleft(trueber)
+
+		ber_max, ber_min, ber_avg = self.ber_stats()
+		self.send(self.encode([trueber, ber_max, ber_avg]))
+		#Send the valuse to the GUI
+		return len(inp)
+	
+\end{lstlisting}
+
+
+
+\skelpar[5]{
+	Discuss how i did that 
+}
+
 
 \begin{figure}
 	\includegraphics[width=\linewidth]{./figures/pdfs/qam_nogui.pdf}
@@ -375,4 +415,4 @@ Rician fading factor K = 0 = Rylehnt Model
 	\label{fig:simul16QAM__Hardware}	
 \end{figure}
 
-% To Do: Picture of the setup
+% TODO: Picture of the setup
-- 
cgit v1.2.1


From ec05d311c60432d117d14ba93e3b95bd526d548c Mon Sep 17 00:00:00 2001
From: sara <sara.halter@gmx.ch>
Date: Wed, 15 Dec 2021 14:45:41 +0100
Subject: More Doku

---
 doc/thesis/chapters/implementation.tex | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

(limited to 'doc/thesis/chapters/implementation.tex')

diff --git a/doc/thesis/chapters/implementation.tex b/doc/thesis/chapters/implementation.tex
index ff073ee..9a20d24 100644
--- a/doc/thesis/chapters/implementation.tex
+++ b/doc/thesis/chapters/implementation.tex
@@ -341,10 +341,21 @@ Rician fading factor K = 0 = Rylehnt Model
 
 \subsection{Measurements}
 
+\skelpar[5]{
+	Do some masurements
+}
+
 \subsection{Empirical BER} \label{sec:ber}
 
-To find out how accurate the simulations are comparer with a simulation of the fadinng effect and test measurements, the byte 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. Implemented according to the code in \ref{lst:ber-block}. Every bit is compared with the test vector at the beginning  before the modulation and demodulation part. 
-Because of the fact that the test vector has some random bit at the end the bit error rate has always a value on average 32. 
+To find out how accurate the simulations are comparer with a simulation of the fadinng effect and tested measurements, the byte 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. Implemented according to the code in \ref{lst:ber-block}. Every bit is compared with the test vector at the beginning before the modulation and demodulation part. 
+Because of the fact that the test vector has some random bit at the end the bit error rate has always a value on average 32, even when its perfect match.  So to avoid high numbers this value is subtracted and only on focused on the positive values. 
+
+The vector which is used as test vector is: \([0x1f, 0x35] + [0x12, 0x48] \), because this numbers are well suited to compare.
+For generating the Byte error rate it is focus on byte-blocks of a specific length. So for each of this blocks compared with test vector there is a BER. To make it simpler or better said to avoid mistakes, the last 200 of this individual BER are taken to find an average and the highest value. 
+
+\skelpar[5]{
+	Maybe more 
+}
 
 
 
@@ -380,9 +391,6 @@ Because of the fact that the test vector has some random bit at the end the bit
 
 
 
-\skelpar[5]{
-	Discuss how i did that 
-}
 
 
 \begin{figure}
-- 
cgit v1.2.1

