# Nonlinear Effect and MAI Impact on SAC-OCDMA System Based on 2D Multi-Diagonal Code and Laser Array
## 3 SAC-OCDMA System Description  
The 2D-MD code is designed using two 1D-MD code sequences, where the code length \(L\) is defined by [14]:  
\[L=w\cdot K \tag{1}\]  
where \(w\) is the code weight and \(K\) is the number of users. Due to the ZCC proprieties (i.e., cross correlation between two adjacent codes is equal to zero), MAI effects are totally canceled for 1D-MD code. Therefore, 1D-MD code can be designed using the following steps [25]:  
Step 1: Depending on several diagonal matrices by choosing the corresponding weight and user number \"\(w\)\" and \"\(K\)\", both \"\(m\)\" and \"\(n\)\" can be configured where \(m\in[1,\ K]\) and \(n\in[1,\ w]\) refer to the rows number and the diagonal matrices number in each matrix, respectively. Step 2: Each diagonal matrix in MD code can be expressed by:  
\[S_{m,n}=\left\{ \begin{array}{ll}K+1-m&if\ \ \ \ n=even\ number\\ m&if\ \ \ \ \ \ n=odd\ number\end{array} \right.\]  
\[S_{m,1}=\left[ \begin{array}{c}1\\ 2\\ 3\\ \vdots\\ K\end{array} \right]\,\ S_{m,2}=\left[ \begin{array}{c}K\\ \vdots\\ 3\\ 2\\ 1\end{array} \right]\,\ \ldots\ \ldots\,\ S_{m,w}=\left[ \begin{array}{c}1\\ 2\\ 3\\ \vdots\\ K\end{array} \right]\]  
Each one of the above elements refers to column in \(I_{m,n}\) square matrices with \(K\times K\) order. \[I_{m,1}=\left[S_{m,1}\right]_{K\times K},\ I_{m,2}=\left[S_{m,2}\right]_{K \times K},\ \ldots\ \ldots\,\ I_{m,w}=\left[S_{m,w}\right]_{K\times K}\]  
\(I_{m,n}\) can be expressed as:  
\[I_{m,1}=\left[ \begin{array}{cccc}1&0&\ldots&0&0\\ 0&1&\ddots&0&0\\ \vdots&\ddots&\vdots&\vdots&\vdots&\vdots&\\ 0&0&\ldots&0&1\end{array} \right]\]  
Step 3: Combining different \(I_{m,n}\) matrices conducts to obtain 1D-MD matrix as follows:  
\[MD=\left[ \begin{array}{cccc}I_{m,1}&\vdots&I_{m,2}&\vdots&\ldots&\ldots& \vdots&I_{m,w}\end{array} \right]_{K\times L} \tag{2}\]  
Table 1 represents an example of 1D-MD code for \(w\) = 3, \(K\) = 4 and L = 12 [11]. In SAC-OCDMA system, a code is described with 5-tuplet (\(K\), \(L\), \(w\), \(\lambda_{\rm a}\), \(\lambda_{\rm c}\)) where \(K\), \(L\), \(w\), \(\lambda_{\rm a}\) and \(\lambda_{\rm c}\) are defined as the number of simultaneous users, the code length, the code weight, the auto-correlation and the cross-correlation of the code. Table 1 exhibits the SAC-OCDMA 1D-MD codes description for (\(K\) = 4, \(L\) = 12, \(w\) = 3, \(\lambda\)c = 0) while performing the time and wavelength spreading, respectively [14]. Table 2 presents an example of 2D-MD code time spreading description generated from two 1D-MD codes X = [100110] and Y = [011001] with (\(w_{1}\) = 3, \(k_{1}\) = 2, \(w_{2}\) = 3 and \(k_{2}\) = 3). Where \(w_{1}\), \(w_{2}\), \(k_{1}\)_and_\(k_{2}\) represent X and Y codes weight and size. In addition, we define \(M=w_{1}k_{1}\) and \(P=k_{2}\),\(w_{2}\) as the code length of X and Y used to build the 2D-MD code. \begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline
**m** & \multicolumn{8}{c}{**m-Sequence**} \\ \hline
2 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 \\
3 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 \\
4 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 1 \\Note that the 2D-MD codes are selected thanks to the ZCC propriety leading to limit the MAI. Recall that the MAI is considered as the most important OCDMA system performance limitation [14]. In fact, MAI is due to the overlap between the common chips of the user's code in time or spectral axis in the combined signal when it is transferred through the optical channel. According to Table 2 that describes the 2D-MD time spreading, the overlap chips are represented with red color. However, to reduce the MAI we suggested 12 wavelengths for the spectral spreading as depicted in Table 3 to serve four users. Furthermore, to minimize the overlap between the different wavelengths, we select a bandwidth equal to 0.8 nm between the 12 selected wavelengths.