\chapter{Preliminaries}
\section{Web Worker}
\label{section:webworkers}
Web Workers are a web API that allows running JavaScript code in background threads in the browser. This way you can run CPU intensive processes without stalling the main thread and locking up the UI.

There's a few limitations with Web Workers. A Web Worker doesn't have access to the \gls{dom}, to the window object and to some web APIs.

The main thread and Web Workers can communicate together using messages. \cite{WebWorkers}

\section{CRC}
\label{section:crc}

\gls{crc} is a family of error detection codes designed to check if a message has been corrupted during transmission. To check if any errors ocurred during transmission, the checksum that was transmitted with the message, and the checksum that is calculated from the received message are compared, if they don't match, the message contains an error.

For calculating a \gls{crc} value message, which is treated as a binary polynomial is divided by another value, to so-called generator polynomial. The remainder of this division is the checksum value. The order of the generator polynomial defines the bit-length of the resulting checksum \cite{crcGuide}. 

Depending on the chosen generator polynomial different groups of errors can be detected \cite{crcErrors}:
\begin{itemize}
    \item{A single, and double bit errors can always be detected}
    \item{Depending on the polynomial more bit errors can be detected inside specific message lengths}
    \item{Using a n-bit generator polynomial can detect burst errors of up to n-bits in length}
    \item{A generator polynomial with an even amount of terms can detect errors with an odd amount of bits}
\end{itemize}

Because of these small variations there many different implementations of \gls{crc} algorithms in use and defined by different parties \cite{crcCatalogue}.

\section{Manchester Code}
Manchester is a simple encoding code for the transmission of binary data. The data is encoded in the transistions of the signal instead of simple high or low values. A transition from low to high indicates a 0 and a transition from high to low indicates a 1 in the original definition by G. E. Thomas, in the definition from IEEE the values of the transitions are swapped (see \autoref{figure:manchester_code}).

\begin{figure}[H]
    \includegraphics[width=\textwidth]{manchester_code.png}
    \caption{Manchester Code\cite{manchesterCodeImage}}
    \label{figure:manchester_code}
\end{figure}

The advantages of manchester encoding is that there are no prolonged high or low signals and the original clock signal can be extracted from the signal, on the other side the bandwidth requirements are doubled as two bits in the signal are needed to encode one bit of the original data \cite{manchesterCode}.

\section{Hall Effect Sensor}
\label{section:hallEffectSensor}
A Hall Effect Sensor is a type of sensor to measure the strength of magnetic fields. This type of magnetometer is found in many smartphones today \cite{hallEffectSensor} and is generally used for compass capabilities and for positioning \cite{smartphoneSensors}.

It utilizes the so-called hall effect to do so. The hall effect is the voltage between two sides of a current-carrying conductor inside a magnetic field \cite{hallEffect} \cite{hallEffect2}.
