## 4 Simulation Results and Discussion
### Impact of Input Noise  
Next, we consider the impact of input noise on the proposed system. To emulate the actual input signal, variable white Gaussian noise (WGN) is introduced following the generation of BPSK data, which simulates the input BPSK signal under varying optical signal-to-noise ratios (OSNRs). The output results are evaluated when recognizing 4-bit bit-flip BPSK targets in the input signal with frequencies of 192.8 THz and 193.4 THz, respectively. The input data and the target are identical to those in Section 4.1. The seed of WGN remains consistent, while only the power spectral density of WGN is changed when varying the OSNR values of the input signal. Figure 9 shows the simulation results when the OSNR of the input signal with frequencies of 192.8 THz and 193.4 THz varies from 30 dB to 4 dB. When the input OSNR is 30 dB, which means the input signal and transmission environment are relatively perfect, there is no obvious difference between the final outputs and the results in Figure 6. As the input OSNR decreases, the output quality gradually deteriorates because the power of logic \"0\" increases, while the power of logic \"1\" decreases. When the input OSNR is 4 dB, it can be noticed that the maximum power value of logic \"0\" is almost the same as the minimum power value of logic \"1\" in both Figure 9a,b, which will lead to errors. To further quantify the output performance under different input OSNR values, we evaluate the metrics of extinction ratio (ER), contrast ratio (CR), Q factor, bit error rate (BER), amplitude modulation (AM), and signal-to-noise ratio (SNR). The definitions of ER, CR, Q factor, BER, AM, and SNR are shown in Equations (11)-(16) [26; 27], where \(P_{\min}^{1}\) represents the minimum power value of logic \"1\"; \(P_{\max}^{0}\) represents the maximum power value of logic \"0\"; and \(P_{\min}^{1}\) (\(P_{\max}^{0}\)) and \(\sigma_{1}\) (\(\sigma_{0}\)) represent, respectively, the mean power values and standard deviation of the power values at logic \"1\" (logic \"0\") state. \[ER(dB)=10\log\left(\frac{P_{\min}^{1}}{P_{\max}^{0}}\right) \tag{11}\]  
\[CR(dB)=10\log\left(\frac{P_{\min}^{1}}{P_{\max}^{0}}\right) \tag{12}\]  
Figure 9: Simulation results when OSNR of the input signal with frequencies of (**a**) 192.8 THz and (**b**) 193.4 THz varies from 30 dB to 4 dB. \[Q=\frac{P_{mean}^{1}-P_{mean}^{0}}{\sigma_{1}+\sigma_{0}} \tag{13}\]  
\[BER=\frac{1}{2}erfc\bigg{(}\frac{Q}{\sqrt{2}}\bigg{)} \tag{14}\]  
\[AM(dB)=10\log\bigg{(}\frac{P_{\max}^{1}}{P_{\min}^{1}}\bigg{)} \tag{15}\]  
\[SNR=\bigg{(}\frac{P_{mean}^{1}}{\sigma_{1}}\bigg{)}^{2} \tag{16}\]  
Equation (11) quantifies the power difference between minimum logic \"1\" (\(P_{\min}^{1}\)) and maximum logic \"0\" (\(P_{\max}^{0}\)). Equation (12) measures the mean power ratio between logic \"1\" and logic \"0\". Equation (13) measures the quality of the output signal, which is closely related to BER. Equation (14) provides the error probability in signal transmission. Equation (15) reflects the dynamic range of the power level of logic \"1\". Equation (16) measures the ratio of output signal power to noise power. Equations (11)-(16) are used to evaluate the quality of the output signal, which is important for guiding system optimization. The larger the ER, CR, Q factor, and SNR, the smaller the BER, indicating better logical discrimination at the receiver; otherwise, it indicates a higher probability of errors. To eliminate the impact of different sequences on output performance, the phase of the input BPSK signal is {\(\pi\), 0, \(\pi\), 0, \(\pi\), 0, 0, 0, \(\pi\), 0, \(\pi\), 0, \(\pi\), 0, 0, \(\pi\), \(\pi\)} for both frequencies with a transmission rate of 100 Gbps, while the 4-bit bit-flip BPSK targets are set to [\(\pi\), 0, \(\pi\), \(\pi\)] and [0, \(\pi\), 0, 0] for both frequencies. Furthermore, to obtain good statistical confidence in the results, the seed of the WGN is changed 10 times for each input OSNR under identical noise power density and noise bandwidth, and we take the average of the results.