Two-Dimensional Permutation Vectors’ (PV) Code for Optical Code Division Multiple Access Systems

In this paper, we present a new algorithm to generate two-dimensional (2D) permutation vectors’ (PV) code for incoherent optical code division multiple access (OCDMA) system to suppress multiple access interference (MAI) and system complexity. The proposed code design approach is based on wavelength-hopping time-spreading (WHTS) technique for code generation. All possible combinations of PV code sets were attained by employing all permutations of the vectors with repetition of each vector weight (W) times. Further, 2D-PV code set was constructed by combining two code sequences of the 1D-PV code. The transmitter-receiver architecture of 2D-PV code-based WHTS OCDMA system is presented. Results indicated that the 2D-PV code provides increased cardinality by eliminating phase-induced intensity noise (PIIN) effects and multiple user data can be transmitted with minimum likelihood of interference. Simulation results validated the proposed system for an agreeable bit error rate (BER) of 10−9.


Introduction
Driven by the ever-growing data size from internet usage rate, optical code division multiple access (OCDMA) system became the center of attention due to its ability to overcome the bottleneck problem for data-hungry applications with massive data rate. OCDMA systems permit multiple subscribers to asynchronously and concurrently access the medium without any contention along with the ability to provide reliable bandwidth at relatively low cost [1,2].
Spectral amplitude coding (SAC) technique is measured as a proficient scheme in alleviating the effects of multiple access interference (MAI) and its inherited intensity noise [3]. Along with its MAI alleviation features, SAC-OCDMA system is implemented with low cost and less complexity with broadband incoherent sources such as light emitting diodes (LED) [4,5].
Two dimensional (2D) coding schemes are enthusiastically adapted to increase orthogonality which lead to efficient bandwidth utilization. Further, performance is improved in terms of increased subscribers due to spectral density expansion at the cost of high-speed electronic devices [6].
(10 −10 at data rates 40 Giga bits per second (Gbps)) as well as long PON distance up to 41 km with increased maximum throughput equal to 285.1 Gb/s/km was achieved.
Moreover, Najjar et al. [21] proposed the construction of 2D diagonal eigenvalue unity (DEU) code using a spectral-spatial (S-S) coding approach with minimum cross-correlation. Results indicated that the 2D DEU provides an increase in cardinality when compared to existing 2D diluted perfect difference DPD and 1D DEU codes.
Mrabet et al. [22] presented an analytical model consisting of a hybrid of all-optical orthogonal frequency division multiplexing (AO-OFDM) and OCDMA. The presented model incorporated probabilistic subcarrier overlapping and MAI testing capabilities with over amplifier-free long-reach passive optical networks (LR-PONs) using cost-effective intensity modulations and direct detection (IM-DD) techniques. The proposed system considered subcarrier hopping by utilizing 2D-HC codes. It was observed that the hybrid (AO-OFDM) and OCDMA with 2D-HC outperformed a traditional multichannel OCDMA system for any number of simultaneous users and low received powers in comparison with 1D-Walsh Hadamard, 1D, and 2D prime codes. Numerical results showed that 16-quadrature amplitude modulation (16-QAM) AO-OFDM-OCDMA provides comparable performance to traditional multichannel 16-QAM coherent optical OFDM in the downstream direction. The presented technique supported up to 58 km with a maximum 45 users, without complex coherent technology. In addition, at 108 km as a maximum reachable distance (at 40 Gb/s), QAM signal was achieved in budget power calculation while considering standard forward error correction (FEC) techniques.
Further, a recent study conducted by Mrabet et al. [23] presented performance analysis of an OCDMA system for LR-PON systems, considering MAI, receiver noise, and single-mode fiber (SMF) channel effects. A mathematical model representing 2D optical code parameters for different receiver structures using Matlab simulations was developed including effects of channel imperfections, such as attenuation losses and chromatic dispersion. Probability of error was investigated for back-to-back (B2B) single mode fiber (SMF) with conventional correlation receiver (CCR) and SMF channel with successive interference cancelation (SIC) receiver. Performance improvement, in terms of number of simultaneous users with Q factor (6) at fiber distances 190 and 120 km, was achieved without amplification.
The rest of this manuscript is arranged as follows. Section 2 describes the construction and properties of the 2D wavelength/time permutation vectors' codes. Section 3 presents the architecture of the transmitter and receiver of the proposed code. Section 4 analyzes the system performance. The numerical and simulation results are presented in Sections 5 and 6, respectively. Finally, the conclusions are drawn in Section 7.

The 2D Wavelength-Hopping/Time-Spreading System
Utilizing a wavelength-hopping/time-spreading (WHTS) as encoding technique for 2D representation provides numerous advantages over other incoherent schemes such as cardinality and code interference mitigation. In this approach, the codes were spread in both the time and wavelength domains simultaneously.
Three different cases were demonstrated to represent the wavelength-time slots matrices in Figure 1. Firstly symmetric case (SC) is shown in Figure 1a, in which all assigned wavelengths were utilized and every wavelength appeared only once in each code sequence at different time slots. Secondly, asymmetric case (AS) occurred if at least two different wavelengths were located at the same time slot or if the same wavelength appeared twice or more at different time slots (Figure 1b,c).

The 2-dimensional wavelength-time (W-T) Permutation Vectors' (PV) Code Construction and Properties
The new 1D PV code was constructed based on permutation vectors. It is characterized by the code length (L), the code weight (w), and by zero cross-correlation. L depends on the number of users (K) and w. The relationship of these variables is given as follows: = . (1)

