Design of Bipolar Optical Code-Division Multiple-Access Techniques Using Phase Modulator for Polarization Coding in Wireless Optical Communication

In this study, a bipolar optical code-division multiple-access (Bi-OCDMA) technique based on spectral amplitude coding (SAC) was proposed by using a phase modulator to realize polarization coding through a free-space optical (FSO) channel. Various types of noise, such as amplified spontaneous emission (ASE) noise, thermal noise, and shot noise, were included in the simulation to approach the real application. The first simulation, utilizing a modified M-sequence as signature code, demonstrated that the proposed Bi-OCDMA system could be implemented in FSO communication. The proposed Bi-OCDMA scheme improves the transmission rate and power efficiency compared with the previous scheme. The structure of the proposed system alleviates multiple-access interference (MAI) with a simple and cost-effective design. The second simulation observed the performance of the proposed Bi-OCDMA for two users with several well-known SAC codes, i.e., multi-diagonal (MD) code, modified quadratic congruence (MQC) code, modified maximum length sequence (M-sequence) code, and Walsh–Hadamard code, in extreme weather conditions, both for additive white Gaussian noise (AWGN) and turbulence-induced fading channel. The simulation results indicated that the Walsh–Hadamard code has superior performance compared to other codes. The results show the MD code can be implemented in the proposed Bi-OCDMA scheme for a medium-distance FSO.


Introduction
The demands of the fifth generation (5G) network are becoming challenging due to a significant increase in complexity. The 5G network requires ultra-low deterministic latency to operate normally, and must be kept running and maintained at a relatively low cost from a commercial perspective. From 2010 to 2030, the explosive growth of data traffic (expected to be approximately 20,000-fold) will require communication network technology to provide higher coverage and availability, in addition to denser networks [1]. Future networks will also need to support the continuous appearance of new services, such as machine-to-machine (M2M) applications and Internet of Things (IoT) applications.
Due to their high bandwidth, low latency, accurate synchronization, high reliability, and flexible application, optical networks are among the promising technologies that can meet the increasing demands of the upcoming 5G technology. However, in several applications, particularly in the last mile, it is costly to lay optical fiber cables for users. Free-space optical (FSO) communication has become one of the preferable methods with comparable data rates and very low error rates compared to optical fiber cables, although the biggest challenge is power attenuation due to atmospheric turbulence under various weather conditions. FSO communication is a line-of-sight wireless communication scheme power-cubic nonlinear preprocessor for a spectral-phase-encoded ultrashort light pulse optical code-division multiple-access system. The numerical results proved the superiority of the proposed system in improving the coherent SAC-OCDMA system performance, especially in high-power scenarios in which MAI becomes the dominant noise. Bipolar coding in a coherent system is advantageous in terms of spectral efficiency [13]. Therefore, bipolar coding is suitable for high-speed data transmission and real-time applications. The performance of bipolar encoding is better than that of unipolar encoding [14]. Bipolar codes can also be implemented in the non-coherent OCDMA system to stabilize the decision threshold for the improvement of bit error rate (BER) performance [15].
Several methods have been investigated to improve the performance of bipolar encoding; one of these uses a two-code keying scheme that exhibits an enhanced BER performance compared to the existing unipolar encoding with a direct detection technique [16]. Regarding security, in 2018, Patel et al. proposed a novel bipolar code based on a doubleweight code pattern with a reconfigurable encoder design. Code reconfiguration at the transmitting end provides code security against an eavesdropper at the transmitter and receiver ends [17]. In 2020, Gupta et al. proposed a novel bipolar double-weight coding scheme in the spectral domain to make the system more secure against the eavesdropping situation [18].
For transmission over an atmospheric turbulence channel, the polarization state of a light beam is the most stable parameter compared to the amplitude and phase [19]. The polarization domain has the potential to improve both system capacity and spectral efficiency (SE) by utilizing the state of polarization (SOP) of light [20]. A spectral-polarization coding OCDMA configuration effectively suppresses PIIN. Our previous work [21] used horizontal and vertical polarization states to generate bipolar data. By employing the switch as user data to polarize the optical signals with a series of fiber Bragg gratings (FBGs) and optical circulators as the decoding devices, the proposed scheme successfully mitigates MAI in FSO communication systems. The system drawbacks due to the limitation in the speed of the optical switch caused the limited transmission rate of the system [21]. In our subsequent work [22], another bipolar optical code-division multiple-access (Bi-OCDMA) scheme with a dual electro-optical modulator (EOM) was proposed to improve the transmission rate and spectral-polarization coding performance compared to the switch method in a previous study. In this method, the properties of the two EOMs need to be kept as similar as possible; moreover, the signal power is limited because the proposed scheme only transmits the signal with a wavelength corresponding to chip "1" in the signature code [22].
However, for the modulation of optical signals, several techniques have been proposed; one of these is phase modulation, which is a modulation technique that encodes a message signal as variations in the instantaneous phase of a carrier wave. The phase modulator is the simplest EOM with superiority in improving immunity toward noise. In 2014, Gao et al. [23] utilized a single-phase modulator for the simultaneous generation of time-domain spectral phase encoding/decoding (SPE/SPD) and differential phase-shift keying data modulation in the OCDMA system. The scheme proved that the flexibility and confidentiality of the OCDMA system can be improved by using a single-phase modulator [23].
In addition to the system design, channel impairments, such as atmospheric conditions and turbulence-induced fading, affect the performance of wireless optical communication. In [24], different detection schemes in SAC-OCDMA systems were investigated in the presence of different atmospheric impairments. The simulation results indicate that the SPD technique has the best performance among the detection methods. Another performance analysis of climatic turbulence was simulated in [25] with the hybrid SAC-OCDMA-OFDM method to reduce the signal fluctuations and quality degradation caused by weather conditions. The simulation results showed that the SPD detection receiver achieved better BER performance than the modified AND detection receiver. The results denoted in [25] also revealed that the proposed triangular matrix-zero cross-correlation code achieved better BER performance than the proposed pulse shifting substitution-zero cross-correlation code.
Furthermore, different signature codes for SAC-OCDMA have been proposed and investigated in many studies. Several well-known SAC codes were adopted for the simulation in this study and are listed as follows:

