% vim: fdm=marker fmr=<<<,>>>
\documentclass[../thesis.tex]{subfiles}

\graphicspath{
	{.}
	{../../figures/}
	{../../../figures/}
}

\begin{document}
\chapter{GRAND signal chain characterisation}
\label{sec:gnss_accuracy}

% systematic delays important to obtain the best synchronisation
The beacon synchronisation strategy hinges on the ability to measure the beacon signal with sufficient timing accuracy.
In the previous chapters, the overall performance of this strategy has been explored by using simulated waveforms.
\\
% ADC and filtering setup most important component.
As mentioned in Chapter~\ref{sec:waveform}, the measured waveforms of a true detector will be influenced by characteristics of the antenna, the filter and the \gls{ADC}.
Especially the filter and \gls{ADC} are important components to be characterised to compensate for possible systematic (relative) delays.
This chapter starts an investigation into these systematic delays within \gls{GRAND}'s \gls{DU} V2.0\cite{GRAND:DU2}.
\\

%\section{GRAND DU}% <<<
%\begin{figure}
%	\begin{subfigure}{0.47\textwidth}
%		\includegraphics[width=\textwidth]{grand/DU_board_encased}
%	\end{subfigure}
%	\hfill
%	\begin{subfigure}{0.47\textwidth}
%		\includegraphics[width=\textwidth]{grand/DU_board_nocase}
%	\end{subfigure}
%	\caption{
%		\gls{GRAND}'s \acrlong{DU} V2.0 inside (\textit{left}) and outside (\textit{right}) its protective encasing.
%	}
%	\label{fig:grand_du}
%\end{figure}

% ADC
At the base of every single antenna, a \gls{DU} is mounted.
%The \gls{DU} (see Figure~\ref{fig:grand_du}), at the base of every single antenna, is the workhorse of \gls{GRAND}.\Todo{rephrase}
Its protective encasing has three inputs to which the different polarisations of the antenna are connected.
These inputs are connected to their respective filterchains, leaving a fourth filterchain as spare.
Each filterchain bandpasses the signal between $30\MHz$ and $200\MHz$.
Finally, the signals are digitised by a four channel 14-bit \gls{ADC} sampling at $500\MHz$.
%The input voltage ranges from $-900\mV$ to $+900\mV$.
In our setup, the channels are read out after using one of two internal ``monitoring'' triggers.
\\

% timestamp = GPS + local oscillator
%The \gls{DU} timestamps an event using a combination of the 1\gls{PPS} of a Trimble ICM 360 \gls{GNSS} chip\Todo{ref?} and counting the local oscillator running at $500\MHz$.
%At trigger time, the counter value is stored to obtain a timing accuracy of roughly $2\ns$.
%The counter is also used to correct for fluctuating intervals of the 1\gls{PPS} by storing and resetting it at each incoming 1\gls{PPS}.


\begin{figure}% <<<<
	\centering
		\includegraphics[width=0.5\textwidth]{grand/grand_DU_encased}
		\caption{
			\gls{GRAND}'s \acrlong{DU} V2.0 inside its protective encasing.
		}
		\label{fig:grand_du}
\end{figure}% >>>>

% >>>
%\section{Filterchain Relative Time Delays}% <<<
Both the \gls{ADC} and the filterchains introduce systematic delays.
Since each channel corresponds to a polarisation, it is important that relative systematic delays between the channels can be accounted for.
\\

\begin{figure}[h]
	\centering
	\includegraphics[width=0.4\textwidth]{grand/setup/channel-delay-setup.pdf}
	\caption{
		Relative time delay experiment, a signal generator sends the same signal to two channels of the \gls{DU}.
		The extra time delay incurred by the loop in the upper cable can be ignored by interchanging the cabling and doing a second measurement.
	}
	\label{fig:channel-delay-setup}
\end{figure}
Figure~\ref{fig:channel-delay-setup} illustrates a setup to measure the relative time delays of the filterchain and \gls{ADC}.
Two \gls{DU}-channels receive the same signal from a signal generator where one of the channels takes an extra time delay $\Delta t_\mathrm{cable}$ due to extra cable length.
In this ``forward'' setup, both channels are read out at the same time, and a time delay is derived from the channels' traces.
Afterwards, the cables are interchanged and a second (``backward'') time delay is measured.
\\
The sum of the ``forward'' and ``backward'' time delays gives twice the relative time delay $\Delta t$ without needing to measure the time delays due to the cable lengths $t_\mathrm{cable}$ separately since
\begin{equation}\label{eq:forward_backward_cabling}
	\phantom{.}
	\Delta t
	= (t_\mathrm{forward} + t_\mathrm{backward})/2
	= ([\Delta t + t_\mathrm{cable}] + [\Delta t - t_\mathrm{cable}])/2
	.
\end{equation}
\\

% setup: signal
We used a signal generator to emit a single sine wave at frequencies $50$--$ 200 \MHz$ at $200\mathrm{\;mVpp}$ (see Figure~\ref{fig:grand:signal}).
Therefore, the time delays have been measured as phase differences.
% Frequencies above 50mhz not true measurement
In our setup, the cable length difference was approximately $3.17-2.01 = 1.06\metre$, resulting in an estimated cable time delay of roughly $5\ns$.
Figure~\ref{fig:channel-delays} shows this is in accordance with the measured delays.
At a frequency of $50\MHz$, the difference between the forward and backward phase differences is thus expected to be approximately half a cycle.
For higher frequencies, the phase differences can not distinguish more than one period.\Todo{rephrase}
However, because it is symmetric for both setups, this does not affect the measurement of the filterchain time delay.\Todo{prove}
\\

\begin{figure}% <<< fig:grand:signal
	\begin{subfigure}{0.47\textwidth}
		\protect \Todo{2ch waveforms}
	\end{subfigure}
	\hfill
	\begin{subfigure}{0.47\textwidth}
		\protect \Todo{FFT}
	\end{subfigure}
	\caption{
		Waveforms of the sine wave measured in the ``forward'' setup and the phase shift between the channels.
		The sine wave was emitted at $50\MHz$ at $200\;\mathrm{mVpp}$.
	}
	\label{fig:grand:signal}
\end{figure}% >>>

\begin{figure}% <<<<
	\centering
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{grand/split-cable/sine-sweep/ch1ch2fig2-combi-time-delays.pdf}
		\caption{
			Channels 1,2
		}
		\label{fig:channel-delays:1,2}
	\end{subfigure}
	\hfill
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{grand/split-cable/sine-sweep/ch2ch4fig2-combi-time-delays.pdf}
		\caption{
			Channels 2,4
		}
		\label{fig:channel-delays:2,4}
	\end{subfigure}
	\caption{
		Total and Filterchain Time Delays between \subref{fig:channel-delays:1,2} channels 1 and 2, and  \subref{fig:channel-delays:2,4} 2 and 4.
		Dark grey vertical lines indicate the maximum measurable time delay per frequency.
		\protect \Todo{
			y-axes,
			larger text
		}
	}
	\label{fig:channel-delays}
\end{figure}% >>>>

Figure~\ref{fig:channel-delays} shows that in general the relative filterchain time delays are below $0.05\ns$, with exceptional time delays upto $0.2\ns$ between channels 2 and 4.
\Todo{why}

\Todo{discuss data}

% >>>
\section{Outlook}% <<<
\Todo{write}

\begin{figure}
	\centering
	\includegraphics[width=0.3\textwidth]{grand/setup/grand-gps-setup.pdf}
	\caption{
	}
	\label{fig:gps-delay-setup}
\end{figure}





% >>>
\end{document}
