\documentclass[../thesis.tex]{subfiles}

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

\begin{document}
\chapter{Disciplining by Beacon}
\label{sec:disciplining}
The main method of synchronising multiple stations is by employing a GNSS.
This system should deliver timing with an accuracy in the order of $50\ns$.

As outlined in Section~\ref{sec:time:beacon}, a beacon can also be employed to synchronise the stations.
This chapter outlines the steps required to setup a synchronisation between multiple antennae using one transmitter.



\bigskip
The distance between a transmitter and an antenna incurs a time delay $t_d$.
Since the signal is an electromagnetic wave, its phase velocity $v$ depends on the refractive index~$n$ as
\begin{equation}
	\label{eq:refractive_index}
	v_p = \frac{c}{n}
\end{equation}
with $c$ the speed of light in vacuum.
Note that the refractive index of air is dependent on, among other things, the pressure and temperature of the air the signal is passing through and the frequencies of the signal.


To synchronise two antennas with a common signal, the difference in these time delays must be known.
Taking the refractive index to be constant results in
\begin{equation}
	\label{eq:spatial_time_difference_simple}
	\phantom{.}
	\Delta t_{d} = t_{d_1} - t_{d_2} = (d_1 - d_2)/v = d_{12} / v
	.
\end{equation}
\\

In addition to the time delay incurred from varying distances, the local antenna clock can be skewed.
This effect shows up as an additional time delay $t_c$.

In total, the difference in apparent arrival time of a signal is a combination of both time delays
\begin{equation}
	\label{eq:total_time_difference}
	\phantom{.}
	\Delta t = t_d + t_c
	.
\end{equation}

\begin{figure}
	\centering
	\includegraphics[width=0.7\textwidth,height=0.7\textheight,keepaspectratio]{beacon/beacon_spatial_time_difference_setup.pdf}
	\caption{
		An example setup of two antennas ($A_i$) at different distances from a transmitter ($T$).
	}
	\label{fig:beacon_spatial_setup}
\end{figure}



\clearpage
% \delta \phase
As mentioned in Section~\ref{sec:time:beacon}, a beacon consisting of a single sine wave allows to syntonise two antennas by measuring the phase difference of the beacon at both antennas $\Delta \phase = \phase_1 - \phase_2$.
This means the local clock difference of the two antennas can be corrected upto an unknown multiple $k$ of its period, with
\begin{equation}
	\label{eq:phase_diff_to_time_diff}
	\phantom{.}
	\Delta t = \Delta t_\phase + kT = \left(\frac{\Delta \phase}{2\pi} + k\right) T
	.
\end{equation}
By finding a suitably long timescale signal in addition to the sine wave, the amount of periods $k$ can be determined.
\\

\begin{figure}
	\centering
	\includegraphics[width=\textwidth]{beacon/08_beacon_sync_timing_outline.pdf}
	\caption{
		Waveforms of a beacon at two antennas, where the clocks have not been synchronised.
		Grey dotted lines indicate periods of the sine wave (orange),
		full lines indicate the time of the impulsive signal (blue).
		Both are sent out from the same transmitter.
		The sine wave allows to resolve a small timing delay ($\Delta t_\phase$),
		while the impulsive signal allows to calibrate the amount of cycles ($m$,~$n$) the two clocks are separated.
	}
	\label{fig:beacon_outline}
	\todo{
		Redo figure without xticks and spines,
		rename $\Delta t_\phase$,
		also remove impuls time diff
	}
\end{figure}

In Figure~\ref{fig:beacon_outline}, both such a signal and a sine wave beacon are shown as received at two desynchronised antennas.
The total time delay $\Delta t$ is indicated by the location of the peak of the slow signal.
Part of this delay can be observed as a phase difference $\Delta \phase$ between the two beacons.


% k from coherent sum
\bigskip
The phase difference of the beacon signal obtained in Figure~\ref{fig:beacon_outline} allows to correct small (with respect to the beacon frequency) time delays.
The total time delay may, however, be much larger than one such period.
As shown in \eqref{eq:phase_diff_to_time_diff}, after correcting for the time delay proportional to the phase difference $\Delta t_\phase$, the left-over time delay should be a multiple of the beacon period $kT$.

\bigskip
When the slower signal is transmitted from the transmitter that sent out the beacon signal, then the number of periods $k$ can be obtained directly from the signal.
If, however, the slow signal is sent from a different transmitter, the different distances incur different time delays.
In a static setup, these distance should be measured to such a degree to have a time delay accuracy of about one period of the beacon signal.\todo{reword sentence}
\\

\bigskip
If measuring the distances to the required accuracy is not possible, a different method must be found to obtain the correct number of periods.
The total time delay in \eqref{eq:phaes_diff_to_time_diff} contains a continuous term $\Delta t_\phase$ that can be determined from the beacon signal, and a discrete term $k T$ where $k$ is the unknown discrete quantity.
\\

Since $k$ is discrete, the best time delay might be determined from the calibration signal by using a coherent sum
\begin{equation}
	\label{eq:coherent_sum}
	\phantom{,}
	%\chi( t; k) = \sum
	,
\end{equation}
where .., finding the best time delay at the maximum of the sum.
The time delay obtained from the coherent sum

\bigskip
When measuring airshowers, the very signal of the airshower can be used as the calibration signal.
This falls into the dynamic setup described above.
However, while in a static setup the value of $k$ can be estimated from the distances, the distances for each airshower will differ.
\\



\hrule
\bigskip
\hrule

Simulation

Sine + impulsive signal

\end{document}