1.
Modified quadratic congruence (MQC) code: With fixed in-phase cross-correlation, the MQC code resolves the interference, which is the main factor limiting the performance of the OCDMA system [26].

2.
Walsh-Hadamard code: The Walsh-Hadamard code maps messages of length n to codewords of length 2 n , and each non-zero codeword has a Hamming weight of exactly 2 n−1 [27,28].

3.
Maximum length sequence (M-sequence) code: M-sequence code is a type of pseudorandom binary sequence with length 2 m−1 . The bit sequences can be generated using maximal linear feedback shift registers and periodically reproduce every sequence of bits that can be represented by the shift registers [29]. 4.
Multi-diagonal (MD) code: Another SAC code imposing the diagonal property is the MD code, which also has the property of zero cross-correlation. It has been shown that the MD code has been implemented in many OCDMA systems [30][31][32][33].
In this study, a Bi-OCDMA system for FSO communication was implemented by utilizing the phase modulator for polarization coding with the SAC code as the signature code. The main contributions of this study are as follows:

1.
A simple, cost-effective, and moderate security scheme for a bipolar OCDMA system with a phase modulator was proposed for FSO communication. The proposed system maintains the SAC-OCDMA principles, which eliminate the MAI problem. The proposed system improves the transmission rate compared to the previous scheme with an optical switch [21]. Moreover, because all signature codes were utilized to transmit data, the proposed Bi-OCDMA improved power efficiency compared to our previous scheme with dual EOM [22]. 2.
The proposed system was investigated under extreme weather conditions using different SAC-OCDMA codes. The performance measurements were observed in terms of BER and quality factor (Q-factor), both for additive white Gaussian noise (AWGN) and AWGN with a fading channel.

3.
The proposed Bi-OCDMA architecture was further tested under different turbulenceinduced fading conditions, and a performance comparison was performed between different SAC-OCDMA. The fading model implemented the gamma-gamma fading channel model.
The remainder of this paper is organized as follows. Section 2 introduces the proposed Bi-OCDMA system, including the system architecture of encoding and decoding diagrams, the derivation of the correlation function, and the multi-user structure. Section 3 presents the simulation setup and results, including the feasibility of the proposed system, performance measurement, and comparison of the Bi-OCDMA systems with extreme weather conditions in AWGN and turbulence-induced fading channels. Finally, the work is concluded in Section 4, and prospective future work is noted.

