The SparSpec algorithm and the application to the detection of spatial periodicities in tokamaks: using memory with relaxation**[Note: This work is partially based on a 4th year bachelor project by one of the authors (LMP), performed while being a student at the SPC-EPFL under the supervision of the corresponding author (DTA)]. (28th April 2021) - Testa, D; Carfantan, H; Perrone, L M
Abstract: A common problem in many complex physical systems is the determination of pulsation modes from irregularly sampled time-series, and there is a wealth of signal processing techniques that are being applied to post-pulse and real-time data analysis in such complex systems. The aim of this report is studying the problem of detecting in real-time spatial periodicities in the spectrum of magnetic fluctuations in tokamaks, for which optimization of the algorithm run-time is essential. The main tool used hereafter will be the SparSpec algorithm, initially devised for astrophysical purposes and already applied to the analysis of magnetic fluctuation data in various tokamaks, both currently or previously operating (JET, TCV, Alcator C-mod) and under construction (ITER, DTT). For JET, the baseline version of the SparSpec algorithm, dubbed SS-H2, already regularly runs in real-time on a 1 ms clock for detecting Toroidal Alfvén Eigenmodes using synchronously-detected magnetic perturbation. It was noted that the solution is only slowly changing in time as the background plasma typically also slowly evolves. Therefore, as a specifically real-time acceleration tool, we will focus on the use of a memory with relaxation scheme, whereby solutions obtained at previous time points are used to provide weighted input constraints for the solution at the current time point. Use of the measurement uncertainties to weight the data, the spectral window and the ensuing penalization criterion (dubbed the SS-V5 ν 0 algorithm) is reported in a companion work. The behaviour of the SparSpec algorithm under a variety of simulated circumstances, and one actual test case from the JET tokamak, is analysed and appropriate conditions for the convergence of the memory-penalised solutions are derived. The tuning of the input parameters is discussed based on the results of our simulations. It is found that the implementation of SparSpec using such a memory with relaxation scheme is quite a complex procedure, and only when correctly optimized the results are superior, both in terms of the speed and the accuracy of the calculations, to those obtained with the SS-H2 and SS-V5 ν 0 versions of the SparSpec algorithm.