## 4 Analysis and Simulation
### Noise Suppression
The second-order noise-suppression structure replaces the cascaded AND gates originally used to suppress mismatching noise, reducing the use of amplifiers while achieving better performance. In addition, an AND gate implemented based on the XPM effect [35] replaces the original AND gate in the recirculating loop. The output of the new AND gate is at the same frequency as that of its inputs; thus, a regenerator for wavelength conversion is not required. Figure 10: Simulated power transfer curve of the second-order noise-suppression structure. Figure 9: Simulation diagram of the second-order noise-suppression structure. The optimized QPSK-oriented all-optical matching system uses only two EDFAs, which are five fewer than those of the original system, thereby significantly reducing the impact of amplifier noise. Figure 12 shows the effect of noise suppression on the performance of the all-optical matching system. The system optimized using the proposed noise-suppression structure is hereafter referred to as the optimized system. Figure 12a shows the simulation results of the original system under an ideal scenario, and Figure 12b,c show the simulation results of the original and optimized systems, respectively, with an input OSNR of 6 dB and EDFA NF of 4 dB. Without noise suppression, the original system under a noise scenario could not output correctly matching results. In Frame 8, the power level at the 10 th symbol, where a high-power optical pulse was supposed to manifest, was unexpectedly low. The erroneous 15 th symbol appeared with a pulse power that surpassed even the judgment threshold of 4.8 mW. In contrast, the optimized system output correctly matching results. In the simulation, the power of \"1\" in the 8 frames of matching signals was stable at 6 mW, and there was no situation below the judgment threshold or too high, whereas the power of \"0\" was close to 0, and the entire system exhibited good stability. To further investigate the performance of the optimized system, we maintained the NF of the EDFAs in the system at 4 dB and introduced 10 distinct noise seeds at each node, increasing the input OSNR by 2 dB per node. After averaging the simulation data obtained from each node, we plotted the ER versus input OSNR and CR versus input OSNR curves. Figure 13 compares the relationship between the quality of the output signal and the input OSNR for the original and optimized systems. Under both input and amplifier noise, the signal quality of the optimized system was significantly improved compared with that of the original system. The ER and CR values remained above 150 and 160 dB, respectively. For the original system, with an input noise of 6 dB, the ER value decreased below 0, indicating that the system output an incorrect signal. However, for the optimized system, even when the input OSNR was 0 dB, the ER value was 154.9532 dB, and the CR value was 166.94289 dB. Figure 11: All-optical matching system optimized using a noise-suppression structure. Conversely, we also evaluated the output of the systems using the Q factor and log \(BER\), calculated using Equations (13) and (14), respectively. The results are listed in Table 2. The Q factor of the optimized system remained above 160 dB, and the log \(BER\) tended toward negative infinity. These results indicate that the optimized system possesses high noise resistance and stability. The BER derived from Equation (14) served as a reference point for evaluation. Simulating the actual BER necessitates a significantly large dataset, which is beyond the scope of this study. Figure 12: Comparison of the simulation results of the all-optical matching systems: (**a**) original system under an ideal scenario; (**b**) original system with input OSNR of 6 dB and NF of EDFAs of 4 dB; (**c**) optimized system with input OSNR of 6 dB and NF of EDFAs of 4 dB. Figure 13: Signal quality versus input OSNR curves for the optimized system: (**a**) ER vs. input OSNR, (**b**) CR vs. input OSNR.