The Proposed Bi-OCDMA System
The proposed Bi-OCDMA technique was developed to transmit bipolar data signals over a common FSO channel. Each user data is created using a pseudorandom bit sequence (PRBS). A phase-shift keying (PSK) pulse generator along with electrical bias and electrical gain were applied to generate the modulation signal. For data processing, a phase modulator is used to encode the data bit of each user into an optical signal, which is transmitted to the decoder end through an FSO channel. Polarization splitters are utilized as polarization-shift keying devices. An optical circulator and a series of uniform FBGs were used as decoder devices. The balanced photodetection method was used to detect differences in the optical power between two optical signals using two photodi-odes. In the proposed Bi-OCDMA scheme, the MAI effect was alleviated using a balanced photodetection method.
In the single-user scheme, a family of M-sequences that forms all sequences of the same length is used in the Bi-OCDMA schemes. To maintain the cross-correlation property for MAI elimination in the proposed scheme, the zero-padding method was implemented by adding zeros after the last bit of the original M-sequence. The resulting code family is named the modified M-sequence in the remainder of this paper. Let X 1 be a codeword from the modified M-sequences as follows: where x k (i) is the i-th element of the k-th codeword of the modified M-sequence, N is the code length of the modified M-sequence, and z p is the zero-padding element. Subsequently, the cyclic property of M-sequences is used to generate codewords of the same length using N and equation of X (k+1) = T k X 1 , where T is the shifting operator vectors cyclically to the right by one place, and k is the number of cyclic shifts to the right side. The implementation of polarization coding and modulation techniques for Bi-OCDMA schemes using modified M-sequence codes can be described as follows: when the data bit of the k-th user is "1," the transmitted optical signal is modulated with the vertical (or horizontal) polarization state if the chip of codeword is "0" (or "1"), respectively. However, when the data bit of the k-th user is "0," if the chip of codeword is "0" (or "1"), the transmitted optical signal is modulated with the horizontal (or vertical) polarization state, respectively.
For example, the proposed modified M-sequence code of length 8 in the bipolar scheme can be expressed using the matrix as follows: In Equation (2), x k denotes the k-th row in the modified M-sequence matrix, which can be split into two unipolar codes, c kV and c kH . These two codes denote the positive and negative elements of x k , and form a complementary pair in the set ∈ {0, 1}. In this approach, x k is sent a data bit "1" for the k-th user, where the complement row of x k (denoting x k ) is transmitted for a data bit "0" of the k-th user. The notation (C V − C H ) represents the matrix formed where all users sent a data bit "1." Subsequently, the modified M-sequence matrix can be mapped to the wavelength domain, characterized by two orthogonal polarization states (vertical and horizontal). The first and second matrices are assigned to the vertical (C V ) and horizontal (C H ) polarization states, respectively. Similarly, the complement matrix of X can be decomposed into the following form: Therefore, the optical signal R k sent from the encoder of the k-th user can be derived as: where b k ∈ {0, 1}, c kV and c kH are the k-th codewords for encoding with the vertical and horizontal polarization states, respectively. That is, if b k = 1, the spectrum of the coded signal corresponds to (c kV − c kH ). Similarly, the spectrum of the coded signal is (c kV − c kH ) if b k = 0. Table 1 shows the modified M-sequence code of length eight with bipolar schemes. The symbols H and V represent the optical signals with horizontal and vertical polarization states, respectively. Based on these derivations, a corresponding FSO system using Bi-OCDMA schemes can be constructed.
To implement modified M-sequence codes with length N in the proposed schemes, the results of the following correlation must be obtained: The correlation properties in Equations (5) and (6) verified that the modified Msequence codes can be implemented in the proposed system to alleviate MAI with a balanced photodetection method. Figure 1 illustrates the design of the proposed encoder, which is composed of two continuous wave (CW) laser arrays as the light source, a PRBS generator as the bit sequence generator, two sets of electrical bias, electrical gain, and PSK pulse generator as the modulation signal, two-phase modulators for optical signal modulation, four optical couplers, several optical adders, an inverter, two polarization splitters (0 • and 90 • ) for polarization coding, and a polarization combiner. First, two CW laser arrays are employed to emit specific wavelengths based on the assigned modified M-sequence codeword, where CW laser array#1 (or #2) sends out the wavelength correlated with chip "1" (or "0") of the codeword depending on the users' data bit of "0" (or "1"). As shown in Table 1, because the modified M-sequence codeword X1 = [1 0 1 1 1 0 0 0] is assigned to user#1, the wavelengths of CW laser arrays #1 and #2 are () and (), respectively. Based on the user data bit, electrical signals are generated by the PSK pulse generator. Because the in-phase output of the PSK pulse generator is −1 and 1, electrical bias and electrical gain are utilized to normalize it to 0 and 1 for the modulating signal of the phase modulator. Next, the electrical signal is sent to the EOM for optical signal modulation. The output optical signals from the phase modulator can be formulated as follows: is the electrical input. The modulated signals are then distributed to one of the outputs from the optical coupler, depending on the user data bit. The output of the optical coupler can be expressed as: where  denotes the additional loss, p is the conjugate parameter, c denotes the coupling coefficient, and in E is the input optical signal. First, two CW laser arrays are employed to emit specific wavelengths based on the assigned modified M-sequence codeword, where CW laser array#1 (or #2) sends out the wavelength correlated with chip "1" (or "0") of the codeword depending on the users' data bit of "0" (or "1"). As shown in Table 1, because the modified M-sequence codeword X 1 = [1 0 1 1 1 0 0 0] is assigned to user#1, the wavelengths of CW laser arrays #1 and #2 are (λ 1 , λ 3 , λ 4 , λ 5 ) and (λ 2 , λ 6 , λ 7 , λ 8 ), respectively. Based on the user data bit, electrical signals are generated by the PSK pulse generator. Because the in-phase output of the PSK pulse generator is −1 and 1, electrical bias and electrical gain are utilized to normalize it to 0 and 1 for the modulating signal of the phase modulator. Next, the electrical signal is sent to the EOM for optical signal modulation. The output optical signals from the phase modulator can be formulated as follows: where E in,PM (t) denotes the electrical input signal, ∆Q is the phase deviation, and X(t) is the electrical input. The modulated signals are then distributed to one of the outputs from the optical coupler, depending on the user data bit. The output of the optical coupler can be expressed as: where α denotes the additional loss, p is the conjugate parameter, c denotes the coupling coefficient, and E in is the input optical signal.
When the data bit of the user is "1" (or "0"), only the first (or second) output of the optical couplers will have the signals and pass into the upper (or lower) polarization splitter to polarize the signals into the horizontal (or vertical) polarization state. These polarized signals are then combined through the polarization combiner. For example, if the data bit of user#1 is "0," the polarization combiner output corresponds to [λ 1 , λ 3 , λ 4 , λ 5 ] H and [λ 2 , λ 6 , λ 7 , λ 8 ] V ; however, if the bit of user#1 is "1," the polarization combiner output corresponds to [λ 2 , λ 6 , λ 7 , λ 8 ] H and [λ 1 , λ 3 , λ 4 , λ 5 ] V . Finally, the output of the encoder is transmitted via an FSO channel. Figure 2 illustrates the structure of the proposed Bi-OCDMA decoder, which is composed of a polarization splitter, two optical circulators, two series of uniform FBGs, two optical adders, two photodetectors, two low-pass Bessel filters, and one electrical subtractor to complete the bipolar scheme with balanced photodetection by subtracting the upper and lower signals to mitigate the MAI.

