## 4 Data Processing  
As described above, the main task of the signal processing procedure is the accurate extraction of the interferogram with the highest SNR. The signal processing consisted of several steps: (1) splitting the signal into individual sweeping scans; (2) splitting the signal into individual mode pulses; (3) normalizing the interference signal (\(I\)) measured at the MZI output in relation to the corresponding reference one (\(R\)) measured at the input; and (4) calculating the FFT. The averaging can be carried out after each of these steps depending on the task of the LUT characterization. We now consider different averaging approaches and their effects on the final result. As described above, the main task of the signal processing procedure is the accurate extraction of the interferogram with the highest SNR. The signal processing consisted of several steps: (1) \"Single scan selection\", which involved splitting the signal into individual sweeping scans; (2) \"Mode pulse separation\", which involved splitting the signal into individual mode pulses; (3) \"Normalization\", which involved normalizing the interference signal (\(I\)) measured at the MZI output in relation to the corresponding reference one (\(R\)) measured at the input; and (4) \"FFT calculation\", which involved calculating fast Fourier transform (FFT) or short-time Fourier transform (STFT). The averaging can be carried out after each of these steps depending on the task of the LUT characterization. We then consider different averaging approaches and their effects on the final result. Different analysis algorithms are summarized for convenience in the way of a flow diagram, as shown in Figure 6.  
The first step in the processing algorithm was the selection of the signal interval corresponding to only one frequency scan for further analysis. The scan selection technique was based on the fact that the average laser output power slightly decreases from the beginning to the end of each scan. In the case of the laser used in our study, a single scan consists of 300-500 single-frequency mode pulses, which are separated using a frequency tuning step of \(\delta v\) = 9.7 MHz in frequency domain. It is important to note that the pulse duration fluctuations do not affect the value of the frequency tuning step. All further signal processing is performed for only one scan. In this case, the optical frequency depends linearly on the pulse number a priori, since all the frequency hops during a single scan have the same direction and equal values. A confirmation of this fact was demonstrated in a previously published paper [20], where a detailed study of the mode dynamics of  
Figure 5: Experimental setup. Insets illustrate characteristic signals at input (**left**) and output (**right**) of MZI. this particular Er-doped self-sweeping laser was carried out using optical homo- and hetero-dyning analysis. At the second step, the separation of the MZI output and reference signals into sections corresponding to different mode pulses is performed. For this purpose, all intensity bursts are found. Furthermore, all points associated with transitions between mode pulses (areas highlighted in red in Figure 7) are removed from consideration. The reference signal is used to find the bursts because the average level of the reference signal remains practically unchanged during the frequency tuning (in contrast to the MZI output one), simplifying detection of the intensity bursts. As a result of this separation, we construct two vectors of pulse amplitudes (\(R_{i,j}\) and \(I_{i,j}\)) for length \(J\) for every \(i\)-th pulse that has fixed optical frequency. Here, index \(j\) denotes the number of the \(j\)-th element in the \(i\)-th vector. The pulse length \(J\) varies from pulse to pulse due to small (\(\sim\)20%) fluctuations in their duration. Figure 6: Flow diagram for algorithms used in Sections 4.1–4.3. Figure 7: Illustration of processing procedure: (**a**) reference signal (\(R\)); (**b**) MZI output signal (\(I\)).