## 2 Setup and Methods
### FDDA Refinement  
When the MA-MD pre-processing stage was completed, it became necessary to use the refined version of the FDDA--the frequency domain dynamic averaging algorithm. Its previous implementation assumed that the moving window size was inversely proportional (linearly) to the normalized signal intensity. This led to the realization that, occasionally, some signal components could be mistakenly interpreted as noise and suppressed, and in other cases, on the contrary, some unwanted noise peaks could be identified as useful signals and amplified. It is obvious that the dependence of the moving window size on the signal magnitude needs to be made more sensitive. Considering the case in which the useful signal is represented by single-frequency components or their combinations, the signal in the spectrum can be divided into three groups according to the intensity normalized to 1:  
1. Intensities within \(I_{1}\) and \(I_{2}\) (assuming that \(I_{1}=0;I_{2}=0.2\)). This region contains the noise of the photodetector. If it is averaged with the maximal window size, then its influence is practically zeroed. However, this will lead to an increase in the number of mathematical operations and a decrease in the algorithm speed. It will also blur the boundaries of neighboring (possibly useful) components of the spectrum. Thus, for these intensity components, it is preferable to set the moving window size to about 80% of the maximal allowable one (\(w_{\max}\)). 2. Intensities within \(I_{2}\) and \(I_{3}\) (\(I_{2}=0.2;I_{3}=0.4\)). Another type of unwanted component may appear in this area: various phantom peaks. The practice of operating inexpensive laser sources has shown that they appear quite often. Sometimes they are electrical in nature and pass through the entire signal in time, frequency, or spatial domains. Since the proposed algorithm will operate in 2D mode, it may help to solve this problem. It is assumed reasonable to use the maximal window size for this intensity region. 3. Intensities within \(I_{3}\) and \(I_{4}\) (\(I_{3}=0.4;I_{4}=1\)). Obviously, this signal contains the main useful part. Such frequency components should not be smoothed across the spectrum, so the averaging window size should be minimal (ideally zero). It may seem that different types of noise can be combined into one category, but we have classified them as categories 2 and 3 intentionally. Our solution can be explained as follows. First, noises of different natures require different averaging window sizes. Therefore, this implies dividing the filter operation function into several areas. Secondly, the function should be able to adapt flexibly to various types of experimental data. More areas in a function provide more adjustment options. Of course, characterizing noises solely by their amplitude does not provide a complete description of them. To use this method, it is necessary to have some basic knowledge about the signal that the sensor sends out in each individual case. For example, if a high-quality, stabilized, coherent radiation source is being used, then the likelihood of phantom peaks is much lower. This means that Region2 of the activation function must be adjusted in such a way that additional peaks are not eliminated, but highlighted. Or if we receive a sensor signal from the first meters of the line, then the signal-to-noise ratio is quite high already in the raw data. This means that some perturbations in Region 1 should not be excluded from the data, since these may be low-intensity useful signals. Thus, the method of filtering noises by their intensity is not applicable to signals of unknown origin. In case shown above, these three areas are set stepwise, so the processed signal will be significantly distorted. It was discovered that the FDDA algorithm demonstrated earlier operates with a threshold filter (has an abrupt drop in the graph, showing the dependence of the window size on the intensity); therefore, the spectral components are significantly distorted in the region of their substructure.