EER REVIEW 8 of 23
optical adders, two photodetectors, two low-pass Bessel filters, and one electrical subtractor to complete the bipolar scheme with balanced photodetection by subtracting the upper and lower signals to mitigate the MAI. The received optical signals are depolarized through the polarization splitter and then sent to the following two circulators, whose ports #2 are connected to two series of uniform FBGs. The wavelengths of these two series of uniform FBGs are determined using the assigned codewords. For example, the series of upper (or lower) uniform FBGs reflect the central wavelengths of and  (or and ) that correspond to chip "1" (or "0") of the codeword X1 = [1 0 1 1 1 0 0 0] in the uniform FBG decoder for user#1. The reflected signals subsequently enter port#3 of the circulator, whereas the transmitted signals of the two series of uniform FBGs are collected into the upper optical adder. A lower optical adder is used to gather optical signals from port#3 of each of the two optical circulators.
From Equation (4) where k denotes the number of active users, V R is the sum of the optical signal with vertical polarization, and H R represents the sum of the optical signal with horizontal polarization. Based on the above equation, the optical signal ( V R ) with specific wavelengths corresponding to the position of the "1s" of kV c is reflected by the k-th user's uniform FBGs-based decoder, and then arrives at the lower optical adder. Simultaneously, the op- The received optical signals are depolarized through the polarization splitter and then sent to the following two circulators, whose ports #2 are connected to two series of uniform FBGs. The wavelengths of these two series of uniform FBGs are determined using the assigned codewords. For example, the series of upper (or lower) uniform FBGs reflect the central wavelengths of λ 1 , λ 3 , λ 4 , and λ 5 (or λ 2 , λ 6 , λ 7 , and λ 8 ) that correspond to chip "1" (or "0") of the codeword X 1 = [1 0 1 1 1 0 0 0] in the uniform FBG decoder for user#1. The reflected signals subsequently enter port#3 of the circulator, whereas the transmitted signals of the two series of uniform FBGs are collected into the upper optical adder. A lower optical adder is used to gather optical signals from port#3 of each of the two optical circulators.
From Equation (4), the received vertical (R V ) and horizontal signal (R H ) can be derived as follows, where the received optical signal (R) is equal to R V + R H [21]: where k denotes the number of active users, R V is the sum of the optical signal with vertical polarization, and R H represents the sum of the optical signal with horizontal polarization. Based on the above equation, the optical signal (R V ) with specific wavelengths corresponding to the position of the "1s" of c kV is reflected by the k-th user's uniform FBGsbased decoder, and then arrives at the lower optical adder. Simultaneously, the optical signal (R V ) with remainder wavelengths corresponding to the position of the "1s" of c kV is sent to the upper optical adder. Conversely, the optical signal (R H ) with specific wavelengths corresponding to the position of the "1s" of c kH arrives at the upper optical adder after a series of lower uniform FBGs. Concurrently, the optical signal (R H ) with the reflected wavelengths is sent to the lower optical adder. The output signals of the upper and lower optical adders are then passed to the photodetectors for electrical subtraction to complete the balanced detection. This approach is detailed in the following equation: where h and h denote the assigned and complementary optical codewords of the desired user, respectively. Finally, a 3R regenerator was used to determine the data bit of the desired user. The BER and Q-factor were then measured using a BER analyzer. Mathematically, the BER of the proposed Bi-OCDMA can be evaluated using [16]: where SNR is the signal-to-noise ratio of the proposed system and er f c denotes the complementary error function in time, which can be calculated as [34]: In this simulation, the minimum log of the BER was adopted instead of the minimum BER to simplify the system performance analysis [35]: The correlation between the BER and Q-factor can be derived as [36,37]: Figure 3 shows the proposed encoder/decoder architecture for a multi-user scheme with two users. The higher multi-user scheme can be expanded with the same architecture as that of the single-user scenario.

