{'fraction_non_alphanumeric': 0.031185884283955682, 'fraction_numerical': 0.009191629052113254, 'mean_word_length': 4.597611391823611, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Advanced Signal Reconstruction in Tunka-Rex with Matched Filtering and Deep Learning

The Tunka Radio Extension (Tunka-Rex) is a digital antenna array operating in the frequency band of 30-80 MHz, measuring the radio emission of air-showers induced by ultra-high energy cosmic rays. Tunka-Rex is co-located with the TAIGA experiment in Siberia and consists of 63 antennas, 57 of them in a densely instrumented area of about 1km2. The signals from the air showers are short pulses, which have a duration of tens of nanoseconds and are recorded in traces of about 5{\mu}s length. The Tunka-Rex analysis of cosmic-ray events is based on the reconstruction of these signals, in particular, their positions in the traces and amplitudes. This reconstruction suffers at low signal-to-noise ratios, i.e. when the recorded traces are dominated by background. To lower the threshold of the detection and increase the efficiency, we apply advanced methods of signal reconstruction, namely matched filtering and deep neural networks with autoencoder architecture. In the present work we show the comparison between the signal reconstructions obtained with these techniques, and give an example of the first reconstruction of the Tunka-Rex signals obtained with a deep neural networks.


Introduction
Cosmic rays (CR) are high-energy charged particles with extra-terrestrial origin. The sources of ultra-high energy CR are still unknown due to complexity of tracing charged particles deflected by galactic and extragalactic magnetic fields. However, the energy spectrum and mass composition of CR can shed light on the most powerful cosmic accelerators. Due to low flux of ultra-high energy CR it is impossible to measure them directly (in space or higher layers of atmosphere), and they are detected by large ground detectors measuring cascades produced by their interaction with the atmosphere. These cascades, called air-showers, consist of many secondary particles, including electrons and positrons, which produce short radio pulses due to deflection in the Earth's magnetic field. These pulses have a broadband spectrum mostly in the MHz domain and a duration of tens of nanoseconds [1].
Tunka-Rex [2] is a sparse antenna array located at the TAIGA facility [3,4] in the Tunka valley (Eastern Siberia). It consists of 63 antennas measuring radio emission from air showers in the frequency band of 30-80 MHz. Since Tunka-Rex is placed in a relatively radio-quiet location, the main background is from the Galaxy and has a power law behavior with an index of ≈ −2.5. However, there are plenty of non-stationary background sources, which complicate the reconstruction of events with low energies and may distort the reconstruction of the signal. This background is caused by hardware RFI (especially after several upgrades of TAIGA facility) and by anthropogenic influence. A simple study of the background shows that the noise in the Tunka-Rex traces has distinguishable features and cannot be approximated as white noise (see Fig. (1)). In this work we discuss different approaches of signal reconstruction and background suppression, particularly a standard one used in many experiments and more sophisticated ones: matched filtering (MF) and autoencoder (AE). We discuss their performance and future applications.

Signal reconstruction
The air-shower pulse at each antenna station is measured in two independent channels and digitized in two traces of 1024 samples each with a rate of 200 MHz (i.e. binsize of 5 ns). For the reconstruction of cosmic-ray air showers the two main properties of radio pulses are used: the amplitude of the signal and its arrival time. Details of this reconstruction and its application to cosmic-ray science are given in Refs. [5,6]. In this paper we focus on the signal reconstruction itself and methods of its improvement.
Before the reconstruction of the signals we perform several preprocessing transformations. Spectra of the signals obtained with Fourier transform are cut by a digital bandpass to 35-80 MHz and filtered with a median filter, which removes narrow-band RFI and equalizes the noise using a sliding window of 3 MHz width. Then the traces are upsampled in order to increase the timing resolution by factors of 4, 16, and 64 for the standard method, AE, and MF, respectively. As last step, the electric field along the two polarization directions in the plane perpendicular to the shower axis are reconstructed, namely v × B (along the Lorentz force, where v is the direction of the air shower and B the direction of the geomagnetic field) and v × v × B perpendicular to it. Since the radio emission of air-showers is mostly in the v × B polarization we consider only this one hereafter.
The main quantity used for the definition of the threshold of signal reconstruction is the signal-to-noise ratio (SNR). The SNR is defined using the fol- lowing formula: where S is the amplitude of the peak of the signal envelope S = max(s(t)) inside of the signal window, a 200 ns window defined by the trigger time. The envelope s(t) is defined as where u(t) is the initial trace of the electric field at the antenna as a function of time t, and H denotes the Hilbert transformation.The noise level N is defined as RMS in the noise window. SNR th is defined as minimal RMS by sliding the noise window, a 500 ns window, scanning the trace in order to pass over occasional RFI. We also use the additional definition of neighborhood SN R neighb. for the cases of overlapping signal with RFI (when noise is inside the signal window) based on the estimation of the noise level around the signal (± 100 ns). Thus, to keep the ratio of false positive detection at the level of 5%, the thresholds are set as following: SNR th ≥ 16 and SNR neighb. ≥ 10.

Signal and background dataset for simulation study
In this study we use a dataset of 650 000 samples of measured background (2014-2017) recorded by Tunka-Rex and 25 000 CoREAS [7] simulations. The air-shower pulse is randomly located within the signal window, summed with noise and folded with the Tunka-Rex hardware response taking into account the geometry of the air shower and the calibration of the detector.  As was discussed in Ref. [6], the simulated signals reproduce real ones with satisfactory accuracy. As shown below, the methods developed for simulated pulses can be applied to the real data without additional tuning.

Matched filtering
MF is a widely used technique of extracting signal from noisy data based on the convolution of a signal template T with the time trace u(t): where A cc is the maximum of the convolution, which defines the peak of the filtered signal s cc [t]. MF is very effective for the detection of the signal position inside a trace contaminated significantly by white noise and can even detect signals with SNR 1. However, MF is unable to reconstruct the pulse shape and can only give an approximate estimation of the amplitude of initial signal.
For testing the filter we use a single template with a length of 60 ns obtained from averaging over many CoREAS simulations. The threshold of signal detection is set to √ A cc = 854 µV/m (see Fig. (2), left), allowing for a 5% probability of false positives (similar to our standard method [2]).

Autoencoder
The AE [8] is an unsupervised convolutional network used for learning the coded representation of the data and removing specific features from it. We train the AE in order to learn noise-related features and clean the input traces leaving cosmic-ray signals.  The encoder, the encoding part of the AE, distinguishes features of noise contained in the input data by applying a set of filters. The filters perform the convolution of characteristic noise-related features with the input data, estimate its contribution as a result of the convolution, and afterwards send it to the max-pooling layer. The max-pooling layer performs a discrete downsampling of the data and sends it to the next convolution layer with the next set of filters. With each layer of the encoder, the data becomes more abstract and reduced in size. The result of encoding is a map of features of the input data.
After encoding, noise-related features are removed and the map of denoised data proceeds to the next part of the AE, the decoder, which produces a reverse reconstruction and returns a data array of the same dimension as the input. In case of success, the resulting output is the denoised trace containing only the air-shower pulse.
We have explicitly selected a subsample with low amplitudes and low SNR for training to test the possibility of lowering the threshold. We implemented and trained our AE with Keras [9] and Tensorflow [10] in a uDocker container with GPU support.
We have tested several AE with different sizes defined by the depth (D) and number of filters per layer (N ), where the configuration of the i-th (i = 1, ..., D)   encoding layer is defined as follows: where S i is the size of the i-th filter, n i is the number of filters per layer; S min = 16 is the minimum size of a layer. To estimate the performance of the AE we use a cross-entropy loss function with the following metrics: efficiency N rec. /N tot. , the fraction of reconstructed events. This metric indicates how many non-zero traces are returned by the AE. However this metric alone is insufficient. To evaluate the performance of the AE one has to check also the purity. purity N hit /N rec. , the fraction of events with a peak position reconstructed within 5 ns from the true position. This metric indicates the true positive detections and filters misreconstructed signals. Fig. (3) shows a comparison chart of the different AE settings used. Although only a quarter of the testing sample is reconstructed (due to low SNR), the purity of the reconstruction is very high, i.e. the reconstruction of backgrounddominated signals is improved. Moreover, the performance of the AE increases with the complexity of the network and we plan to train more sophisticated AE with larger datasets (our present AE is limited by the relatively small training set). Examples of the reconstruction are given in Fig. (4).

Comparison of the methods
We have integrated both, the MF and AE algorithms, with the Auger Offline framework [11], used for the standard reconstruction of Tunka-Rex. This enables us to check the performance of MF and AE integrated in Tunka-Rex reconstruction pipeline, and to use the identical benchmark for comparison between the standard signal reconstruction, matched filtering, and denoising with the autoencoder. As metrics we selected the reconstruction of air-shower events (which requires the reconstruction of the signal at several antenna station per event), and the accuracy of the air-shower reconstruction. We performed this test on simulations using a small subset of the Tunka-Rex library. The results of the comparison in Fig. (5) show that both, MF and AE, are ready for the application to the reconstruction of real data. Moreover, the threshold is slightly lowered. With future improvements of MF (using a library of templates instead of a single one, and better whitening of the noise) and the AE (developing a more sophisticated network using a larger training dataset) we expect a further improvement of the reconstruction. At the moment we are working on the application of the AE on real Tunka-Rex data, an example is shown in Fig. (6).

Discussion and conclusion
The signal reconstruction in the Tunka-Rex experiment is continuously improved (see, for example, Refs. [12,13]). One of the most advanced method, namely deep learning, represented by the autoencoder technique is discussed in this work (it is worth noticing that a similar technique was recently used for a similar problem [14]). We have shown that the methods described in this paper are ready for the implementation for the reconstruction of real data, and we are currently working on this reconstruction. Besides the application of these methods to Tunka-Rex data we plan to apply them in a Tunka-Rex child engineering ex-periment, Tunka-21cm, for RFI tagging and denoising, and to the Tien-Shan array [15] recently upgraded with SALLA.