## 3 Theoretical Background and Method
### The Algorithm Switching Orthogonalization Procedure (ASOP) Method  
As explained in Section 1, the GSOP depends on the ordering of the initially selected reference vector; if the initially selected vector is of poor quality, then the new vector that is orthogonal to it is of low quality too. Similarly, though the Lowdin orthogonalization algorithm and ellipse-correction method exhibit symmetry and resemblance properties, the new orthogonal vectors may be of low quality if one of the initial IQ signals is of high quality or perfect. Here, we put forward an ASOP scheme according to the quality of the in-phase and quadrature signals based on the Q value of the eye diagram, and the definition of the Q value refers to Equation (7). If the quality of the in-phase signal is better than that of the quadrature signal, we use the GSOP; meanwhile, if the in-phase signal is regarded as the initial reference vector, then we make the other quadrature signal orthogonal to it and vice versa, as shown in Figure 3a,b. If there is not much difference in quality between the IQ signals, such as 10%, for which we use an empirical value that of course can be adjusted  
Figure 2: Visual representation of the (**a**) Gram–[PERSON] orthogonalization procedure (GSOP), (**b**) Löwdin symmetric orthogonalization procedure (SYOP) and (**c**) ellipse-correction (EC). according to the actual effect, we use the SYOP, as shown in Figure 3c. The procedure of ASOP is depicted in Figure 4. It is well to be reminded that the procedure of ASOP is a forward process, does not need feedback, and does this process at the time of system initialization, such that this technique can be implemented with reasonable complexity. The criterion for judging the quality of the IQ signal is based on the \(Q\) value of the eye diagram and is defined as  
\[Q=\frac{\mu_{1}-\mu_{0}}{\sigma_{1}+\sigma_{0}} \tag{7}\]  
where \(\mu_{1}\), \(\mu_{0}\), and \(\sigma_{1}\), \(\sigma_{0}\) are the mean values and standard variance of one and zero levels at the specified sample time. Traditionally, the Q factor metric is well established for on-off keying (OOK) optical systems. A large Q leads to a small bit error rate (BER) [20]. Unfortunately, this metric cannot be simply transferred to QAM signals, where the optical carrier is modulated with multilevel signals both in amplitude and phase. However, for the QPSK modulation scheme, the output amplitudes are \(+1\) or \(-1\) for each of the I or Q branches, so we can calculate the Q factor for the I and Q branches based on the samples of them independently, and the clock recovery is assumed ideal. As shown in Figure 5, the IQ imbalance can lead to an increase in the standard variance of the one and zero levels (\(\sigma_{1}\), \(\sigma_{0}\)) of the received signal eye diagram and then affect the Q factor of the eye diagram, according to Equation (7). Therefore, the value of the Q factor can be used to characterize the IQ imbalance of the signal. Figure 4: Flow chart of the algorithm switching orthogonalization procedure (ASOP) algorithm. Figure 3: (**a**) Using the in-phase signal as a reference; (**b**) using the quadrature signal as a reference (**c**); using symmetric orthogonalization. For the sake of simplicity, we only show the case that the quality of the in-phase signal is better than that of the quadrature signal. The eye diagram and constellation diagram are illustrated in Figure 5a-c. We can calculate the \(Q\) value based on the histogram statistics of Level 0 and Level 1 of the eye diagram. The histogram statistics of the in-phase and quadrature signals are shown in Figure 6. We use Gaussian fitting to calculate the mean and standard variance. As we see in Figure 6c,d, the histogram statistics of the quadrature signal is similar to the bimodal Gaussian distribution. For the convenience of comparison and calculation, we forced Gaussian fitting.