One-Dimensional Approach
Let ℝ refer to the field of real numbers. The space of all m-tuples of real numbers forms an m-dimensional vector space over ℝ and represented by ℝ . The dimension of the vector space U over the field ℝ can be written as dim ℝ (U) or as [U: ℝ]. An element U of ℝ can be represented as vertical vector: Therefore, the dim ℝ(ℝ 3 ) = 3. In general, dimℝ(ℝ m ) = m.
Using the standard unit basis vectors, any vector = ⎝ ⎜ ⎛ .
. ⎠ ⎟ ⎞ ∈ ℝ can be expressed as a linear combination = ⋯ , where , , … , are the standard unit basis vectors of ℝ m .
Let T: ℝ → ℝ be a linear transformation defined such that: The representation matrix is: For example, the vector space ℝ 4 is represented as:

The 2-Dimensional Wavelength-Time (W-T) Permutation Vectors' (PV) Code Construction and Properties
The new 1D PV code was constructed based on permutation vectors. It is characterized by the code length (L), the code weight (w), and by zero cross-correlation. L depends on the number of users (K) and w. The relationship of these variables is given as follows: (1)

One-Dimensional Approach
Let R refer to the field of real numbers. The space of all m-tuples of real numbers forms an m-dimensional vector space over R and represented by R m . The dimension of the vector space U over the field R can be written as dim R (U) or as [U: R]. An element U of R m can be represented as vertical vector: Therefore, the dim R(R 3 ) = 3. In general, dim R(R m ) = m.
Using the standard unit basis vectors, any vector U = ∈ R m can be expressed as a linear combination U = u 1 e 1 + u 2 e m + . . . + u m e m , where e 1 , e 2 , . . . , e m are the standard unit basis vectors of R m . Let T: R m → R m be a linear transformation defined such that: Entropy 2020, 22, 576

of 19
The representation matrix is: For example, the vector space R 4 is represented as: A permutation vector is a 1 × n or n × 1 vector of the integers 1 through n. The following permutation matrix and permutation vector are equivalent: Based on the above definitions and given the number of users K and the weight W, we can generate all possibilities of 1D-PV by getting all permutations of the vectors with repetition of [T(e 1 ), T(e 2 ), . . . , T(e k−1 )] each vector w times. Hence, the 1D-PV codes consists of K × l matrix functionally depending on the value of the number of users (K) and code weight (w). These 1D-PV codes were constructed based on the vector space R k and an arbitrary permutation vector (Perm).
where Perm is a permutation vector used to permute the columns of the representation matrix of R k , the permuted R k is obtained using Equation (6): Moreover, the proposed 1D − PV is designed such that: • Cross-correlation between each row is equal to 0. • Each column is an element of the vector space R k . Thus, the basic form of 1D − PV for k = w = 2 while using the above-mentioned properties can be written in six forms as: An example of PV codes generated with weight w = 2 and K = 4 are given in Table 1. The number of possibilities is 28 sets of different patterns of PV code as a product of permutation operation.

W-T Two-Dimensional PV Approach
The obtained 2D W-T OCDMA codes were generated either by using a mathematical approach or by extension of an existing one-dimensional code. In the proposed work, 2D W-T PV codes were obtained by using one-dimensional PV codes for both wavelength-hopping and time-spreading. The new codes can be constructed as follows.
First, we construct M groups of PV codes as follows where M is ranging between 1 and PV poss .
where G i is 1D-PV code constructed based on the vector space R k and an arbitrary permutation vector (Permi), so that: Entropy 2020, 22, x FOR PEER REVIEW 6 of 20 An example of PV codes generated with weight w = 2 and K = 4 are given in Table 1. The number of possibilities is 28 sets of different patterns of PV code as a product of permutation operation.

