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 continous or an intermittent beacon.
This influences the tradeoff between methods.
\\
% outline of chapter
In the following, the synchronisation scheme for both the continuous and intermittent beacon are elaborated upon.
An example setup of two antennas ($A_i$) at different distances from a transmitter ($T$).
}
\label{fig:beacon_spatial_setup}
\end{figure}
The setup of an additional in-band synchronisation mechanism using a transmitter reverses the method of interferometry.\todo{Requires part in intro about IF}
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 over these distances.
Since the signal is an electromagnetic wave, its instantanuous 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 such, the time delay due to propagation can be written as
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$.
In general, we are interested in synchronising an array of antennas.
As \eqref{eq:synchro_mismatch_clocks} applies for any two antennas in the array, all the antennas that record the signal can determine the synchronisation mismatches simultaneously.
The mismatch terms for any two pairs of antennas sharing a single antenna $\{(i,j), (j,k)\}$ allows to find the closing mismatch term for $(i,k)$ since
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 tradeoff between the gained accuracy and the timescale between synchronisation periods allows for a dead time of the detectors during synchronisation.
Before recording a signal at a detector, it is typically put through a filterchain which acts as a bandpass filter.
This causes the sampled pulse to be stretched in time (see Figure~\ref{fig:pulse:filter_response}).
\\
The response of a filter is characterised by the response to an impulse.
In Figure~\ref{fig:pulse:filter_response}, an impulsive signal is filtered using a Butterworth filter which bandpasses the signal between $30\MHz$ and $80\MHz$.
The resulting signal can be used as a template to match against a measured waveform.
\\
A measured waveform will consist of the filtered signal in combination with noise.
Due to the linearity of filters, a noisy waveform can be simulated by summing the components after separately filtering them.
Figure~\ref{fig:pulse:simulated_waveform} shows an example of the waveform obtained when summing these components with a considerable noise component.
Since the noise is gaussian distributed in the time domain, it is natural to use the root mean square of its amplitude.
\\
Therefore, in the following, the signal-to-noise ratio will be defined as the maximum amplitude of the filtered signal versus the root-mean-square of the noise amplitudes.
Detecting the modeled signal from Figure~\ref{fig:pulse:filter_response} in a waveform can be achieved by finding the correlation~\eqref{eq:correlation_cont} between the two signals.
This is a measure of how similar two signals $u(t)$ and $v(t)$ are as a function of the time delay $\tau$.
The maximum is attained when $u(t)$ and $v(t)$ are most similar to each other.
This then gives a measure of the best time delay $\tau$ between the two signals.
Lifting period degeneracy ($k=m-n=7$ periods) using the optimal overlap between impulsive signals.
}
\label{fig:beacon_sync:period_alignment}
\end{subfigure}
\caption{
Synchronisation scheme for two antennas using a continuous beacon and an impulsive signal, each emitted from a separate transmitter.
Grey dashed lines indicate periods of the beacon (orange),
full lines indicate the time of the impulsive signal (blue).
\\
Middle panel: The beacon allows to resolve a small timing delay ($\Delta t_\phase$).
\\
Lower panel: Expecting the impulsive signals to come from the same source, the overlap between the two impulsive signals is used to lift the period degeneracy ($k=m-n$).
With an estimated accuracy of the \gls{GNSS} below $50\ns$ the correct beacon period can be determined, resulting in a unique $\tTrueEmit$ transmit time\todo{reword}.
The typical method to obtain spectral information from periodic data is the \gls{FFT} (a fast implementation of the \gls{DFT}\eqref{eq:fourier:dft}).
Such an algorithm efficiently finds the amplitudes and phases within a trace $x$ at specific frequencies $f = f_s \tfrac{k}{N}$ determined solely by the number of samples $N$ ($0\leq k < N$) and the sampling frequency $f_s$.
where $x(t)\in\mathcal{R}$ is sampled at times $t[n]$.
Considering a finite sampling size $N$ and periodicity of the signal, the bounds of the integral in \eqref{eq:fourier} collapse to $t[0]$ up to $t[N]$.
From this it follows that the lowest resolvable frequency is $f_\mathrm{lower}=\tfrac{1}{T}=\tfrac{1}{t[N]- t[0]}$.
\\
Additionally, when the sampling of $x(t)$ is equally spaced, the $t[n]$ terms can be written as a sequence, $t[n]- t[0]= n \Delta t =\tfrac{n}{f_s}$, with $f_s$ the sampling frequency.
The highest resolvable frequency, known as the Nyqvist frequency, is limited by this sampling frequency as $f_\mathrm{nyqvist}=\tfrac{f_s}{2}$.
\\
% DFT sampling of DTFT / efficient multifrequency FFT
Implementing the above decomposition of $t[n]$, \eqref{eq:fourier:dtft} can be rewritten in terms of multiples $k$ of the sampling frequency, becoming the \acrlong{DFT}
For integer $0\leq k < N $, efficient algorithms exist that derive all $X(0\leq k < N )$ in $\mathcal{O}( N \log N )$ calculations, a~\acrlong{FFT}, sampling a subset of the frequencies.\Todo{citation?}
% Recover A\cos(2\pi t[n] f + \phi) using above definitions
Applying \eqref{eq:fourier:dtft_decomposed} to a signal $x(t)= A\cos(2\pi t[n] f +\pTrue)$ with the above definitions obtains
an amplitude $A$ and phase $\pTrue$ at frequency $f$.
When the minus sign in the exponent of \eqref{eq:fourier} is not taken into account, the calculated phase in \eqref{eq:complex_phase} will have an extra minus sign.
When calculating the \gls{DTFT}for multiple inputs which share both an equal number of samples $N$ and equal sampling frequencies $f_s$, the $\sin$ and $\cos$ terms in \eqref{eq:fourier:dtft_decomposed} are the same for a single frequency $f$.
Therefore, these can be precomputed ahead of time, reducing the number of calculations to $2N$ multiplications.
% .. relevance to hardware if static frequency
Thus, for static frequencies in a continuous beacon, the coefficients for evaluating the \gls{DTFT} can be put into the hardware of the detectors,
opening the way to efficiently measuring the phases in realtime.\Todo{figure?}
% Beacon frequency known -> single DTFT run
% Beacon frequency unknown -> either zero-padding FFT or, DTFT grid search
%When the beacon frequency is known, a single \gls{DTFT} needs to be evaluated.
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.
Like the amplitude distribution \eqref{eq:phasor_sum:pdf:amplitude}, the marginal phase distribution of \eqref{eq:phasor_sum:pdf:joint} results in two extremes cases;
weak signals correspond to the uniform distribution for \eqref{eq:noise:pdf:joint}, while strong signals are well approximated by a gaussian distribution.
The analytic form takes the following complex expression,
A periodic signal is sent out from a transmitter (the oscillator), and captured by an antenna (the chip the oscillator drives).
In a digital circuit, the oscillator often emits a discrete (square wave) signal (see Figure~\ref{fig:beacon:ttl}).
A tick is then defined as the moment that the signal changes from high to low or vice versa.
In this scheme, synchronising requires latching on the change very precisely.
As between the ticks, there is no time information in the signal.
\\
\todo{Possibly Invert story from short->long to long->short}
Instead of introducing more ticks in the same time, and thus a higher frequency of the oscillator, a smooth continous signal can also be used.
This enables the opportunity to determine the phase of the signal by measuring the signal at some time interval.
This time interval has an upper limit on its size depending on the properties of the signal, such as its frequency, but also on the length of the recording.
In Figure~\ref{fig:beacon:sine}, both sampling~1~and~2 can reconstruct the sine wave from the measurements.
Meanwhile, the square wave has some leeway on the precise timing.\todo{reword sentence}
To setup a time synchronising system for airshower measurements, actually only the high frequency part of the beacon must be employed.
The low frequency part, from which the number of oscillations of the high frequency part are counted, is supplied by the very airshower that is measured.
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
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:phase_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.