## 4 System Performance Analysis and Discussions  
In this section, we analyze the OCDMA system with the proposed RIC scheme, considering the effect of PINN and thermal noise. The main purpose is to quantify the improvement of system bit-rate benefiting from noise suppression. When a quantizer compares the photocurrent to its midrange threshold, an error may occur due to the signal variance. To calculate BER, we derive mathematical expressions for the mean and variance of the output signal at the balanced detector. We denote the signal mean as the photocurrent and the signal variance as the summation of thermal noise and PINN. As the number of active users in a general OCDMA network is sufficiently large, the noise terms are approximate to the Gaussian distribution [31]. BER is evaluated by calculating the signal-to-noise ratio (SNR) and using the complementary error function. For simplicity without losing the generality, we firstly investigate the unit-stage scheme with a single balanced detector. For a practical BLS, there are oscillations on the PSD, which increase the complexity of system analysis. Therefore, we make several assumptions on the BLS properties. First, the BLS amplitude is constant over its bandwidth. Second, the power of the multiplexed signal detected by each user at the receiving end is the same. Finally, the optical pulses transmitted by each user are synchronized. The data bits \(d_{i}\) of the interference/nonactive/active users can be determined from the photocurrent \(I_{i}\) shown at the output of the balanced detector. For \(d_{i}=1\), \(I_{i}\) has previously been defined in Equation (5). When optical-to-electrical conversion is performed, the photocurrent variances are generated from the spontaneous emission of optical signals and the square-law detection of photodetectors. The signal variance \(\left\langle i^{2}\right\rangle\) is written as follows:  
\[\left\langle i^{2}\right\rangle=\left\langle i_{\mathrm{T}}^{2}\right\rangle+ \left\langle i_{\mathrm{P}}^{2}(k)\right\rangle \tag{6}\]  
where \(\left\langle i_{\mathrm{T}}^{2}\right\rangle\) denotes the variance of thermal noise; PINN variance, which is a function of active user number \(k\), is denoted as \(\left\langle i_{\mathrm{P}}^{2}(k)\right\rangle\). According to the definitions in Reference [25], these two noise terms are expressed as Equations (7) and (8):  
\[\left\langle i_{\mathrm{T}}^{2}\right\rangle=S_{\mathrm{TH}}B, \tag{7}\]  
\[\left\langle i_{\mathrm{P}}^{2}(k)\right\rangle=\frac{R^{2}P_{\mathrm{L}}^{2}B }{Nv}(\mathbf{R}_{i}\otimes\mathbf{R}_{i})=\frac{R^{2}P_{\mathrm{L}}^{2}Bk(k+ 1)(N+1)}{4 Nv}, \tag{8}\]  
where \(S_{\mathrm{TH}}\) is the PSD of thermal noise, \(B\) is the noise-equivalent electrical bandwidth of the receiver, and \(v\) is the encoded optical bandwidth. The symbol of \(\otimes\) is denoted as the Kronecker product between two vectors [32]. From Equations (5), (7), and (8), we can get the average SNR, which is shown as follows:  
\[SNR(k)=\frac{I^{2}}{\left\langle i_{\mathrm{T}}^{2}\right\rangle+\left\langle i _{\mathrm{P}}^{2}(k)\right\rangle}. \tag{9}\]  
Note that when \(d_{i}=1\), \(I_{i}=I\) for all \(i\). Using Gaussian approximation, the BER for a single-stage receiver with \(k\) active users, \(BER(k)\), can be expressed as:  
\[BER(k)=\frac{1}{2}\mathrm{erfc}\Bigg{[}\sqrt{\frac{SNR\ (k)}{4}}\Bigg{]}. \tag{10}\]  
The primary difference between the unit-stage receiver and the proposed multistage receiver is the number of the received interference signals. Ideally, the conventional balanced detector receives \(K-1\) interferences and one target signal, while the proposed scheme only receives the target one. However, in practical decoding, the noises lead the detector to misjudge interference bit \"1s\" as bit \"0s\". The MUI cancellation is not executed in these stages, and less than \(K-1\) interferences are removedfrom the received signal.