## 3 Proposed 2D DW-ZCC Code  
The OCDMA codes based on SAC are simple and efficient 1D codes, and have been proposed as an excellent means of cancelling the MAI using balanced detection; in addition, they have high spectral efficiency and built-in security features [32]. However, these codes become inefficient when handling an increasing number of on-body sensors [32]. Therefore, multidimensional OCDMA codes were developed by combining different characteristics of the signal to resolve this drawback of 1D OCDMA codes [32]. The spectral/spatial combination is the most attractive approach for implementing 2D OCDMA codes. The proposed 2D-spectral/spatial DW-ZCC code is formed by a combination of 1D DW-ZCC codes employed in the spectral/spatial domain. The DW family of codes is primarily composed of three variants: DW, modified double weight (MDW), and enhanced double weight (EDW). The name \"double weight\" comes from the fact that chips of the code sequence are placed adjacent to one another. This property of DW codes make them superior to their existing counterparts due to their ease of design and implementation, as it reduces the number of filters used in the encoder and decoder. Each DW code has unique characteristics related to its weight (w), auto- and cross-correlation properties \(\left(\lambda_{a},\lambda_{c}\right)\), and code length \(\left(l_{c}\right)\). Among the family of DW codes, DW is the oldest code, first presented in [41]. DW code essentially consists of a \(K\times N\) matrix, where \(K\) is the number of sensors and \(N\) is the code length. The basic \(2\times 3\) DW code matrix can be written as follows. \[Z_{B}=\left[ \begin{array}{ccc}1&1&0\\ 0&1&1\\ \end{array} \right]_{2\times 3}\]  
It can be observed that the conventional DW code has \(w=2\), \(\lambda_{c}=1\), and \(l_{c}=\frac{3K}{2}+\frac{1}{2}\left[\sin\frac{k_{T}}{2}\right]^{2}\). In order to develop a code with adjacent code placement and zero cross-correlation property, the conventional DW code matrix can be modified as follows. Figure 1: Illustration of the proposed work. The DW-ZCC code matrix has \(w=2\), \(\lambda_{c}=0\), and \(l_{c}=x\times K\). It can be observed that reduction in the cross-correlation property to an ideal zero increases the code length in comparison with its conventional counterpart, as well as that the code length is inversely proportional to the number of users. Furthermore, long code lengths are considered disadvantageous in implementations, as either very wideband sources or very narrow filter bandwidths are required [42]. Therefore, in order to ensure a large cardinality system, in this paper we propose a 2D-spectral/spatial DW-ZCC code that employs 1D DW-ZCC code along the spectral domain and spatial domain (the X\({}^{th}\) and Y\({}^{th}\) axes, respectively). The length of both code sequences is dependent on the weight and the total number of code words. The proposed code is denoted by \(\left(M\times N,w,\lambda_{a},\lambda_{c}\right)\), where M\(\times\)N represents size of the 2D-spectral/spatial DW-ZCC code, w is weight of the code, and \(\lambda_{a}\) and \(\lambda_{c}\) respectively represent the auto- and cross-correlation properties of the proposed code. Let \(Y\Big{\{}y_{1},y_{2},y_{3}\ldots\ldots y_{N}\Big{\}}\) represent the 1D DW-ZCC code sequences employed in the spatial domain and let \(X\Big{\{}x_{1},x_{2},x_{3}\ldots\ldots x_{N}\Big{\}}\) be 1D DW-ZCC code sequences utilized in the spectral domain. An example for two different 1D enhanced multi-diagonal (EMD) sets X and Y with \(w_{1}=2\) and \(w_{2}=2\) is shown in Table 1.  
Now, both the X\({}^{th}\) and Y\({}^{th}\) code sequences are used to build the proposed 2D-spectral/spatial DW-ZCC code matrix as described below.