W-T Two-Dimensional PV Approach
The obtained 2D W-T OCDMA codes were generated either by using a mathematical approach or by extension of an existing one-dimensional code. In the proposed work, 2D W-T PV codes were obtained by using one-dimensional PV codes for both wavelength-hopping and time-spreading. The new codes can be constructed as follows.
First, we construct M groups of PV codes as follows where M is ranging between 1 and . = , , , … … . , Between two selected groups (Gi and Gd), the total number of served users = K 2 . Therefore, the 2D W-T PV codes' generation equation was defined as: Each element in , is a square matrix (L× L), where L represents the number of available wavelengths and the number of time slots. The 2D W-T PV codes matrices were obtained by associating the rows with wavelengths and the columns with time slots. For example, choose i = 1 and d = 2 (group 1 and group 2 from Table 1). Then the code matrix is represented as follows.
where, C ij is a 1D-PV code where i ∈ [1, M] and j ∈ [1, K] and K is the number of generated codes in the group. Hence C ij is an arbitrary code in G i . The 2D W-T PV codes can be constructed by selecting G i to generate L time slots. Each C ij will be used as time-spreading patterns to determine the positions of the wavelengths. For the wavelength-hopping patterns, another 1D-PV code group was used G d , where d i. Hence, the wavelength-hopping patterns form the wavelength's index. Between two selected groups (G i and G d ), the total number of served users = K 2 . Therefore, the 2D W-T PV codes' generation equation was defined as: Between two selected groups (Gi and Gd), the total number of served users = K 2 . Therefore, the 2D W-T PV codes' generation equation was defined as: Each element in , is a square matrix (L× L), where L represents the number of available wavelengths and the number of time slots. The 2D W-T PV codes matrices were obtained by associating the rows with wavelengths and the columns with time slots. For example, choose i = 1 and d = 2 (group 1 and group 2 from Table 1). Then the code matrix is represented as follows.
Each element in A d,i is a square matrix (L × L), where L represents the number of available wavelengths and the number of time slots. The 2D W-T PV codes matrices were obtained by associating the rows with wavelengths and the columns with time slots. For example, choose i = 1 and d = 2 (group 1 and group 2 from Table 1). Then the code matrix C 21 C 11 is represented as follows.  For example, from Figure 2, it is clear that the codes (pink colored) and (blue colored) shared the same spectral signature (λ3, λ5) but transmitted them at different time slots (t3, t7) and (t5,t6), respectively. Furthermore, when two codes used the same time slots, like and (green colored), they sent different wavelengths, (λ3, λ5) for and (λ6, λ8) for , thus maintaining a zero cross-correlation. Figures 2 and 3, the 2D W-T PV generated codes were differentiated with either the wavelength's hopping or the time spreading.  For example, from Figure 2, it is clear that the codes (pink colored) and (blue colored) shared the same spectral signature (λ3, λ5) but transmitted them at different time slots (t3, t7) and (t5,t6), respectively. Furthermore, when two codes used the same time slots, like and (green colored), they sent different wavelengths, (λ3, λ5) for and (λ6, λ8) for , thus maintaining a zero cross-correlation. For example, from Figure 2, it is clear that the codes C 21 C 11 (pink colored) and C 21 C 12 (blue colored) shared the same spectral signature (λ 3 , λ 5 ) but transmitted them at different time slots (t3, t7) and (t5,t6), respectively. Furthermore, when two codes used the same time slots, like C 21 C 12 and C 22 C 12 (green colored), they sent different wavelengths, (λ 3 , λ 5 ) for C 21 C 12 and (λ 6 , λ 8 ) for C 22 C 12 , thus maintaining a zero cross-correlation. Figure 3 shows a 3-dimensional (3D) graphic representation of two 2D W-T PV code sequences, which represent either time spreading or wavelength hopping. It is clear that user#5 and user#6 shared the same spectral signature with spreading at different time slots. For example, from Figure 2, it is clear that the codes (pink colored) and (blue colored) shared the same spectral signature (λ3, λ5) but transmitted them at different time slots (t3, t7) and (t5,t6), respectively. Furthermore, when two codes used the same time slots, like and (green colored), they sent different wavelengths, (λ3, λ5) for and (λ6, λ8) for , thus maintaining a zero cross-correlation.

Properties of 2D W-T Permutation Vectors (PV) Codes
In order to define the cross-correlation of a 2D W-T PV code, four matrices are defined as Equations (10)-(13).
The cross-correlation between any arbitrary code, A d,i , and characteristic code, A g,h , can be defined through Equation (14).
where a (p) (g,h) and a (d,i) represent the elements of A g,h (p) and A d,i 2D W-T PV matrix, respectively, and p ∈ [0, . . . , 3]. In accordance with Equation (11), the cross-correlation between any two codes A g,h and A d,i can be calculated as shown in Table 2. Table 2. Cross-correlation values of 2D W-T PV codes.
As the cross-correlation along G i and G T d code sequences equals zero, so R (1,3) g,h (d, i) has no use for the new correlation function, which makes the multiple user interference (MUI) elimination process easier. Hence, the expression of a new cross-correlation function from the previous table is given as follows: Entropy 2020, 22, 576 9 of 19

Design of 2D-PV System
The basic 2D-PV-based OCDMA system comprises numerous W-T encoders/decoders at the transmitter and receiver parts, respectively. Each encoder/decoder structure is made up of FBG-based delay lines, each with a certain bit period. FBGs as delay lines are preferred due to low circuit complexity and reduced delay time when compared to first generation 2D TW implementations (tunable filters and delay lines) [24]. Due to recent advancement in thin film technology, thin film filters (TFFs) are other alternative implementation approaches [25].

Design of 2D-PV Transmitter Part
The conventional transmitter structure for a W-T OCDMA system is shown in Figure 4. Initially, the transmitter module consists of a multi-wavelength continuous wave (CW) laser array as an optical source. For each user, a group of wavelengths is produced by the CW laser. These short pulse trains are set to a width τ ((τ = t b /S), which represents code length in time spread), where t b /S stands for bit time period per second. The pulse train repetition rate is set equal to the system bit rate (1/t b ). The bit stream is modulated by the input data using an amplitude modulator. In the on-off keying process, the modulator produces an optical pulse when transmitted data bit is one, or else it produces zero output. Modulated signal/data pulses are demultiplexed using a demultiplexer. Pulses corresponding to data bit one are sent to a 2D W-T-based optical encoder to perform encoding operation. The W-T encoder circuit is made up of time delay circuits and Bessel optical filters. In 2D TW codes, chosen pulses are encoded by different or similar spectral components according to the PV code algorithm (Table 1). Each optical pulse corresponding to transmitted bits is divided into w optical pulses with time delay (t) between each one of them. Finally, an encoded data stream (wavelength time-spreading patterns) is transmitted to a single-mode optical fiber through a power combiner.