Feasibility of the Proposed Bi-OCDMA
The simulation was conducted using the well-known optical system software, OptiSystem version 10. Based on the architecture in Figures 1 and 2, the first simulation was conducted with a single-user scheme to verify the feasibility of the proposed Bi-OCDMA scheme. The power of the CW laser array was set to 0 dBm to minimize the nonlinear effect, and one PRBS generator was used to generate the user's information bit randomly with a sequence length of 512 bits and 8 samples per bit for transmission over the system.
Next, these information bits were fed to the PSK generator with a 0-degree phase offset and passed through the electrical bias and electrical gain for signal normalization before being used as a modulation signal. A phase modulator was utilized to modulate the information signals using the optical modulation signals. In addition, the coupling coefficients of all 2 × 2 couplers in the simulation were set to 0.5. A polarization splitter was used to split the signals into two orthogonal polarization states (0°and 90°, i.e., horizontal and vertical states). An optical adder was used in this simulation to combine the two optical signals. A polarization combiner was used to combine the two polarization states.
In this simulation, an FSO channel with a short-to-mid range was set as the transmission medium. An ideal circulator was used to direct the optical signal from one port to another and prevent the signal from propagating in an unintended direction. A uniform FBG was employed to reflect and transmit the wavelength based on the signature code. A photodiode was utilized as the detector for the received optical signals. A low-pass Bessel filter was used with a cut-off frequency of its linear phase response up to a bit rate of 0.75. An electrical subtractor was applied to subtract two electrical signal outputs to complete

