## 3 Simulation Setup and Results
### Performance of The Proposed Bi-OCDMA
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Weather** & **Code** & **Min. Log of BER (a.u.)** & **Max. Q-Factor (a.u.)** \\ \hline \multirow{3}{*}{Intense Rainy} & MD & 1.9466 & 0.48296 \\ \cline{2-4}  & MQC & 2.7031 & 0.63817 \\ \cline{2-4}  & Modified M-Sequence & 3.9077 & 0.8524 \\ \cline{2-4}  & Walsh-Hadamard & 3.2771 & 0.6095 \\ \hline \multirow{3}{*}{Stormy} & MD & 8.9661 & 2.48757 \\ \cline{2-4}  & MQC & 9.0417 & 2.33693 \\ \cline{2-4}  & Modified M-Sequence & 15.9262 & 4.0917 \\ \cline{2-4}  & Walsh-Hadamard & 18.8968 & 4.07411 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Performance degradation with the increasing of FSO range in the AWGN channel. Figure 12: Performance of the system in intense rainy weather condition for AWGN and turbulence-induced fading channel: (**a**) min. log of BER; (**b**) max. Q-factor. The final simulations tested the proposed Bi-OCDMA system under different turbulence conditions. Figures 14-16 show the performance of different SAC codes implemented in the proposed Bi-OCDMA system under different turbulence conditions based on Equation (24). The simulation results show that the Walsh-Hadamard code had the best performance, followed by the modified M-sequence code, MQC code, and MD code. In all turbulence conditions, the MD code achieved the lowest performance degradation with an increasing FSO range, revealing that the MD code can be applied for medium-distance FSO in the proposed Bi-OCDMA system. In the cases of weak and medium turbulence, the simulation results indicate that the modified M-sequence code suffered the worst performance deterioration with an increasing FSO range, whereas under intense turbulence conditions, the Walsh-Hadamard code achieved the worst performance degradation. These results showed that the Walsh-Hadamard code was the most affected by the turbulence condition, in addition to the increase in the FSO range. The simulation results of the performance degradation for different turbulence conditions are displayed in Table 7. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Weather** & **Code** & **Min. Log of BER (a.u.)** & **Max. Q-Factor (a.u.)** \\ \hline \multirow{3}{*}{Intense Rainy} & MD & 2.5724 & 0.64368 \\ \cline{2-4}  & MQC & 3.2382 & 0.76975 \\ \cline{2-4}  & Modified M-Sequence & 5.1366 & 1.13579 \\ \cline{2-4}  & Walsh-Hadamard & 4.8101 & 0.9055 \\ \hline \multirow{3}{*}{Stormy} & MD & 10.5638 & 3.02852 \\ \cline{2-4}  & MQC & 10.6674 & 2.8358 \\ \cline{2-4}  & Modified M-Sequence & 17.96109 & 4.80502 \\ \cline{2-4}  & Walsh-Hadamard & 22.0608 & 4.96498 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Performance degradation with an increasing FSO range in the AWGN and turbulence-induced fading channel. Figure 13: Performance of the system in stormy weather condition for the AWGN and turbulence-induced fading channel: (**a**) min. log of BER; (**b**) max. Q-factor. Figure 16: Performance of the system under intense turbulence condition: (**a**) min. log of BER; (**b**) max. Q-factor. Figure 14: Performance of the system under weak turbulence conditions: (**a**) min. log of BER; (**b**) max. Q-factor. Figure 15: Performance of the system under medium turbulence condition: (**a**) min. log of BER; (**b**) max. Q-factor.