## 3 Simulation Setup and Results
### Performance of The Proposed Bi-OCDMA
The signature codes used in this simulation are listed in \[\sigma_{th}^{2}=\frac{4.k_{B}.T}{R_{L}}.ENB\]1  
Figures 10 and 11 show the performance of the proposed Bi-OCDMA system with four different codes under intense rainy and stormy weather conditions for the AWGN channel. The simulation results illustrate that the Walsh-Hadamard code achieved the best performance, followed by the modified M-sequence code, MQC code, and MD code. All codes had a higher impact in the stormy weather. Under intense rainy conditions, the modified M-sequence code exhibited the worst performance degradation with increasing FSO range, whereas in stormy conditions, the Walsh-Hadamard code suffered the worst performance deterioration. However, the Walsh-Hadamard code still achieved superior performance beyond a 500 m FSO range because this code had the best performance in the proposed Bi-OCDMA scheme. In stormy conditions, beyond 430 m, the modified \begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline
**Code** & \multicolumn{8}{c}{**Signature Code**} \\ \hline MD & \multicolumn{8}{c}{\(\left[\begin{array}{ccccccccc}1&0&0&0&0&0&0&1\\ 0&1&0&0&0&0&1&0\end{array}\right]\)} \\ \hline MQC & \(\left[\begin{array}{ccccccccc}1&0&0&0&1&0&0&1&0&0&0&0&1\\ 0&1&0&0&0&1&0&0&1&0&0&1\end{array}\right]\) \\ \hline Modified M-Sequence & \multicolumn{8}{c}{\(\left[\begin{array}{ccccccccc}1&0&1&1&1&0&0&0\\ 1&1&1&0&0&1&0&0\end{array}\right]\)} \\ \hline Walsh-Hadamard & \multicolumn{8}{c}{\(\left[\begin{array}{ccccccccc}1&0&1&0&1&0&1&0\\ 1&1&0&0&1&1&0&0\end{array}\right]\)} \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Signature codes for two users. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Weather Conditions** & **Precipitation** & **Visibility (m)** & **Attenuation (dB/km)** \\ \hline Light fog & Stormy & 770 & 18.3 \\ \hline Very light fog & Intense rainy & 1900 & 6.9 \\ \hline Light mist & Average rain & 2800 & 4.6 \\ \hline Very light mist & Light rain & 5900 & 2 \\ \hline Clean air & Drizzle & 18,100 & 0.6 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: International visibility code [38]. M-sequence code worsened more than the MQC code, and beyond 500 m, it suffered the worst performance. The simulation results of the performance degradation for extreme weather conditions in the AWGN channel are displayed in Table 5.  
Figure 11: Performance of the system in stormy weather for the AWGN channel: (**a**) min. log of BER; (**b**) max. Q-factor. Figure 10: Performance of the system in intense rainy weather for the AWGN channel: (**a**) min. log of BER; (**b**) max. Q-factor. In addition to the AWGN effects, the next simulation included turbulence-induced fading of the channel with medium turbulence conditions based on Equation (24). Simulations were also performed for extreme weather conditions, as shown in Table 3. Figures 12 and 13 demonstrate the minimum log of BER and maximum Q-factor achieved by each code in intense rainy and stormy weather conditions for the AWGN and turbulence-induced fading channel. The simulation results show that the Walsh-Hadamard code has superior performance, followed by the modified M-sequence code, MQC code, and MD code. The MD code still had the lowest performance deterioration compared to the other codes under these two weather conditions. The highest performance degradation under intense rainy conditions was suffered by the modified M-sequence code, whereas in stormy conditions, the Walsh-Hadamard code experienced the worst performance degradation even though it still achieved higher performance than the other codes, indicating that the Walsh-Hadamard code suffered great impact from optical signal attenuation in the stormy weather. Further, in stormy conditions, beyond 410 m, the modified M-sequence code became worse than the MQC code, and beyond 470 m showed the worst performance among the codes. The results of the performance degradation for extreme weather conditions in AWGN and turbulence-induced fading channel are shown in Table 6.