Feasibility of the Proposed Bi-OCDMA
The simulation was conducted using the well-known optical system software, Op-tiSystem version 10. Based on the architecture in Figures 1 and 2, the first simulation was conducted with a single-user scheme to verify the feasibility of the proposed Bi-OCDMA scheme. The power of the CW laser array was set to 0 dBm to minimize the nonlinear effect, and one PRBS generator was used to generate the user's information bit randomly with a sequence length of 512 bits and 8 samples per bit for transmission over the system.
Next, these information bits were fed to the PSK generator with a 0-degree phase offset and passed through the electrical bias and electrical gain for signal normalization before being used as a modulation signal. A phase modulator was utilized to modulate the information signals using the optical modulation signals. In addition, the coupling coefficients of all 2 × 2 couplers in the simulation were set to 0.5. A polarization splitter was used to split the signals into two orthogonal polarization states (0 • and 90 • , i.e., horizontal and vertical states). An optical adder was used in this simulation to combine the two optical signals. A polarization combiner was used to combine the two polarization states.
In this simulation, an FSO channel with a short-to-mid range was set as the transmission medium. An ideal circulator was used to direct the optical signal from one port to another and prevent the signal from propagating in an unintended direction. A uniform FBG was employed to reflect and transmit the wavelength based on the signature code. A photodiode was utilized as the detector for the received optical signals. A low-pass Bessel filter was used with a cut-off frequency of its linear phase response up to a bit rate of 0.75. An electrical subtractor was applied to subtract two electrical signal outputs to complete the bipolar scheme with balanced photodetection. A 3R regenerator was used to regenerate electrical signals. An optical spectrum analyzer was used to measure and investigate the optical spectra. An oscilloscope visualizer was used to monitor the output signals of the system. A BER analyzer was used to observe several parameters of the system performance, that is, BER and Q-factor. The overall parameters used in the simulations are listed in Table 2. The modified M-sequence code with a code length of eight was used as the signature code. Based on Table 1, user#1 was assigned with the codeword X = [λ 1H , λ 2V , λ 3H , λ 4H , λ 5H , λ 6V , λ 7V , λ 8V ] for user data bit of "0" and X = [λ 1V , λ 2H , λ 3V , λ 4V , λ 5V , λ 6H , λ 7H , λ 8H ] for user data bit of "1." Figure 4 presents the measured spectra when bit "1" was transmitted after phase modulation and passing over the polarization splitter. Figure 4a illustrates the measured spectra at the upper side, λ 1 , λ 3 , λ 4 , λ 5 measured at vertical polarization, and the light intensities were −3 dBm. Figure 4b shows the measured spectra at the lower side, λ 2 , λ 6 , λ 7 , λ 8 measured at horizontal polarization, and the light intensities were −3 dBm.  Figure 6b presents the total measured spectra at the lower branch. No spectra were measured.
(a) (b)   Figure 5 depicts the measured spectra when bit "1" was transmitted after passing through the FSO channel. Figure 5a shows the encoded spectra for the horizontal polarization, λ 2 , λ 6 , λ 7 , λ 8 , which were measured with light intensities of −30 dBm. Figure 5b shows the encoded spectra for the vertical polarization λ 1 , λ 3 , λ 4 , λ 5 , which were measured with light intensities of −30 dBm. With an optical power of −3 dBm before passing through the FSO channel, the power was attenuated by approximately 27 dBm after transmission through the FSO channel due to the impact of atmospheric turbulence.  Figure 6b presents the total measured spectra at the lower branch. No spectra were measured.
(a) (b)   Figure 6 presents the measured spectra before the optical signals entered the upper and lower photodetectors when data bit "1" was sent. Figure 6a shows the total measured spectra at the upper branch, λ 1 , λ 2 , λ 3 , λ 4 , λ 5 , λ 6 , λ 7 , λ 8 , measured with light intensities of −30 dBm. Figure 6b presents the total measured spectra at the lower branch. No spectra were measured.
(a) (b) Figure 6. Output spectrum before photodetection for user data bits of "1": (a) total signals at the upper branch; (b) total signals at the lower branch.
Using the same principle, when data bit "0" was sent, no spectral chip appeared at the upper branch, and eight spectral chips were measured at the lower branch, the electrical subtraction between the upper and lower branches resulted in negative signal amplitude, representing the negative parts "−1" of the bipolar scheme.
From Figure 6a,b, eight spectral chips appeared at the upper branch, and no spectral chip was observed at the lower branch; the electrical subtraction between the upper and lower branches resulted in positive signal amplitude, representing the positive parts "+1" of the bipolar scheme.
Further verification was undertaken by transmitting a series of user data bits alternating between bit "0" and "1." Figure 7a,b illustrates the user's information generated from PRBS, which generated a binary bit sequence between bit "0" and "1" with the corresponding received bipolar signals from the proposed Bi-OCDMA scheme, respectively.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 13 of 23 Figure 6. Output spectrum before photodetection for user data bits of "1": (a). total signals at the upper branch; (b). total signals at the lower branch.
Using the same principle, when data bit "0" was sent, no spectral chip appeared at the upper branch, and eight spectral chips were measured at the lower branch, the electrical subtraction between the upper and lower branches resulted in negative signal amplitude, representing the negative parts "−1" of the bipolar scheme.
From Figure 6a,b, eight spectral chips appeared at the upper branch, and no spectral chip was observed at the lower branch; the electrical subtraction between the upper and lower branches resulted in positive signal amplitude, representing the positive parts "+1" of the bipolar scheme.
Further verification was undertaken by transmitting a series of user data bits alternating between bit "0" and "1." Figure 7a,b illustrates the user's information generated from PRBS, which generated a binary bit sequence between bit "0" and "1" with the corresponding received bipolar signals from the proposed Bi-OCDMA scheme, respectively.
The MAI cancelation features were evaluated using the mismatch scenario. The encoder used the user#1 signature code from the modified M-sequence, that is, 10111000, whereas the decoder was implemented with the user#2 signature code from the modified M-sequence, that is, 01110010, demonstrating the mismatch decoder. Figure 8 indicates the output spectra before photodetection when bit "0" was sent. Figure 8a Figure 8a,b, four spectral chips appeared at the upper branch and four spectral chips were also measured at the lower branch, and the electrical subtraction between the upper and lower branches resulted in zero signal amplitude, proving the MAI elimination of the bipolar scheme. Figure 9 illustrates the output signals after balanced photodetection in the case of a mismatch decoder when bit "0" was sent. No signal was received by the user#2 decoder when the data bit was sent from the user#1 encoder, verifying the absence of the MAI effect on the other user. A small acceptable The MAI cancelation features were evaluated using the mismatch scenario. The encoder used the user#1 signature code from the modified M-sequence, that is, 10111000, whereas the decoder was implemented with the user#2 signature code from the modified M-sequence, that is, 01110010, demonstrating the mismatch decoder. Figure 8 indicates the output spectra before photodetection when bit "0" was sent. Figure 8a shows the measured spectra at the upper branch, λ 2 , λ 4 , λ 5 , λ 6