Design of 2D-PV Receiver Part
The receiver structure for a conventional 2D W-T OCDMA system is shown in Figure 5. The fiber output data is demultiplexed and sent to a 2D PV decoder circuit, which consists of low-pass Bessel filters and inverse time delay circuitry. Direct detection with a single-photo diode detector or balance detection technique can be employed for signal detection with a certain threshold level set to achieve the desired output. Finally, at the receiver, both input and output data are compared by BER test set and, therefore, BER analysis is carried out by BER test set. A Spectrum analyzer and optical time domain analyzer (OTDA) are used to analyze the changes in signal power and to measure spectrum of various signals with time at different points of the system. Modulated signal/data pulses are demultiplexed using a demultiplexer. Pulses corresponding to data bit one are sent to a 2D W-T-based optical encoder to perform encoding operation. The W-T encoder circuit is made up of time delay circuits and Bessel optical filters. In 2D TW codes, chosen pulses are encoded by different or similar spectral components according to the PV code algorithm (Table 1). Each optical pulse corresponding to transmitted bits is divided into w optical pulses with time delay (t) between each one of them. Finally, an encoded data stream (wavelength time-spreading patterns) is transmitted to a single-mode optical fiber through a power combiner.

Design of 2D-PV Receiver Part
The receiver structure for a conventional 2D W-T OCDMA system is shown in Figure 5. The fiber output data is demultiplexed and sent to a 2D PV decoder circuit, which consists of low-pass Bessel filters and inverse time delay circuitry. Direct detection with a single-photo diode detector or balance detection technique can be employed for signal detection with a certain threshold level set to achieve the desired output. Finally, at the receiver, both input and output data are compared by BER test set and, therefore, BER analysis is carried out by BER test set. A Spectrum analyzer and optical time domain analyzer (OTDA) are used to analyze the changes in signal power and to measure spectrum of various signals with time at different points of the system.

Design of 2D-PV Receiver Part
The receiver structure for a conventional 2D W-T OCDMA system is shown in Figure 5. The fiber output data is demultiplexed and sent to a 2D PV decoder circuit, which consists of low-pass Bessel filters and inverse time delay circuitry. Direct detection with a single-photo diode detector or balance detection technique can be employed for signal detection with a certain threshold level set to achieve the desired output. Finally, at the receiver, both input and output data are compared by BER test set and, therefore, BER analysis is carried out by BER test set. A Spectrum analyzer and optical time domain analyzer (OTDA) are used to analyze the changes in signal power and to measure spectrum of various signals with time at different points of the system.   Figure 6 shows the proposed architecture that incorporates a maximum of K 1 × K 2 transmitters, N 2 remote nodes, and K 1 × K 2 receiver modules. Here, K 1 and K 2 represent the number of spectral and temporal code word, whereas N 2 is the temporal code length. Each subscriber is assigned with a part of the transmitter and receiver module corresponding to a 2D vector permutation code word A g,h . Furthermore, a hybrid ring and tree-based topology is adapted at the feeder and distribution level to facilitate deployment of the proposed architecture as a low-cost PON. Optical source power is set to 0 decibel-milliwatts (dBm) with data bit rate 1 Giga bit per second (t b = 1 ns).

