## 2 Three-Dimensional Single Weight Zero Cross Correlation Code Construction  
The construction of the 3D-SWZCC code is based on the 1D-SWZCC code using the identity matrix and shifting property. It is represented by the parameters, 'K', '\(\lambda\)c', 'w', and '\(L\)', which refer to the number of simultaneous users, in-phase cross-correlation, code weight, and code length, respectively. The code length (L) is expressed as follows [1]:  
\[L=K \tag{1}\]  
The code has many advantages: the zero cross-correlation (ZCC) property can minimize the spectrum overlapping from different users and provide more flexibility in the code length and a constant weight equal to exactly one. For that, this justifies the reason of its name as single weight. In addition, it can supply a high number of users with a high data rate using a low light source. The construction steps of the SWZCC code can be briefly described as follows:First, generate a square matrix (I\({}_{\text{L}}\)) (such that all its elements are zeros except the main diagonal elements, which are all equal to one. For example, \(L=3\), so \(I_{3}\) will be written as:  
\[I_{3}= \begin{bmatrix}1&0&0\\ 0&1&0\\ 0&0&1\end{bmatrix}  \tag{2}\]  
Second, by virtue of the shifting property applied vertically (between rows) and in addition according to the rule \(L-1\), \(I_{3}\) needs to be shifted twice, where the matrix resulting from the first shift is also shifted twice. Consequently, \(I_{3}\) will transform from order (3) to order (9 \(\times\) 3); in another sense, the number of users is squared with the same code length. \[I_{L^{2},L}= \begin{bmatrix}1&0&0\\ 0&1&0\\ 0&0&1\\ 0&1&0\\ 0&0&1\\ 1&0&0\\ 0&1&0\end{bmatrix}  \tag{3}\]  
Obviously, \(I^{\prime}_{g\times 3}\) can be split into three sub-matrices \(a_{i}\), as in Equation (4), where (\(i=1,2,\ldots,L\)):  
\[A_{1}= \begin{bmatrix}a_{1}\\ a_{2}\\ a_{3}\end{bmatrix}  \tag{4}\]  
where  
\[a_{1}= \begin{bmatrix}1&0&0\\ 0&1&0\\ 0&0&1\end{bmatrix} ,\;a_{2}= \begin{bmatrix}0&1&0\\ 0&0&1\\ 1&0&0\end{bmatrix} ,\;\text{and}\;a_{3}= \begin{bmatrix}0&0&1\\ 1&0&0\\ 0&1&0\end{bmatrix}  \tag{5}\]  
Note that the cross-correlation between two adjacent code sequences in the matrix \(I^{\prime}_{g\times 3}\) is constant and equal to one. To decrease the cross-correlation value from one to zero while keeping the same number of users, the technique of code spreading is used on the \(I^{\prime}_{g\times 3}\) matrix. To do this, a zero matrix of order \(L^{2}\times L^{2}\) is generated and then split into three sub-matrices of order 9 \(\times\) 3, as in Equation (6), which presents the entire third step. \[Zeros= \begin{bmatrix}\mathbf{0}&0&0&\mathbf{0}&0&0&\mathbf{0}&0&0\\ \mathbf{0}&0&0&\mathbf{0}&0&0&\mathbf{0}&0&0\\ \mathbf{0}&0&0&\mathbf{0}&0&0&\mathbf{0}&0&0\\ 0&\mathbf{0}&0&0&\mathbf{0}&0&0&\mathbf{0}&0\\ 0&\mathbf{0}&0&0&\mathbf{0}&0&0&\mathbf{0}&0\\ 0&\mathbf{0}&0&0&\mathbf{0}&0&0&0&\mathbf{0}\\ 0&0&\mathbf{0}&0&0&\mathbf{0}&0&0&\mathbf{0}\\ 0&0&\mathbf{0}&0&0&\mathbf{0}&0&0&\mathbf{0}\\ 0&0&\mathbf{0}&0&0&\mathbf{0}&0&0&\mathbf{0}\\ 0&0&\mathbf{0}&0&0&\mathbf{0}&0&0&\mathbf{0}\end{bmatrix}  \tag{6}\]  
Fourth, sub-matrices \(a_{1}\), \(a_{2}\), and \(a_{3}\) are divided into column vectors. Sub-matrix \(a\) is divided into \(a_{11}\), \(a_{12}\), and \(a_{13}\), which represent the first, second, and third columns of \(a\), respectively; the division is similar for \(a_{2}\) and \(a_{3}\), which are divided into \(a_{21}\), \(a_{22}\), and \(a_{23}\) and \(a_{31}\), \(a_{32}\), and \(a_{33}\), respectively. Fifth, the column vectors of \(a\) are arranged as diagonal elements of the first \(9\times 3\) sub-matrix of the zero matrix. With the same pattern, the column vectors of \(a_{2}\) and are also arranged as the diagonal elements of the second and third \(9\times 3\) sub-matrices, respectively, of the zero matrix. \[SWZCC=