While obtaining a competitive resolution of the atmospheric shower depth \Xmax with radio interferometry requires an inter-detector synchronisation of better than a few nanoseconds (see Figure~\ref{fig:xmax_synchronise}),
the synchronisation defect in \gls{AERA} was found to range between a few nanoseconds up to multiple tens of nanoseconds over the course of a single day (see~\cite[Figure~3]{PierreAuger:2015aqe}).\Todo{copy figure?}
For this section, it is assumed that the transmitter is actively introduced to the array and is therefore fully controlled in terms of produced signals and the transmitting power.
It is foreseeable that ``parasitic'' setups, where sources that are not under control of the experiment introduce signals, can be analysed in a similar manner.
The nature of the transmitted radio signal, hereafter beacon, affects both the mechanism of reconstructing the timing information and the measurement of the radio signal for which the antennas have been designed.
Depending on the stability of the station clock, one can choose for employing a continuous beacon (e.g.~a~sine~waves) or one that is emitted at some interval (e.g.~a~pulse).
In the following, the synchronisation scheme for both the continuous and the recurrent beacon are elaborated upon.
Before going in-depth on the synchronisation using either of such beacons, the timing problem\Todo{rephrase} common to both scenarios is worked out.%>>>
An in-band solution for synchronising the detectors is effectively a reversal of the method of interferometry in Section~\ref{sec:interferometry}.
The distance between the transmitter $T$ and the antenna $A_i$ incur a time delay $(\tProp)_i$ caused by the finite propagation speed of the radio signal (see Figure~\ref{fig:beacon_spatial_setup}).
Since the signal is an electromagnetic wave, its instantaneous velocity $v$ depends solely on the refractive index~$n$ of the medium as $v =\frac{c}{n}$.
In general, the refractive index of air is dependent on factors such as the pressure and temperature of the air the signal is passing through and the frequencies of the signal.
However, in many cases, the refractive index can be taken constant over the trajectory to simplify models.
As \eqref{eq:transmitter2antenna_t0} applies for each antenna, two antennas recording the same signal from a transmitter will share the $\tTrueEmit$ term.
In that case, the differences between the true arrival times $(\tTrueArriv)_i$ and propagation delays $(\tProp)_i$ of the antennas can be related as
As the mismatch is the difference between the antenna clock deviations, this scheme does not allow to uniquely attribute the mismatch to one of the clock deviations $(\tClock)_i$.
As \eqref{eq:synchro_mismatch_clocks} applies for each pair of antennas in the array, all the antennas that record the signal can determine the synchronisation mismatches simultaneously.
Taking one antenna as the reference antenna with $(\tClock)_r =0$, the mismatches across the array can be determined by applying \eqref{eq:synchro_mismatch_clocks} over consecutive pairs of antennas and thus all clock deviations $(\tClock)_i$.
The trade-off between the gained accuracy and the timescale between synchronisation periods allows for a dead time of the detectors during synchronisation.
In Figure~\ref{fig:pulse:filter_response}, the impulse and the filter's response are shown, where the Butterworth filter band-passes the signal between $30\MHz$ and $80\MHz$.
Detecting the modelled signal from Figure~\ref{fig:pulse:filter_response} in a waveform can be achieved by finding the correlation (see Section~\ref{sec:correlation}) between the two signals (see Figure~\ref{fig:pulse_correlation}).
This is an effect of the quantisation of the sampling period, where the time offsets $\tau$ are modelled as a uniform distribution in time bins the size of $\Delta t$.
Expecting the noise to be gaussian distributed in the time domain, it is natural to use the \gls{RMS} of its amplitude as a quantity representing the strength of the noise.
From the above, it is clear that both the \gls{SNR} as well as the sampling rate of the template have an effect on the ability to resolve small time offsets.
To further investigate this, we set up a simulation\footnote{\Todo{Url to repository}} where templates with different sampling rates are matched to simulated waveforms for multiple \glspl{SNR}.
First, an ``analog'' template is rendered at $\Delta t =10\mathrm{fs}$ to be able to simulate small time-offsets.
Second, the matching template is created by sampling the ``analog'' template at the specified sampling rate (here considered are $0.5\ns$, $0.1\ns$ and $0.01\ns$).
By evaluating the time residuals for some combinations of \glspl{SNR} and template sampling rates, Figure~\ref{fig:pulse:snr_time_resolution} is produced.
It shows that, as long as the pulse is (much) stronger than the noise ($\mathrm{\gls{SNR}}\gtrsim5$), template matching could achieve a sub-nanosecond timing accuracy even if the measured waveform is sampled at a lower rate (here $\Delta t =2\ns$).
A continuously emitted beacon will be recorded simultaneously with the signals from air showers.
It is therefore important that the beacon does not fully perturb the recording of the air shower signals, but still be prominent enough for synchronising the antennas.
\\
% Use sine wave to filter using frequency
By implementing the beacon signal as one or more sine waves, the beacon can be recovered from the waveform using Fourier Transforms (see Section~\ref{sec:fourier}).
It is then straightforward to discriminate a strong beacon from the air shower signals, resulting in a relatively unperturbed air shower recording for analysis after synchronisation.
\\
Note that for simplicity, the beacon in this section will consist of a single sine wave at $f_\mathrm{beacon}=51.53\MHz$ corresponding to a period of roughly $20\ns$.
This effect is observable in the $\tMeasArriv$ term in \eqref{eq:transmitter2antenna_t0}, describing the time when the signal is measured at the detector, being no longer uniquely defined,
with $-\pi < \pMeasArriv < \pi$ the phase of the beacon at time $\tMeasArriv$, $T$ the period of the beacon and the unknown period counter $k \in\mathbb{Z}$.
In AERA \cite{PierreAuger:2015aqe} for example, the total beacon repeats only after $\sim1\us$ (see Figure~\ref{fig:beacon:pa}).\Todo{present/past}
With an estimated timing accuracy of the \gls{GNSS} under $50\ns$ the correct beacon period can be determined, resulting in a unique $\tTrueEmit$ transmit time\Todo{reword}.
A special case of this last scenario where the period counters are approximated from an extensive air shower is worked out in Chapter~\ref{sec:single_sine_sync}.
By implementing the beacon signal as one or more sine waves, the beacon signal can be recovered from the waveform using Fourier Transforms (see Section~\ref{sec:fourier}).
The typical Fourier Transform implementation, the \gls{FFT}, finds the amplitudes and phases at frequencies $f_m = m \Delta f$ determined solely by properties of the waveform, i.e.~the~sampling frequency $f_s$ and the number of samples $N$ in the waveform ($0\leq m < N$ such that $\Delta f = f_s /(2N)$).
Depending on the frequency content of the beacon, the sampling frequency and the number of samples, one can resort to use such a \gls{DFT}.
However, if the frequency of interest is not covered in the specific frequencies $f_m$, the approach must be modified (e.g.~by~zero-padding or interpolation).\Todo{extend?}
Especially when only a single frequency is of interest, a simpler and shorter route can be taken by evaluating the \gls{DTFT} for this frequency directly.
Of course, like the pulse method, the ability to measure the beacon's sine waves is dependent on the amplitude of the beacon in comparison to other signals (read noise).
To quantify this comparison in terms of signal to noise ratio,
we define the signal level to be the amplitude of the frequency spectrum at the beacon's frequency determined by \gls{DTFT} (the orange line in Figure~\ref{fig:sine:snr_definition}),
and the noise level as the \gls{RMS} of all amplitudes in the noise band determined by \gls{FFT} (blue line in Figure~\ref{fig:sine:snr_definition}).
\\
% longer traces
However, for sine waves, an additional method to increase the \gls{SNR} is available.
In the frequency spectrum, the amplitude with respect to gaussian noise also increases with more samples $N$ in a waveform.
Thus, by recording more samples in a waveform, the sine wave is recovered better.
This effect can be seen in Figure~\ref{fig:sine:snr_vs_n_samples} where the signal to noise ratio increases as $\sqrt{N}$.
Note that the \gls{DTFT}, as a finite \gls{FT}, suffers from spectral leakage, where signals at adjacent frequencies influence the ability to resolve the signals separately.
Depending on the signal to be recovered, different windowing functions (e.g.~Hann, Hamming, etc.) can be applied to a waveform.
For simplicity, in this document, no special windowing functions are applied to waveforms.
The phase measurement of a sine beacon is influenced by other signals in the recorded waveforms,
They can come from various sources, both internal (e.g.~LNA~noise) and external (e.g.~radio~communications) to the detector.
\\
A simple noise model is given by gaussian noise in the time-domain, associated to many independent random noise sources.
Especially important is that this simple noise model will affect the phase measurement depending on the strength of the beacon with respect to the noise level, without introducing a frequency dependence.
Figure~\ref{fig:sine:snr_histograms} shows two histograms ($N=100$) of the phase residuals for a medium and a strong signal, respectively.
It can be shown that for medium and strong signals, the phase residual will be gaussian distributed (see below).
The width of each fitted gaussian in Figure~\ref{fig:sine:snr_histograms} gives an accuracy on the phase offset that is recovered using the \gls{DTFT}.
From Figure~\ref{fig:sine:snr_time_resolution} we can conclude that depending on the \gls{SNR}, the timing accuracy of the beacon is below $1\ns$ for our beacon at $51.53\MHz$.
Since the time accuracy is derived from the phase accuracy, slightly lower frequencies could be used, but they would require a stronger signal to resolve to the same degree.
Likewise, higher frequencies are an available method of linearly improving the time accuracy.
For the $51.53\MHz$ beacon, the next Chapter~\ref{sec:single_sine_sync} shows a method of using an additional signal to counter the period degeneracy of a single sine wave.
Sine timing accuracy as a function of signal to noise ratio for waveforms of $10240$ samples containing a sine wave at $51.53\MHz$ and white noise.
It can be shown that the phase accuracies (right y-axis) follow a special distribution~\eqref{eq:random_phasor_sum:phase:sine} that is well approximated by a gaussian distribution for $\mathrm{\gls{SNR}}\gtrsim3$.