Proposed 2D-PV W-T-Based OCDMA-PON
Entropy 2020, 22, x FOR PEER REVIEW 10 of 20 Figure 6 shows the proposed architecture that incorporates a maximum of × transmitters, remote nodes, and × receiver modules. Here, and represent the number of spectral and temporal code word, whereas is the temporal code length. Each subscriber is assigned with a part of the transmitter and receiver module corresponding to a 2D vector permutation code word , . Furthermore, a hybrid ring and tree-based topology is adapted at the feeder and distribution level to facilitate deployment of the proposed architecture as a low-cost PON. Optical source power is set to 0 decibel-milliwatts (dBm) with data bit rate 1 Giga bit per second (tb = 1 ns).  , . For illustration purpose, an example of a single user , was considered, as shown in Table 3 Table 3 shows the allocation of respective wavelengths ( ) and time delays ( ) for corresponding chips in the spectral and temporal code sequences, respectively. For example, for user , , the spectral encoding was achieved by allowing the wavelengths centered at and , whereas the temporal encoding was achieved by employing and delay instants. Furthermore, for the user , under consideration, the transmitter modules incorporate a combination of broadband light sources (BBS), temporal and spectral encoders, erbium-doped fiber amplifier (EDFA), modulation, and switching arrangement.   Figure 7 illustrates construction of the transmitter module in correspondence with the proposed 2D VP code word, A g,h . For illustration purpose, an example of a single user U 0,0 was considered, as shown in Table 3 with a X th and Y th code words of [0 0 1 0 0 0 1 0] and [0 0 1 0 1 0 0 0], respectively. In addition, Table 3 shows the allocation of respective wavelengths (λ s ) and time delays (τ s ) for corresponding chips in the spectral and temporal code sequences, respectively. For example, for user U 0,0 , the spectral encoding was achieved by allowing the wavelengths centered at λ 3 and λ 7 , whereas the temporal encoding was achieved by employing τ 3 and τ 5 delay instants. Furthermore, for the user U 0,0 under consideration, the transmitter modules incorporate a combination of broadband light sources (BBS), temporal and spectral encoders, erbium-doped fiber amplifier (EDFA), modulation, and switching arrangement.
wavelengths ( ) and time delays ( ) for corresponding chips in the spectral and temporal code sequences, respectively. For example, for user , , the spectral encoding was achieved by allowing the wavelengths centered at and , whereas the temporal encoding was achieved by employing and delay instants. Furthermore, for the user , under consideration, the transmitter modules incorporate a combination of broadband light sources (BBS), temporal and spectral encoders, erbium-doped fiber amplifier (EDFA), modulation, and switching arrangement. Initially the broadband spectrum generated by the BBS, called light emitting diode (LED), is delivered to the temporal encoding arrangement, which contains a 1: optical splitter ( ). It can be observed from Table 3 that when ℎ = 0 in , , all the code words were delayed by the same instant. Therefore, employing a single time delay unit, in comparison with the conventional technique, can significantly reduce the complexity and cost of the system. splits the incoming signal into equal portions, which are then applied to the time delay units (TUs), as shown in Figure 6. The across each line for user , was proportional to the location of one chip of the time-spreading code word , respectively, as shown in Table 3. For example, in the placement of chips in the time-spreading codeword = 3,5 , suppose unit delay equals to τ, then the delay time of the for is (3 , 5 ), respectively. End faces of both the were combined via : 1 optical combiner ( ) to complete the time-spreading encoding for the code words , , respectively. Initially the broadband spectrum generated by the BBS, called light emitting diode (LED), is delivered to the temporal encoding arrangement, which contains a 1 : w 2 optical splitter (OS TX ). It can be observed from Table 3 that when h = 0 in A g,h , all the X th code words were delayed by the same instant. Therefore, employing a single time delay unit, in comparison with the conventional technique, can significantly reduce the complexity and cost of the system. OS TX splits the incoming signal into w 2 equal portions, which are then applied to the time delay units (TUs), as shown in Figure 6. The TU TX across each line for user U 0,0 was proportional to the location of one chip of the time-spreading code word Y h , respectively, as shown in Table 3. For example, in the placement of chips in the time-spreading codeword Y T 1 = {3, 5}, suppose unit delay equals to τ, then the delay time of the TU TX for Y 1 is (3τ, 5τ), respectively. End faces of both the TU TX were combined via w 2 : 1 optical combiner (OC TX ) to complete the time-spreading encoding for the code words A g,0 , respectively. Table 3. Allocation of respective wavelengths (λ s ) and time delays (τ s ). Further, the output of the time-spreading encoder was delivered to an EDFA and 1: , where corresponds to the number of users with reference to the spectral code words. EDFA was employed prior to the splitting arrangement in order to compensate the splitter losses and maintain the integrity of the time-spread optical pulses. For user , , the first port of the 1: was delivered to the modulating arrangement where the Mach-Zhender modulator (MZM) modulates the incoming data bits with the optical signal by using an ON-OFF keying (OOK) format.
The modulated signal was delivered to the second stage of the encoding operation, namely, the spectral encoder, which was formed by the combination of 1: OS and : 1 multiplexer (MUX). Each leg of the : contained a bandpass filter that was tuned to allow the required spectrum with correspondence to the chip placement in code sequence, as shown in Table 3. Consequently, for user , , the spectral encoder allowed the spectrum located at and , respectively. Consequently, the 2D temporal and spectral encoding operation for the coder word , of user , was achieved at the transmitter module.
Further, the output of the time-spreading encoder was delivered to an EDFA and 1 : N K 1 OS TX , where N K 1 corresponds to the number of users with reference to the spectral code words. EDFA was employed prior to the splitting arrangement in order to compensate the splitter losses and maintain the integrity of the time-spread optical pulses. For user U 0,0 , the first port of the 1 : N K 1 OS TX was delivered to the modulating arrangement where the Mach-Zhender modulator (MZM) modulates the incoming data bits with the optical signal by using an ON-OFF keying (OOK) format.
The modulated signal was delivered to the second stage of the encoding operation, namely, the spectral encoder, which was formed by the combination of 1 : w 1 OS and w 1 : 1 multiplexer (MUX). Each leg of the MUX w 1 :1 contained a bandpass filter that was tuned to allow the required spectrum with correspondence to the chip placement in X th code sequence, as shown in Table 3. Consequently, for user U 0,0 , the spectral encoder allowed the spectrum located at λ 3 and λ 7 , respectively. Consequently, the 2D temporal and spectral encoding operation for the coder word A 0,0 of user U 0,0 was achieved at the transmitter module.
Then, the end face of the spectral encoder was connected to a switching arrangement (SWA) via N K 1 N K 2 : 1 optical coupler (OCU TX ). The SWA was deployed to exploit the built-in redundancy of the ring topology and ensure desired connection availability at the feeder level. The SWA, as shown in Figure 6, contained a combination of 1 : 2 OCU SWA and an optical switch, respectively, with port 1 as the input and ports 2 and 3 as the output ports, respectively. The 1 : 2 OCU SWA received the encoded spectrum from N K 1 N K 2 : 1 OCU TX via input port 1. The encoded spectrum was equally forwarded towards the output ports 2 and 3, respectively. Port 2 of the 1 : 2 OCU SWA extended towards the optical distribution network (ODN) that further connected with multiple remote nodes, whereas port 3 was fed to an optical switch 1 : 2 SW SWA, as shown in Figure 6.
Under normal working conditions, port 2 of the SW SWA is connected to an optical null and all traffic propagates in a clockwise direction towards the ODN, as shown in Figure 6 using red fiber. However, in a case of failure or cuts in the feeder fiber, Optical line terminator (OLT) unit directs the SW SWA to change its position from port 2 to port 3, which provides a clockwise and counterclockwise flow traffic until the point of failure. Consequently, the proposed architecture can provide extended connection availability along with high spectral efficiency in comparison with the existing architecture.
ODN essentially contains a combination of ring-based feeder fiber (FF R ), remote nodes RN K 2 , distribution fibers (DF N ), and optical network terminals (ONTs). One end of the FF R relates to port 2 of the OCU SWA in order to carry the traffic towards the ODN in a clockwise direction under a normal mode of operation, whereas, the other end terminated at port 3 of the SW SWA , as shown in Figure 6. FF R also contains multiple RN K 2 to carry the traffic from feeder level to the respective ONTs at the distribution level.
Each RN K 2 consisted of two OCUs with the split ratio of 1 : 2 OCU1 RN 1 and 1 : K 1 OCU2 RN 1 , respectively. For user U 0,0 , RN 1 was considered, as shown in Figure 6. The OCU1 RN 1 received the FF R through its input port 1 and split the incoming signal into two equal portions. One portion (via port 2 of the OCU1 RN 1 ) of the incoming signal was sent towards the OCU2 RN 1 , whereas another portion (via port 3 of the OCU1 RN 1 ) was forwarded towards the RN 2 ( Figure 6).
The spectral/temporal multiplexed signal was received from port 2 of the OCU1 RN 1 via the input port of the OPCU2 RN 1 . The second optical coupler at RN N had a split of 1 : K 1 , which was used to carry the encoded spectrum towards the concerned ONTs via their respective DFs.
Port 3 of the OCU1 RN 1 further extended the ring-based fiber and was connected to the RN 2 , which consisted of the similar arrangement as discussed earlier. Since the number of OCU1 RN s used throughout the network to support the given number of users was dependent of the value of Y th code sequences, it was of prime importance to keep the number of codes as few as possible to address the power constraints of the ring-based topology.
The ONT module for the proposed 2D architecture employed a time-based decoding arrangement, which was designed in accordance with the temporal encoder. It split the incoming signal into two equal portions while using a 1 : 2 OS TD . Each leg of the OS TD was connected to a TU that was calculated as (S − 1 − j), where j is the chip position in the Y T 0 code sequence for user U 0,0 . Outputs from the TUs were combined with the help of a 1 : 2 OC TD and forwarded for spectral decoding.
The spectral decoder essentially contained a balanced decoding arrangement commonly referred to as complementary subtraction detection schemes (CSD). CSD for the proposed architecture consisted of a 1:2 OS ONT that split the time decoded-signal into two equal portions. One portion was fed to a filter arrangement in the upper leg of the CSD decoder, whereas another portion was fed to another filter arrangement at the lower leg of the decoder, as shown in Figure 6. Filters in the upper leg of the CSD decoder contained a combination of fiber Bragg-grating (FBG) filters that were centered in accordance with the X 1 code spectral signature. The lower leg of the CSD decoder employed a combination of FBG filters configured to complement to the 1s in the X 1 code sequence. In other words, the lower leg of the CSD decoder for user U 0,0 extracted the spectrum that was in complement with the X 1 code sequence. Then, resulting signals from both legs of the spectral decoder related to respective PIN photodiodes in order to convert the signal from optical to electrical domain for necessary processing. The output from the PIN photodiodes was further connected to the subtractor arrangement that subtracted the output from both legs of the CSD decoder to recover the intended spectrum with maximum power units for the intended subscribers and 0 power units for interfering users.

