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

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

\begin{document}
\chapter{Single Sine Beacon and Interferometry}
\label{sec:single_sine_sync}

% period multiplicity/degeneracy
A problem with a continuous beacon is resolving the period multiplicity $\Delta k_{ij}$ in \eqref{eq:synchro_mismatch_clocks_periodic}.
\Todo{copy equation here}
It can be resolved by declaring a shared time $\tTrueEmit$ common to the stations in some fashion (e.g.~a~pulse), and counting the cycles since $\tTrueEmit$ per station.
\\

\bigskip
% Same transmitter / Static setup
When the signal defining $\tTrueEmit$ is emitted from the same transmitter that sends out the beacon signal, the number of periods $k$ can be obtained directly from the signal.
If, however, this calibration signal is sent from a different location, the time delays for this signal are different from the time delays for the beacon.
In a static setup, these distances should be measured to have a time delay accuracy of less than one period of the beacon signal.\todo{reword sentence}
\\

\bigskip
% Dynamic setup
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.
\\
Since $k$ is discrete, the best time delay might be determined from the calibration signal by calculating the correlation for discrete time delays $kT$.
\\

\begin{figure}
	\begin{subfigure}{\textwidth}
		\includegraphics[width=\textwidth]{beacon/08_beacon_sync_timing_outline.pdf}
		\caption{
			Measure two waveforms at different antennas at approximately the same local time (clocks are not synchronised).
		}
		\label{fig:beacon_sync:timing_outline}
	\end{subfigure}
	\begin{subfigure}{\textwidth}
		\includegraphics[width=\textwidth]{beacon/08_beacon_sync_synchronised_outline.pdf}
		\caption{
			Phase alignment syntonising the antennas using the beacon.
		}
		\label{fig:beacon_sync:syntonised}
	\end{subfigure}
	\begin{subfigure}{\textwidth}
		\includegraphics[width=\textwidth]{beacon/08_beacon_sync_synchronised_period_alignment.pdf}
		\caption{
			Lifting period degeneracy ($k=n-m=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=n-m$).
	}
	\label{fig:beacon_sync:sine}
	\todo{
		Redo figure without xticks and spines,
		rename $\Delta t_\phase$,
		also remove impuls time diff?
	}
\end{figure}

\bigskip
% Airshower gives t0
In the case of radio detection of air showers, the very signal of the air shower itself can be used as the calibration signal.
This falls into the dynamic setup described above.

\subsection{Lifting the Period Degeneracy with an Air Shower}% <<<

\begin{figure}
	%\includegraphics
	\caption{
		Finding the maximum correlation for integer period shifts between two waveforms recording the same (simulated) air shower.
	}
	\label{}
\end{figure}

\begin{figure}
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{ZH_simulation/findks/ca_period_from_shower.py.maxima.run0.pdf}
		\caption{
			Combined amplitude maxima near shower axis
		}
		\label{fig:findks:maxima}
	\end{subfigure}
	\hfill
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{ZH_simulation/findks/ca_period_from_shower.py.reconstruction.run0.power.pdf}
		\caption{
			Power measurement near shower axis with the $k$s belonging to the maximum in the amplitude maxima.
			\Todo{indicate maximum in plot, square figure}
		}
		\label{fig:findks:reconstruction}
	\end{subfigure}
	\\
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{ZH_simulation/findks/ca_period_from_shower.py.maxima.run1.pdf}
		\caption{
			Maxima near shower axis, zoomed to the location in \ref{fig:findks:reconstruction} with the highest amplitude.
		}
		\label{fig:findks:maxima:zoomed}
	\end{subfigure}
	\hfill
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{ZH_simulation/findks/ca_period_from_shower.py.reconstruction.run1.power.pdf}
		\caption{
			Power measurement of new
		}
		\label{}
	\end{subfigure}
	\caption{
		Iterative $k$-finding algorithm:
		First, in the upper left pane, find the set of period shifts $k$ per point that returns the highest maximum amplitude.
	}
	\label{fig:findks}
\end{figure}

\subsection{Result}
\begin{figure}
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{radio_interferometry/trace_overlap/on-axis/dc_grid_power_time_fixes.py.repair_none.axis.trace_overlap.repair_none.pdf}
		\caption{
			Randomised clocks
		}
		\label{fig:simu:sine:period:repair_none}
	\end{subfigure}
	\hfill
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{radio_interferometry/trace_overlap/on-axis/dc_grid_power_time_fixes.py.repair_phases.axis.trace_overlap.repair_phases.pdf}
		\caption{
			Clock syntonisation
		}
		\label{fig:simu:sine:period:repair_phases}
	\end{subfigure}
	\\
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{radio_interferometry/trace_overlap/on-axis/dc_grid_power_time_fixes.py.no_offset.axis.trace_overlap.no_offset.pdf}
		\caption{
			True clocks
		}
		\label{fig:simu:sine:periods:no_offset}
	\end{subfigure}
	\hfill
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{radio_interferometry/trace_overlap/on-axis/dc_grid_power_time_fixes.py.repair_full.axis.trace_overlap.repair_full.pdf}
		\caption{
			Full resolved clocks
		}
		\label{fig:simu:sine:periods:repair_full}
	\end{subfigure}
	\caption{
		Trace overlap for a position on the true shower axis.
	}
	\label{fig:simu:sine:periods}
\end{figure}


\begin{figure}
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{radio_interferometry/dc_grid_power_time_fixes.py.X400.repair_none.scale4d.pdf}
		\caption{
			Randomised clocks
		}
		\label{fig:grid_power:repair_none}
	\end{subfigure}
	\hfill
	\begin{subfigure}{0.45\textwidth}
		\includegraphics[width=\textwidth]{radio_interferometry/dc_grid_power_time_fixes.py.X400.repair_phases.scale4d.pdf}
		\caption{
			Clock syntonisation
		}
		\label{fig:grid_power:repair_phases}
	\end{subfigure}
	\\
	\begin{subfigure}{0.5\textwidth}
		\includegraphics[width=\textwidth]{radio_interferometry/dc_grid_power_time_fixes.py.X400.no_offset.scale4d.pdf}
		\caption{
			True clocks
		}
		\label{fig:grid_power:no_offset}
	\end{subfigure}
	\hfill
	\begin{subfigure}{0.5\textwidth}
		\includegraphics[width=\textwidth]{radio_interferometry/dc_grid_power_time_fixes.py.X400.repair_all.scale4d.pdf}
		\caption{
			Full resolved clocks
		}
		\label{fig:grid_power:repair_full}
	\end{subfigure}
	\caption{
		Power measurements near the simulation axis with varying degrees of clock deviations.
	}
	\label{fig:grid_power_time_fixes}
\end{figure}
% >>>
\end{document}
