2023-05-24 22:28:17 +02:00
% vim: fdm=marker fmr=<<<,>>>
2023-05-24 16:53:56 +02:00
\documentclass [../thesis.tex] { subfiles}
\graphicspath {
{ .}
{ ../../figures/}
{ ../../../figures/}
}
\begin { document}
2023-08-22 13:02:05 +02:00
\chapter { Waveform Analysis Techniques}
2023-05-24 16:53:56 +02:00
\label { sec:waveform}
2023-06-19 23:43:47 +02:00
%Electric fields,
%Antenna Polarizations,
%Frequency Bandwidth,
2023-05-24 16:53:56 +02:00
2023-06-19 23:43:47 +02:00
Radio antennas are sensitive to changes in their surrounding electric fields.
2023-08-22 13:02:05 +02:00
The polarisation of the electric field that a single antenna can record is dependent on the geometry of this antenna.
2023-11-04 18:14:27 +01:00
Therefore, in experiments such as \gls { Auger} or \gls { GRAND} , multiple antennas are incorporated into a single unit to obtain complementary polarisation recordings.
2023-06-19 23:43:47 +02:00
Additionally, the shape and size of antennas affect how well the antenna responds to certain frequency ranges, resulting in different designs meeting different criteria.
2023-05-24 16:53:56 +02:00
\\
2023-06-19 23:43:47 +02:00
%Waveform time series data
%Sampling,
%Waveform + Time vector,
In each radio detector, the antenna presents its signals to an \gls { ADC} as fluctuating voltages.
In turn, the \gls { ADC} records the analog signals with a specified samplerate $ f _ s $ resulting in a sequence of digitised voltages or waveform.
2023-08-22 13:02:05 +02:00
The $ n $ -th sample in this waveform is then associated with a time $ t [ n ] = t [ 0 ] + n / f _ s = t [ 0 ] + n \cdot \Delta t $ after the initial sample at $ t [ 0 ] $ .
%In reality, the sampling rate will vary by very small amounts resulting in timestamp inaccuracies called jitter.
2023-06-19 23:43:47 +02:00
\\
2023-05-24 22:28:17 +02:00
2023-06-19 23:43:47 +02:00
% Filtering before ADC
2023-09-08 16:59:19 +02:00
The sampling is limited by the \gls { ADC} 's Nyquist frequency at half its sampling rate.
For frequencies at or above this Nyquist frequency, the \gls { ADC} records aliases that appear as lower frequencies in the waveform.
2023-06-19 23:43:47 +02:00
To prevent such aliases, these frequencies must be removed by a filter before sampling.
\\
For air shower radio detection, very low frequencies are also not of interest.
Therefore, this filter is generally a bandpass filter.
2023-11-04 18:14:27 +01:00
For example, in the \gls { AERA} and in AugerPrime's radio detector \cite { Huege:2023pfb} , the filter attenuates all of the signal except for the frequency interval between $ 30 \text { - - } 80 \MHz $ .
2023-06-19 23:43:47 +02:00
\\
In addition to a bandpass filter, more complex filter setups are used to remove unwanted components or introduce attenuation at specific frequencies.
2023-11-04 18:14:27 +01:00
For example, in \gls { GRAND} \cite { GRAND:2018iaj} , the total frequency band ranges from $ 20 \MHz $ to $ 200 \MHz $ .
2023-11-04 17:34:14 +01:00
such that the FM broadcasting band ($ 87 . 5 \MHz \text { - - } 108 \MHz $ ) falls within this range.
2023-09-08 16:59:19 +02:00
Therefore, notch filters have been introduced to suppress signals in this band.
2023-05-24 22:28:17 +02:00
\\
2023-06-19 23:43:47 +02:00
% Filter and Antenna response
2023-09-08 16:59:19 +02:00
From the above it is clear that the digitised waveform is a measurement of the electric field that is sequentially convolved with the antenna's and filter's response.
2023-06-19 23:43:47 +02:00
Thus to reconstruct properties of the electric field signal from the waveform, both responses must be known.
2023-09-08 16:59:19 +02:00
\\
2023-05-24 22:28:17 +02:00
2023-06-26 11:04:16 +02:00
% Analysis, properties, frequencies, pulse detection, shape matching,
2023-09-08 16:59:19 +02:00
Different methods are available for the analysis of the waveform and the antenna and filter responses.
2023-06-19 23:43:47 +02:00
A key aspect is determining the frequency-dependent amplitudes (and phases) in the measurements to characterise the responses and, more importantly, select signals from background.
With \acrlong { FT} s these frequency spectra can be produced.
2023-06-26 11:04:16 +02:00
This technique is especially important for the sinewave beacon of Section~\ref { sec:beacon:sine} , as it forms the basis of the phase measurement.
2023-06-19 23:43:47 +02:00
\\
2023-08-22 13:02:05 +02:00
The detection and identification of more complex time-domain signals can be achieved using the cross correlation,
2023-06-19 23:43:47 +02:00
which is the basis for the pulsed beacon method of Section~\ref { sec:beacon:pulse} .
2023-09-08 16:59:19 +02:00
\\
2023-05-24 22:28:17 +02:00
2023-08-22 13:02:05 +02:00
\section { Fourier Transforms} % <<<<
2023-05-24 22:28:17 +02:00
\label { sec:fourier}
2023-06-19 23:43:47 +02:00
The \gls { FT} allows for a frequency-domain representation of a time-domain signal.
2023-06-26 11:04:16 +02:00
In the case of radio antennas, it converts a time-ordered sequence of voltages into a set of complex amplitudes that depend on frequency.
2023-06-19 23:43:47 +02:00
By evaluating the \gls { FT} at appropriate frequencies, the frequency spectrum of a waveform is calculated.
This method then allows to modify a signal by operating on its frequency components, i.e.~removing a narrow frequency band contamination within the signal.
\\
2023-05-24 22:28:17 +02:00
% DTFT from CTFT
2023-06-26 11:04:16 +02:00
The continuous \acrlong { FT} takes the form
2023-05-24 22:28:17 +02:00
\begin { equation}
\label { eq:fourier}
\phantom { .}
X(f) = \int _ \infty ^ \infty \dif { t} \, x(t)\, e^ { -i 2 \pi f t}
.
\end { equation}
2023-06-19 23:43:47 +02:00
It decomposes the signal $ x ( t ) \in \mathcal { R } $ into plane waves with complex-valued amplitude $ X ( f ) $ at frequency $ f $ .
\\
From the complex amplitude $ X ( f ) $ , the phase $ \pTrue ( f ) $ and amplitude $ A ( f ) $ are calculated as
\begin { equation*}
\begin { aligned}
\phantom { .}
\pTrue (f) = \arg \left ( X(f) \right ), & & \text { and} & & A(f) = 2 \left | X(f) \right |
.
\end { aligned}
\end { equation*}
Note the factor $ 2 $ in this definition of the amplitude.
It is introduced to compensate for expecting a real valued input signal $ x ( t ) \in \mathcal { R } $ and mapping negative frequencies to their positive equivalents.
\\
2023-05-24 22:28:17 +02:00
2023-06-19 23:43:47 +02:00
When $ x ( t ) $ is sampled at discrete times, the integral of \eqref { eq:fourier} is discretized in time to result in the \gls { DTFT} :
2023-05-24 22:28:17 +02:00
\begin { equation}
%\tag{DTFT}
\label { eq:fourier:dtft}
X(f) = \sum _ { n=0} ^ { N-1} x(t[n])\, e^ { -i 2 \pi f t[n]}
\end { equation}
2023-08-22 13:02:05 +02:00
where $ x ( t ) $ is sampled a finite number of times $ N $ at times $ t [ n ] $ .
2023-06-19 23:43:47 +02:00
Note that the amplitude $ A ( f ) $ will now scale with the number of samples~$ N $ , and thus should be normalised to $ A ( f ) = 2 \left | X ( f ) \right | / N $ .
2023-05-24 22:28:17 +02:00
\\
2023-06-19 23:43:47 +02:00
2023-06-26 11:04:16 +02:00
Considering a finite sampling size $ N $ and periodicity of the signal, the bounds of the integral in \eqref { eq:fourier} have collapsed to $ t [ 0 ] $ up to $ t _ { N - 1 } $ .
It follows that the lowest resolvable frequency is $ f _ \mathrm { lower } = 1 / T = 1 / ( t _ { N - 1 } - t [ 0 ] ) $ .
2023-05-24 22:28:17 +02:00
\\
2023-06-19 23:43:47 +02:00
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 = n / f _ s $ , with $ f _ s $ the sampling frequency.
2023-09-08 16:59:19 +02:00
Here the highest resolvable frequency is limited by the Nyquist~frequency.
2023-05-24 22:28:17 +02:00
\\
% DFT sampling of DTFT / efficient multifrequency FFT
2023-06-26 11:04:16 +02:00
Implementing the above decomposition of $ t [ n ] $ , \eqref { eq:fourier:dtft} can be rewritten in terms of multiples of the sampling frequency $ f = k f _ s / N $ , becoming the \gls { DFT}
2023-05-24 22:28:17 +02:00
\begin { equation*}
\label { eq:fourier:dft}
2023-06-19 23:43:47 +02:00
\phantom { .}
2023-06-26 11:04:16 +02:00
X(k)
% = \sum_{n=0}^{N-1} x(t[n])\, e^{ -i 2 \pi f (t[0] + n/f_s)}
% = \sum_{n=0}^{N-1} x(t[n])\, e^{ -i 2 \pi f t[0]}\, e^{ -i 2 \pi f n/f_s}
% = e^{ -i 2 \pi f t[0]}\, \sum_{n=0}^{N-1} x(t[n])\, e^{ -i 2 \pi k n}
= e^ { -i 2 \pi f t[0]} \sum _ { n=0} ^ { N-1} x(t[n])\, \cdot e^ { -i 2 \pi \frac { k n} { N} }
2023-06-19 23:43:47 +02:00
.
2023-05-24 22:28:17 +02:00
\end { equation*}
2023-06-19 23:43:47 +02:00
The direct computation of this transform takes $ 2 N $ complex multiplications and $ 2 ( N - 1 ) $ complex additions for a single frequency $ k $ .
When computing this transform for all integer $ 0 \leq k < N $ , this amounts to $ \mathcal { O } ( N ^ 2 ) $ complex computations.
2023-06-26 11:04:16 +02:00
\acrlong { FFT} s (\acrshort { FFT} s) are efficient algorithms that derive all $ X ( 0 \leq k < N ) $ in $ \mathcal { O } ( N \log N ) $ calculations.
2023-05-24 22:28:17 +02:00
\begin { figure}
2023-09-08 16:59:19 +02:00
\begin { subfigure} { 0.49\textwidth }
\includegraphics [width=\textwidth] { methods/fourier/waveforms.pdf} %
2023-06-26 11:04:16 +02:00
%\caption{}
\end { subfigure}
\hfill
2023-09-08 16:59:19 +02:00
\begin { subfigure} { 0.49\textwidth }
\includegraphics [width=\textwidth] { methods/fourier/spectrum.pdf} %
2023-06-26 11:04:16 +02:00
\label { fig:fourier:dtft_ dft}
%\caption{}
\end { subfigure}
2023-05-24 22:28:17 +02:00
\caption {
2023-08-22 13:02:05 +02:00
\textit { Left:} A waveform sampling a sine wave with white noise.
\textit { Right:}
2023-06-26 11:04:16 +02:00
The frequency spectrum of the waveform.
Comparison of the \gls { DTFT} and \gls { DFT} of the same waveform.
The \gls { DFT} can be interpreted as sampling the \gls { DTFT} at integer multiple of the waveform's sampling rate $ f _ s $ .
2023-05-24 22:28:17 +02:00
}
2023-08-22 13:02:05 +02:00
\label { fig:fourier}
2023-05-24 22:28:17 +02:00
\end { figure}
2023-08-22 13:02:05 +02:00
2023-05-24 22:28:17 +02:00
% Linearity fourier for real/imag
2023-06-19 23:43:47 +02:00
In the previous equations, the resultant quantity $ X ( f ) $ is a complex amplitude.
2023-05-24 22:28:17 +02:00
Since a complex plane wave can be linearly decomposed as
\begin { equation*}
\phantom { ,}
\label { eq:complex_ wave_ decomposition}
\begin { aligned}
e^ { -i x}
&
= \cos (x) + i\sin (-x)
%\\ &
= \Re \left (e^ { -i x} \right ) + i \Im \left ( e^ { -i x} \right )
,
\end { aligned}
\end { equation*}
the above transforms can be decomposed into explicit real and imaginary parts aswell,
i.e.,~\eqref { eq:fourier:dtft} becomes
\begin { equation}
\phantom { .}
\label { eq:fourier:dtft_ decomposed}
\begin { aligned}
X(f)
&
= X_ R(f) + i X_ I(f)
%\\ &
\equiv \Re (X(f)) + i \Im (X(f))
\\ &
2023-06-26 11:04:16 +02:00
= \sum _ { n=0} ^ { N-1} \, x(t[n]) \, \cos ( 2\pi f t[n] )
- i \sum _ { n=0} ^ { N-1} \, x(t[n]) \, \sin ( 2\pi f t[n] )
2023-05-24 22:28:17 +02:00
.
\end { aligned}
\end { equation}
% FT term to phase and magnitude
The normalised amplitude at a given frequency $ A ( f ) $ is calculated from \eqref { eq:fourier:dtft} as
\begin { equation}
\label { eq:complex_ magnitude}
\phantom { .}
2023-06-19 23:43:47 +02:00
A(f)
\equiv \frac { 2 \left | X(f) \right | } { N}
= \frac { 2 \sqrt { X_ R(f)^ 2 + X_ I(f)^ 2 } } { N}
2023-05-24 22:28:17 +02:00
.
\end { equation}
Likewise, the complex phase at a given frequency $ \pTrue ( f ) $ is obtained by
\begin { equation}
\label { eq:complex_ phase}
\phantom { .}
2023-06-19 23:43:47 +02:00
\pTrue (f)
\equiv \arg ( X(f) )
= \arctantwo \left ( X_ I(f), X_ R(f) \right )
2023-05-24 22:28:17 +02:00
.
\end { equation}
\\
% Recover A\cos(2\pi t[n] f + \phi) using above definitions
2023-06-26 11:04:16 +02:00
Applying \eqref { eq:fourier:dtft_ decomposed} to a signal $ x ( t ) = A \cos ( 2 \pi t f + \pTrue ) $ with the above definitions obtains
2023-05-24 22:28:17 +02:00
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.
2023-09-08 16:59:19 +02:00
\\
Figure~\ref { fig:fourier} shows the frequency spectrum of a simulated waveform that is obtained using either a \gls { DFT} or a \gls { DTFT} .
It shows that the \gls { DFT} evaluates the \gls { DTFT} only at certain frequencies.
By missing the correct frequency bin for the sine wave, it estimates a too low amplitude for the sine wave.
\\
2023-05-24 22:28:17 +02:00
2023-06-19 23:43:47 +02:00
% % Static sin/cos terms if f_s, f and N static ..
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 $ upto an overall phase which is dependent on $ t [ 0 ] $ .
2023-09-08 16:59:19 +02:00
Therefore, at the cost of an increased memory allocation, these terms can be precomputed, reducing the number of real multiplications to $ 2 N + 1 $ .
2023-06-19 23:43:47 +02:00
% .. 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,
2023-09-08 16:59:19 +02:00
opening the way to efficiently measuring the phases in realtime.
2023-06-19 23:43:47 +02:00
2023-05-24 22:28:17 +02:00
% >>>>
2023-06-19 23:43:47 +02:00
\section { Cross-Correlation} % <<<<
\label { sec:correlation}
The cross-correlation is a measure of how similar two waveforms $ u ( t ) $ and $ v ( t ) $ are.
2023-06-26 11:04:16 +02:00
By introducing a time delay $ \tau $ in one of the waveforms it turns into a function of this time delay.
2023-06-19 23:43:47 +02:00
It is defined as
\begin { equation}
\label { eq:correlation_ cont}
\phantom { ,}
\Corr (\tau ; u, v) = \int _ { -\infty } ^ { \infty } \dif t \, u(t)\, v^ *(t-\tau )
,
\end { equation}
where the integral reduces to a sum for a finite amount of samples in either $ u ( t ) $ or $ v ( t ) $ .
Still, $ \tau $ remains a continuous variable.
\\
2023-09-08 16:59:19 +02:00
% Figure example of correlation and argmax
Figure~\ref { fig:correlation} illustrates how the best time delay $ \tau $ between two waveforms can thus be found by finding the maximum cross-correlation.
\\
2023-06-19 23:43:47 +02:00
% Discrete \tau because of sampling
In reality, both waveforms have a finite size, also reducing the time delay $ \tau $ resolution to the highest sampling rate of the two waveforms.
2023-06-26 11:04:16 +02:00
When the sampling rates are equal, the time delay variable is effectively shifting one waveform by a number of samples.
\\
% Upsampling? No
Techniques such as upsampling or interpolation can be used to effectively change the sampling rate of a waveform up to a certain degree.
2023-09-08 16:59:19 +02:00
However, for the purposes in this document, these methods are not used.
2023-06-19 23:43:47 +02:00
\\
2023-06-26 11:04:16 +02:00
% Approaching analog \tau; or zero-stuffing
Since zero-valued samples do not contribute to the integral of \eqref { eq:correlation_ cont} , they can be freely added (or ignored) to a waveform when performing the calculations.
This means two waveforms of different sampling rates can be correlated when the sampling rates are integer multiples of each other, simply by zero-stuffing the slowly sampled waveform.
2023-09-08 16:59:19 +02:00
This allows to approximate an analog time delay between two waveforms when one waveform is sampled at a very high rate as compared to the other.
2023-06-19 23:43:47 +02:00
\begin { figure}
2023-06-26 11:04:16 +02:00
\centering
2023-06-19 23:43:47 +02:00
\begin { subfigure} { 0.45\textwidth }
2023-06-26 11:04:16 +02:00
\includegraphics [width=\textwidth] { methods/correlation/waveforms.pdf}
%\caption{
% Two waveforms.
%}%
\label { subfig:correlation:waveforms}
2023-06-19 23:43:47 +02:00
\end { subfigure}
\hfill
\begin { subfigure} { 0.45\textwidth }
2023-06-26 11:04:16 +02:00
\includegraphics [width=\textwidth] { methods/correlation/correlation.pdf}
%\caption{
% The correlation of two Waveforms as a function of time.
%}%
\label { subfig:correlation}
\end { subfigure} %
2023-06-19 23:43:47 +02:00
\caption {
2023-09-08 16:59:19 +02:00
\textit { Left:} Two waveforms to be correlated with the second waveform delayed by $ 5 $ .
2023-08-22 13:02:05 +02:00
\textit { Right:} The correlation of both waveforms as a function of the time delay $ \tau $ .
2023-06-26 11:04:16 +02:00
Here the best time delay (red dashed line) is found at $ 5 $ , which would align the maximum amplitudes of both waveforms in the left pane.
2023-06-19 23:43:47 +02:00
}
\label { fig:correlation}
\end { figure}
2023-05-24 22:28:17 +02:00
% >>>
2023-05-24 16:53:56 +02:00
\end { document}