Proof of Concept
This section analyzes the performance of the proposed setup through system implementation in an optical networks simulation software called Optisystem. The proposed system architecture presented in Figures 6 and 7 was utilized to implement the simulation model for eight subscribers accessing the medium simultaneously. To deploy eight subscribers across the network, four spectral coding schemes and two temporal schemes were utilized. Consequently, the simulation model was implemented with K 1 = 4, K 2 = 2 at g = 0, 1, 2, 3 and h = 0, 1.
The OLT module was implemented in accordance with Figure 7, which shows a transmitter module configured at g = 0, 1, 2, . . . , K 1 − 1 and h = 0. As mentioned earlier, for h = 0 in A g,h , all the spectral code sequences could be delayed by the same instant. Therefore, two LEDs followed by two temporal decoders were employed to configure encoding arrangements for eight subscribers accessing the medium simultaneously. Now, for h = 0, four subscribers were configured with a single broad-spectrum LED that related to time delay units through a 1:2 optical splitter having 0 dB loss. Both legs of the optical splitter were fed into time delay units that were configured in accordance with the position of 1s in the Y T 0 coding scheme. For instance, the TU connected with the top leg of the splitter was delayed by an amount of 3 Bit rate * 8 , whereas the bottom TU was configured with the delay of 5 Bit rate * 8 , respectively. Similarly for h = 1, the TUs were configured with the delays of 6 Bit rate * 8 and 8 Bit rate * 8 in accordance with the position of 1s at the Y T 1 coding scheme. The end face of the TUs were connected to a 2:1 optical combiner with 0 dB loss, followed by an EDFA module. Specification of the system components used during simulation analysis are given as Table 4. The amplified time-delayed signal from EDFA module related to a 1:4 optical coupler, in accordance with K 1 = 4. Each output leg of the coupler was fed into an individual MZM in order to modulate the signal with the user's information. After modulation, the process of spectral encoding was initiated by employing a combination of 1:2 optical splitter and MUX arrangement. MUX arrangement for each subscriber was configured to reflect the frequency bins in accordance with position of 1s in the X g code sequence. Then, for user U 0,0 , the spectral encoder allowed the spectrum located at λ 3 and λ 7 , respectively. Similarly, for user U 0,1 , a spectral encoding arrangement with same filter configuration was used to allow the spectrum located at λ 3 and λ 7 , respectively. Consequently, the 2D temporal and spectral encoding operation for the coder word A 0,0 till A 3,1 was achieved at the transmitter module.
Outputs from the spectral encoders were connected to an 8:1 optical coupler followed by 1:2 coupler having 0 dB loss and were configured in accordance with Figure 6. Moreover, two remote nodes were employed in the simulation model, in accordance with K 2 = 2. The ONT module for the simulation arrangement was configured accordingly to recover and detect the intended spectrum, in accordance with the proposed coding scheme. Each ONT module started with a 1:2 optical splitter to initiate the process of temporal decoding. Each leg of the splitter was fed to a TU with delays calculated through (S − 1 − j). The end face of each TU related to a 2:1 optical combiner to conclude the process of temporal decoding. This process was followed by spectral decoding that was implemented with the help of balanced detectors. Balanced detectors split the incoming signal into two parts. One part was applied to an arrangement of FBG filters that were configured in accordance with spectral signature of the encoder.
For example, for user U 0,0 , FBG filters at the top leg were configured to recover λ 3 and λ 7 , whereas the FBG filter employed at the bottom leg was used to recover the complement of the intended signature. The output of both filter arrangements was passed through PIN photodiodes and subtracted to recover the intended spectrum with maximum auto-and minimum cross-correlation. Then, for the initial analysis, the performance of the proposed system was analyzed in terms of data rate versus bit error rate. Moreover, with an EDFA of 9 dB gain, power at the ONTs of the first remote node RN 1 was set at 0 dBm, respectively. Figure 8 shows the eye diagrams and BER of the proposed setup at 1 Gbps and 2 Gbps of data for randomly selected nodes of ONT RN 1 . It was observed that the proposed setup was well able to support high data rates of up to 2 Gbps. Moreover, analysis of the BER and eye diagrams validated the implementation setup such that BER increased with an increase in the amount of data transmitted between the OLT and ONTs' modules. Then, for the initial analysis, the performance of the proposed system was analyzed in terms of data rate versus bit error rate. Moreover, with an EDFA of 9 dB gain, power at the ONTs of the first remote node was set at 0 dBm, respectively. Figure 8 shows the eye diagrams and BER of the proposed setup at 1 Gbps and 2 Gbps of data for randomly selected nodes of . It was observed that the proposed setup was well able to support high data rates of up to 2 Gbps. Moreover, analysis of the BER and eye diagrams validated the implementation setup such that BER increased with an increase in the amount of data transmitted between the OLT and ONTs' modules.
This can be attributed to the fact that pulse width decreased with an increase in the data bits, which made the system more vulnerable to distortion across the medium. Consequently, a higher data rate will yield a higher BER. However, analysis showed that for an agreeable BER of 10 the proposed setup was able to provide the desired performance up to 2 Gbps of data, owing to the efficient cross-correlation properties at the code sequence and proficient design of the proposed setup that maintained a nominal signal power to yield a desired signal-to-noise ratio and, hence, BER. To further analyze the impact of the power budget on the overall performance of the setup, analysis was made at 1 Gbps of data by randomly selecting nodes at each remote node from − . Moreover, through the application of nine EDFA at the transmitter module, 0 dBm, −3 dBm, and −6 dBm power was observed at the , , and , respectively. Eye diagrams and BER analysis in Figure 9 show that the proposed setup was capable enough to handle the power drops at each remote node and provide desired results for an acceptable BER of 10 . Results' analysis also validated the proposed model, which showed a relevant decrease in the BER along with a decrease in the power each ONT of alternated remote nodes. This can be attributed to the fact that pulse width decreased with an increase in the data bits, which made the system more vulnerable to distortion across the medium. Consequently, a higher data rate will yield a higher BER. However, analysis showed that for an agreeable BER of 10 −9 the proposed setup was able to provide the desired performance up to 2 Gbps of data, owing to the efficient cross-correlation properties at the X th code sequence and proficient design of the proposed setup that maintained a nominal signal power to yield a desired signal-to-noise ratio and, hence, BER.
To further analyze the impact of the power budget on the overall performance of the setup, analysis was made at 1 Gbps of data by randomly selecting nodes at each remote node from RN 1 − RN 3 . Moreover, through the application of nine EDFA at the transmitter module, 0 dBm, −3 dBm, and −6 dBm power was observed at the ONT RN 1 , ONT RN 2 , and ONT RN 2 , respectively. Eye diagrams and BER analysis in Figure 9 show that the proposed setup was capable enough to handle the power drops at each remote node and provide desired results for an acceptable BER of 10 −9 . Results' analysis also validated the proposed model, which showed a relevant decrease in the BER along with a decrease in the power each ONT of alternated remote nodes.  To further analyze the impact of the power budget on the overall performance of the setup, analysis was made at 1 Gbps of data by randomly selecting nodes at each remote node from − . Moreover, through the application of nine EDFA at the transmitter module, 0 dBm, −3 dBm, and −6 dBm power was observed at the , , and , respectively. Eye diagrams and BER analysis in Figure 9 show that the proposed setup was capable enough to handle the power drops at each remote node and provide desired results for an acceptable BER of 10 . Results' analysis also validated the proposed model, which showed a relevant decrease in the BER along with a decrease in the power each ONT of alternated remote nodes.
(a) In order to analyze the impact of the switching arrangement and observe the capability of the proposed setup to handle traffic in both clockwise and counterclockwise directions, the proposed model was simulated with an optical switch after the transmitter module. Moreover, for fair analysis, the number of simultaneous users accessing the medium was reduced to = 4, = 2 with = 8. Analysis was performed at 1 Gbps of data and port 2 of the switch was initially engaged to observe the flow of traffic in a clockwise direction. In the second phase of the simulation, port 3 was engaged to analyze the flow of traffic in a counterclockwise direction to mimic a state of failure. In order to analyze the impact of the switching arrangement and observe the capability of the proposed setup to handle traffic in both clockwise and counterclockwise directions, the proposed model was simulated with an optical switch after the transmitter module. Moreover, for fair analysis, the number of simultaneous users accessing the medium was reduced to K 1 = 4, K 2 = 2 with N 2 = 8. Analysis was performed at 1 Gbps of data and port 2 of the switch was initially engaged to observe the flow of traffic in a clockwise direction. In the second phase of the simulation, port 3 was engaged to analyze the flow of traffic in a counterclockwise direction to mimic a state of failure. Figure 10 shows the eye diagrams and BER analysis for the flow of traffic in both clockwise and counterclockwise directions. It is evident that the proposed setup was able to support the flow of traffic in both directions with minuscule effect on the overall performance. It can be observed that for 1 Gbps of data almost the same BER was obtained at the randomly selected ONT of RN 1 (clockwise flow of traffic) and RN 2 (counterclockwise flow of traffic). Hence, the proposed VP-based 2D OCDMA system was not only able to provide high capacity in terms of data, reach, and the number of users, but was also capable of providing relative support against feeder fiber failure, which is novel, as compared to the existing 2D OCDMA architecture. of traffic in both directions with minuscule effect on the overall performance. It can be observed that for 1 Gbps of data almost the same BER was obtained at the randomly selected ONT of (clockwise flow of traffic) and (counterclockwise flow of traffic). Hence, the proposed VP-based 2D OCDMA system was not only able to provide high capacity in terms of data, reach, and the number of users, but was also capable of providing relative support against feeder fiber failure, which is novel, as compared to the existing 2D OCDMA architecture.   The 2D PV code performance, in terms of BER and number of supportable clients, is shown in Figure 11. As the number of users increased the quality of the received signal deteriorated due to the occurrence of MAI among them. Thus, system signal to noise ratio (SNR) and BER degraded. Moreover, BER values of 2D PV code (K1 = 62, K2 = 3; where K1 and K2 refers to number of subscribers in spectral and spatial domain) were compared with existing techniques: Diluted perfect difference code (M = 63, P = 3) and diagonal eigenvalue unity code (M = 63, P = 3; M and P represents number of subscribers in spectral and spatial domain). It was observed that supported clients were 20, 40, and 110 for 2D diluted perfect difference (DPD), 2D diagonal eigen value (DEU), and 2D PV code, respectively, at the minimum acceptable BER value of 10 −9 . In particular, multi diagonal (MD) code (M = 63, P = 3) is also plotted and results indicate an overlap with our proposed code due to their similar properties.
represents number of subscribers in spectral and spatial domain). It was observed that supported clients were 20, 40, and 110 for 2D diluted perfect difference (DPD), 2D diagonal eigen value (DEU), and 2D PV code, respectively, at the minimum acceptable BER value of 10 −9 . In particular, multi diagonal (MD) code (M = 63, P = 3) is also plotted and results indicate an overlap with our proposed code due to their similar properties.