Performance of The Proposed Bi-OCDMA
A second simulation was conducted to test the proposed Bi-OCDMA under different channel conditions. The simulation was demonstrated using the architecture shown in Figure 3 with two simultaneous users. Some noise sources were implemented in the simulation to closely approximate the real environment of the FSO system. The noise sources included amplified spontaneous emission (ASE) noise, thermal noise, and shot noise with Gaussian distribution, where the total noise effect can be observed as: Each noise induced in the simulation can be verified as follows:  Thermal noise:  Figure 8b displays the measured spectra at the lower branch, λ 1 , λ 3 , λ 7 , λ 8 , and the light intensities were −30 dBm. In Figure 8a,b, four spectral chips appeared at the upper branch and four spectral chips were also measured at the lower branch, and the electrical subtraction between the upper and lower branches resulted in zero signal amplitude, proving the MAI elimination of the bipolar scheme. Figure 9 illustrates the output signals after balanced photodetection in the case of a mismatch decoder when bit "0" was sent. No signal was received by the user#2 decoder when the data bit was sent from the user#1 encoder, verifying the absence of the MAI effect on the other user. A small acceptable noise-floor signal was measured, resulting from the imperfect filter of the FBG decoder.  . Output signals of the proposed Bi-OCDMA system for mismatch decoder when bit "0" was transmitted.

Performance of The Proposed Bi-OCDMA
A second simulation was conducted to test the proposed Bi-OCDMA under different channel conditions. The simulation was demonstrated using the architecture shown in Figure 3 with two simultaneous users. Some noise sources were implemented in the simulation to closely approximate the real environment of the FSO system. The noise sources included amplified spontaneous emission (ASE) noise, thermal noise, and shot noise with Gaussian distribution, where the total noise effect can be observed as: Figure 9. Output signals of the proposed Bi-OCDMA system for mismatch decoder when bit "0" was transmitted.
The simulation results proved the feasibility of the bipolar scheme from the proposed Bi-OCDMA with a phase modulator and verified the MAI elimination property of the system.

