## 2 Proposed Algorithm: DBSCAN-Based MFI and OSNR Estimation
### Model of MFI and OSNR Estimation Based on DBSCAN Algorithm  
The DSP configuration of the proposed joint algorithm is shown in Figure 1. After chromatic dispersion (CD) compensation, timing recovery, normalization, constant modulus algorithm (CMA)-based equalization, and frequency-offset (FO) compensation for compensating nearly all linear transmission impairments, signals are mainly affected by amplified spontaneous emission (ASE) noise [29; 43; 44]. The proposed DBSCAN-based joint algorithm can extract MF and OSNR information which are used in subsequent DSP blocks such as symbol decision, decoding and signal quality characterization.  
Constellation diagrams of different MFs have their own unique distribution characteristics; thus, commonly used signal types can be distinguished by countering the number of clusters. The DBSCAN does not need to know the number of clusters in advance and has an unparalleled advantage for identifying non-convex sample sets, making the DBSCAN algorithm more suitable for processing the non-spherical constellation points and irregular noise distribution due to the influence of the laser linewidth than other clustering algorithms.  
Figure 2 shows the clustering results for five simulated MFs using DBSCAN algorithm (\(\varepsilon=0.09\) and \(Min\)Pts = 25) when the OSNR values equal to their respective 7% FEC thresholds (QPSK: 12 dB, 8 PSK: 15 dB, 16 QAM: 18 dB, 32 QAM: 22 dB, 64 QAM: 24 dB). The laser linewidth is 100 kHz. The clustering results are 4, 8, 16, 32 and 36 for QPSK, 8 PSK, 16 QAM, 32 QAM and 64 QAM signals respectively. We can  
Figure 1: DSP model of MFI and OSNR estimation based on DBSCAN algorithm.  
see that for QPSK, 8 PSK, and 16 QAM signals, the DBSCAN algorithm can correctly obtain the number of clusters. Due to the small Euclidean distance and vulnerability to noise, the cluster number of 32 QAM and 64 QAM is approximate. For these two signals, we use the MF index to distinguish two MFs which defined as \(\gamma=\frac{N}{R}\), where \(N\) is cluster number and \(R\) is defined by Equation (1).  
As OSNR increases, the effect of ASE noise on the signal decreases, leading to the constellation points better concentrated than lower OSNR conditions. According to the introduction of DBSCAN algorithm, the neighborhood parameters (\(\varepsilon\)and _MinPts_) set a density threshold on symbols. The core points are the symbols which are reaching the density threshold. If the symbols are getting better concentrated, the number of core points apparently increases leading the \(R\) value increases. So parameter \(R\) defined by Equation (1) is positively correlated to OSNR for five MFs and is showed in Figure 3.  
In our proposed method, the DBSCAN algorithm calculates the \(R\) values corresponding to different OSNR. In order to make the fitting polynomial have the generalization ability to the multi-pattern signals without overfitting, we choose fourth-order polynomial. After fitting the fourth-order polynomial of  
Figure 3: The value of \(R\) varies with different OSNR under five MFs.  
Figure 2: Clustering results for five MFs. (**a**) QPSK; (**b**) 8 PSK; (**c**) 16 QAM; (**d**) 32 QAM; (**e**) 64 QAM.  
values and referenced OSNR values, we can estimate the corresponding OSNR from a known \(R\) with the fitted polynomial. The fitted fourth-order polynomial can be expressed as:  
\[f_{4}(x,w)=w_{0}+w_{1}x+w_{2}x^{2}+w_{3}x^{3}+w_{4}x^{4}=\sum_{j=0}^{4}w_{j}x^{j} \tag{2}\]  
Figure 4 shows fitted curve and \(R\) value of five other different QPSK signal patterns by changing the pseudo-random binary sequence (PRBS) random seed in arbitrary waveform generator (AWG), proving that the \(R\) value does not depend on the randomness of the signal patterns and the fitted polynomial can accurately estimate the real OSNR.