Conclusions
A new 2D PV coding scheme was proposed based on a WHTS coding approach and possesses several advantages over the existing families, such as simplicity of code construction, no limitation of the selection of any positive integer weight, and high degree of cardinality with increased flexibility. The proposed code can be employed for both synchronous and asynchronous incoherent OCDMA environment. Results indicated that 2D W-T PV code had improved system performance due to reduced error probability with MAI and phase induced intensity noise (PIIN) effects suppression and easier code implementation capabilities. For future implementations, simple direct detection method can be employed in the receiver design, which is cost effective and less complex due to the utilization of single-photo diode and low-pass filter circuit. The numerical results indicated that the 2D PV code provided better performance in terms of system parameters such as transmitted power at the source, cardinality, BER, and data rate. The simulation results demonstrated successful implementation of the 2D PV-based OCDMA scheme and make it applicable for all optical networks in practice by maintaining optimal BER (10 −9 ) required for error-free transmission at minimum data rate.

Conclusions
A new 2D PV coding scheme was proposed based on a WHTS coding approach and possesses several advantages over the existing families, such as simplicity of code construction, no limitation of the selection of any positive integer weight, and high degree of cardinality with increased flexibility. The proposed code can be employed for both synchronous and asynchronous incoherent OCDMA environment. Results indicated that 2D W-T PV code had improved system performance due to reduced error probability with MAI and phase induced intensity noise (PIIN) effects suppression and easier code implementation capabilities. For future implementations, simple direct detection method can be employed in the receiver design, which is cost effective and less complex due to the utilization of single-photo diode and low-pass filter circuit. The numerical results indicated that the 2D PV code provided better performance in terms of system parameters such as transmitted power at the source, cardinality, BER, and data rate. The simulation results demonstrated successful implementation of the 2D PV-based OCDMA scheme and make it applicable for all optical networks in practice by maintaining optimal BER (10 −9 ) required for error-free transmission at minimum data rate.