Performance of The Proposed Bi-OCDMA
A second simulation was conducted to test the proposed Bi-OCDMA under different channel conditions. The simulation was demonstrated using the architecture shown in Figure 3 with two simultaneous users. Some noise sources were implemented in the simulation to closely approximate the real environment of the FSO system. The noise sources included amplified spontaneous emission (ASE) noise, thermal noise, and shot noise with Gaussian distribution, where the total noise effect can be observed as: Each noise induced in the simulation can be verified as follows: • Thermal noise: • Shot-Signal Noise: • Shot-ASE Noise: • Signal-ASE Noise: • ASE-ASE Beat Noise: where T is the absolute temperature of the device, R L denotes the receiver load resistance, k B is the Boltzmann constant, ENB is the receiver equivalent electrical noise bandwidth, B e denotes the equivalent noise bandwidth of the photodetector, r is the PIN responsivity, M is the gain, F denotes the excess noise factor, P s is the signal power, i d denotes the device dark current, q is the electron charge value, P ASE is the optical noise power, and PSD ASE denotes the power spectral density of the optical noise field (spontaneous emission). Two channel conditions were implemented in the second simulation, namely, the AWGN channel and turbulence-induced fading channel. The AWGN channel was created by adding a white light source with a power of −130 dBm to the optical signals before transmission through the FSO channel. Furthermore, the gamma-gamma distribution was applied to model the turbulence-induced fading channel in this simulation.
In the gamma-gamma fading model, the probability of intensity I can be calculated as: where Γ(. . .) is the gamma function, and K α−β (. . .) is the modified Bessel function of the second kind 1 α and 1 β are the variances of the small-and large-scale eddies, and can be evaluated as follows: where σ 2 R denotes the Rytov variance and is calculated from: where C 2 n is the parameter index refraction structure with a value varying from 10 −13 m -2/3 for intense turbulence to 10 −17 m −2/3 for weak turbulence, k is the optical wavenumber, and z is the parameter range.
First, a second simulation was conducted in the AWGN channel for extreme weather conditions based on the standard of propagation data required for the design of terrestrial free-space optical links from the International Telecommunication Union Radiocommunication Sector (ITU-R) P.1817 [38]. The attenuations under different weather conditions are shown in Table 3. Table 3. International visibility code [38]. Four well-known SAC-OCDMA codes, that is, MD code, MQC code, modified Msequence code, and Walsh-Hadamard code, were applied in the simulation. These four codes satisfy the correlation properties of Equations (5) and (6), revealing the compatibility to be implemented in the proposed Bi-OCDMA structure. The signature codes used in this simulation are listed in Table 4. Table 4. Signature codes for two users.

Code
Signature Code  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 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. (a) (b) Figure 11. Performance of the system in stormy 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 (a) (b) Figure 11. Performance of the system in stormy 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  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.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 18 of 23 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. (a) (b) Figure 13. Performance of the system in stormy weather condition 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.
(a) (b) 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.
(a) (b) 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 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. 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. 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 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,

Conclusions
In this study, the feasibility of Bi-OCDMA with a phase modulator for polarization coding in short-to-medium range FSO environments was successfully implemented and validated. The simulation results showed that the proposed Bi-OCDMA could appropriately decode the original signal from its corresponding encoder. The proposed system was designed based on the original SAC-OCDMA technique, which theoretically relieves the MAI effect. Compared with the previous Bi-OCDMA scheme with an optical switch [21] and dual EOM [22], the proposed Bi-OCDMA scheme with a phase modulator improved the transmission rate and power efficiency. The performance measurements were simulated under extreme weather conditions, first for the AWGN channel, and second for the AWGN and turbulence-induced fading channels, by utilizing four different OCDMA codes. The proposed Bi-OCDMA system was further tested under different turbulence conditions. The simulation results revealed that the Walsh-Hadamard code had the best performance among the codes. The simulations also showed that in terms of the FSO range, the MD code was the most resistant to the increase in FSO distance, indicated by the lowest performance deterioration, whereas the modified M-sequence code suffered the highest performance degradation in almost all extreme weather and turbulence conditions. This result indicates that the MD code can be used for medium-range FSO applications in the proposed Bi-OCDMA system, whereas the modified M-sequence code can be applied to short-range FSO. In the case of stormy weather conditions and channels with intense turbulence, the Walsh-Hadamard code suffered the highest performance deterioration, although it still achieved superior performance, showing that Walsh-Hadamard code performance is most affected by optical signal attenuation caused by weather and turbulence conditions. Future work can apply the proposed Bi-OCDMA technique in long-range wireless optical communication channels in correlation with different atmospheric conditions for higher multi-user schemes. Performance measurement with some parameters, such as BER, Q-factor, and the eye diagram, can be undertaken, including of the performance improvements resulting from several optimization techniques. Furthermore, Bi-OCDMA can be investigated for higher-order intensity modulation signals with different codes.