1 Introduction

The need for augmenting the number of simultaneous users and the quantity of information with the same bandwidth to transmit them over single channel at the same time and high speed, optical code division multiple access (OCDMA is the solution for optical communication networks where each user is given a specific code (Cherifi et al. 2018). Overall, OCDMA systems are composed of three kinds of schemes called: spectral amplitude coding (SAC), time spreading and frequency-hopping schemes (Jellali et al. 2017a, b).

Multiple access interference (MAI) degrades the system performance which arises from the superposition of signals between active users and sources of noise at receiver are shot noise, thermal noise and phase induced intensity noise (PIIN). (Kadhim et al. 2015). By using spectral amplitude coding (SAC) with fixed in phase cross correlation in OCDMA systems, were proposed due to remove the MAI effect (Lin et al. 2005).

OCDMA systems can be classified into two categories: coherent and non coherent schemes which depend on the nature of the optical signals overlapping. The coherent OCDMA systems use the bipolar codes (− 1) and (+ 1) which guarantees the orthogonalaity property between the codes, and coherent property of light. Whereas the incoherent OCDMA systems use the unipolar codes (0) and (1) and incoherent light sources such as light emitting diode (LED) (Yen and Chen 2016).

The OCDMA has been attracted the attention thanks to its offered advantages, for example: it can combine advantages both of frequency division multiple access (FDMA) and time divison multiple acces (TDMA), add and delete users easily, transmit the data securely and accommodate high system capacity, dynamic bandwidth and multimedia services (Yin and Richardson 2007; Jellali et al. 2017a, b; Najjar et al. 2017; Cherifi et al. 2019).

Many advantages of OCDMA system are introduced comparing to OTDMA and WDM techniques such as: Channel bandwidth efficiency, data reliability, and efficient network control configuration (Cherifi et al. 2019).

Currently, various applications of the OCDMA system are existed as local area network (LAN) (Mrabet et al. 2017), passive optical network PON (Mhatli et al. 2018; Yang et al. 2018) and LR-PON (Mhatli et al. 2018; Ahmed 2019), multimedia (Kumawat and Kumar Maddila 2017; Li et al. 2014), Metropolitan area network (MAN), cellular underwater wireless OCDMA (UW-OCDMA) network (Akhoundi et al. 2016),and terrestrial free space optical (FSO) link (Ahmed et al. 2019).

A several researches are interesting on OCDMA technique because it can present a large bandwidth, security, and flexibility in high speed access networks.

Kadhim et al. (2015) suggested the 3D perfect difference/multi diagonal (3D-PD/MD) codes in domain wavelength/time/space. This suggested code is employed the balanced detection and eliminates the receiver noises by minimising the receiver complexity to 50% of the 3D-PD codes.

In Yeh et al. (2009) developed the perfect difference (3D-PD) codes in domain wavelength/time/space with corresponding system structure where the phase induces intensity noise (PIIN) is minimised thanks to property of multi access interference (MAI) cancellation and he employed the balanced detection.

In order to minimize the receiver complexity and ameliorate the system performance, in this work a novel three dimensional Pascal’s triangle zero cross correlation (3D-PTZCC) code has been suggested and implemented in matlab software. The numerical results show that our proposed system outperforms the 1D-PTCC, 2D-PTZCC, 3D-PD and 3D-PD/MD codes reported recently for the same code length.

The Performance of the proposed system are validated and justified using the optisystem software which makes it practicable and applicable in optical multi-access networks in term of maximum Q factor value and minimum value of BER Compared with the previous systems described above. In particular, the suggested system gave the best value of Bit Error rate(BER) are around \(10^{ - 18}\) is less than the value of \(10^{ - 9}\) which is acceptable in optical system and in the same time the number of users (Cardinality) are increased significantly.

The rest of this paper is organised as follows: second section explain construction of PTZCC code, third section description of corresponding system architecture. In fourth and fifth sections, discussing of the analytical and numerical results. At last section, conclusion presentation.

2 3D-PTZCC Code construction

It is based on the 1D-PTZCC and distinguished by these parameters \(\left( {{\text{C}},{\rm{L}},{\text{p}},\uplambda_{\rm{c}} } \right)\) where (C) is the number of users, (L) is the code length, (p) refers to code weight and finally (\(\uplambda_{\text{c}}\)) is the in phase cross correlation. The 1D-PTZCC C × L matrix and the code length can be expressed as code (Cherifi et al. 2018):

$${\text{L}} = {\text{p\,*\,C}}$$
(1)

On the other hand, the superposition of signals from different users is reduced because zero cross correlation property. The 1D-PTZCC is distinguished by flexibility to choose the code length and code weight, easy steps to construct, accommodates large number of simultaneous users and high data rate.

The design of Pascal’s triangle is related to the coefficients of binomial by Pascal’s rule which is defined as:

$$\left( {{\text{a}} + {\text{b}}} \right)^{\text{n}} = \mathop \sum \limits_{{{\text{k}} = 0}}^{\text{n}} \left( {\begin{array}{*{20}c} n \\ k \\ \end{array} } \right){\text{a}}^{{{\text{n}} - {\text{k}}}} \cdot {\text{b}}^{\text{k}}$$
(2)
$$\left( {\begin{array}{*{20}c} {\text{n}} \\ {\text{k}} \\ \end{array} } \right) = \left( {\begin{array}{*{20}c} {{\text{n}} - 1} \\ {{\text{k}} - 1} \\ \end{array} } \right) + \left( {\begin{array}{*{20}c} {{\text{n}} - 1} \\ {\text{k}} \\ \end{array} } \right) = \frac{{{\text{n}}!}}{{{\text{k}}!\left( {{\text{n}} - {\text{k}}} \right)!}}$$
(3)

where \({\text{n}}\) and \({\text{k}}\) present any positive integers and \({\text{k }} = 0, 1, . . ., {\text{n}}\). The following type indicates the first six rows of triangle of Pascal (Fig. 1).

Fig. 1
figure 1

The first six rows of Pascal’s triangle

3 Type of Pascal’s triangle matrix (PTM)

Nisar (2016) proposed a new method for constructing ZCC code based on Pascal’s triangle rule called Pascal’s triangle matrix code (PTMC). The PTM is composed of binary numbers (zeros and ones) and it begins from the second row of PT constructed as following:

All numbers which don’t equal (1), are replaced by (0) and the outer branches of PT are filled by zeros. So that, we can write the PTM with \(6\) rows and 12 columns as following (Cherifi et al. 2018):

$$PTM_{2} = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \right]_{6 \times 12}$$
(4)

Also, PTM can begin from the third row of PT where we can write PTM with 6 rows and 13 columns as following:

$$PTM_{3} = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & {\begin{array}{*{20}c} 1 & 1 \\ \end{array} } & {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \right]_{6 \times 13}$$
(5)

Overall, PTM can be defined by the following form [1]:

$$PTM_{n} = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 & 0 \\ \vdots & \vdots & 0 \\ \vdots & 0 & 1 \\ \end{array} } & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} { \ldots n times \ldots } & 1 \\ \end{array} } \\ 1 & 0 & {\begin{array}{*{20}c} { \ldots \ldots \ldots \ldots \ldots \ldots } & 0 \\ \end{array} } \\ 0 & \ldots & { \ldots \begin{array}{*{20}c} { \ldots \ldots \ldots } & \ldots \\ \end{array} } \\ \end{array} } & {\begin{array}{*{20}c} 0 & {\begin{array}{*{20}c} \ldots & \ldots & 0 \\ \end{array} } \\ 1 & {\begin{array}{*{20}c} 0 & \ldots & \vdots \\ \end{array} } \\ 0 & {\begin{array}{*{20}c} 1 & 0 & \vdots \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 1 & 0 \\ 1 & 0 & \ldots \\ \end{array} } & {\begin{array}{*{20}c} \ldots & \ldots & {\begin{array}{*{20}c} { \ldots \ldots \ldots } & \ldots \\ \end{array} } \\ \ldots & \ldots & {\begin{array}{*{20}c} { \ldots \ldots \ldots } & \ldots \\ \end{array} } \\ \end{array} } & {\begin{array}{*{20}c} \ldots & {\begin{array}{*{20}c} 0 & 1 & 0 \\ \end{array} } \\ \ldots & {\begin{array}{*{20}c} \ldots & 0 & 1 \\ \end{array} } \\ \end{array} } \\ \end{array} } \right]$$
(6)

3.1 Left Pascal’s type triangle matrix (LPTM) and right Pascal’s type triangle matrix (RPTM)

The LPTM and RPTM can be defined by taking the left half and right half of PTM respectively. Thus, the LPTM and RPTM with 6 rows and 6 columns can be written as following:

$$LPTM = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \right]\quad {\text{and}}\quad RPTM = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \right]$$
(7)

4 Code construction

As mentioned above, the PTZCC code can be designed helping of Pascal’s rule, described by the following stages (Cherifi et al. 2018; Jyoti and Kaler 2011):

Stage 1

At the beginning, \({\text{p}}\). mes are filled in the pth row of PTM then ones are added diagonally.

Stage 2

The rested places are filled with zeros in the PTM.

Stage 3

There are two cases:

First case If the code weight \(\left( p \right)\) is odd, so \(p = 2n + 1\) and \(= 1,2,3, \cdots\). Then, \(p - \left( {n + 2} \right)\) RTM and \(p - \left( {n + 1} \right)\) LTM with PTM resulted by stage 1 and stage 2.

Second case If the code weight \((p > 2)\) is even, \(p = 2n\) and \(n = 2,3, \cdots\). Then, \(p - \left( {n + 1} \right)\) RPTM and \(p - \left( {n + 1} \right)\) LPTM with PTM resulted by stage1 and stage 2.

Stage 4

To augment the users number, the code size of RPTM and LPTM is augmented and repeated stage 1–stage 3.

Case 1\(p = 2\) and \(C = 3\).

In this case, the PTM code is generated directly.

$$PTZCC = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 1 & {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \right]_{3 \times 6}$$
(8)

Case 2\(p = 4\) and \(C = 3\)

Stage 1

\(p = 4\) times "ones" are filled in the fourth row of PTM then ones are added diagonally.

Stage 2

The rested places are filled with "zeros" in the PTM.

Stage 3

In this case, the code weight is even and (\(p > 2)\), so \(p = 2n = 2 \times 2 = 4\). It has to add \(p - \left( {n + 1} \right) = 4 - \left( {2 + 1} \right) = 1\) RPTM and \(p - \left( {n + 1} \right) = 4 - \left( {2 + 1} \right) = 1\) LPTM with PTM resulted by stage1 and stage 2.

$$\left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 & 0 \\ \end{array} } & 0 & {\begin{array}{*{20}c} {\begin{array}{*{20}c} 1 & 1 & 1 \\ \end{array} } & 1 & {\begin{array}{*{20}c} 0 & {\begin{array}{*{20}c} 0 & 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 1 & 0 \\ \end{array} } & 1 & {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 & 0 \\ \end{array} } & 0 & {\begin{array}{*{20}c} 1 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } & 1 & 0 \\ \end{array} } \\ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 1 & 0 & 1 \\ \end{array} } & 0 & {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 & 0 \\ \end{array} } & 0 & {\begin{array}{*{20}c} 0 & {\begin{array}{*{20}c} 1 & 0 & 1 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \right]_{4 \times 12}$$
(9)

Case 3\(p = 3\) and \(C = 3\)

Stage 1

\(p = 3\) times "ones" are filled in the third row of PTM then ones are added diagonally.

Stage 2

The rested places are filled with "zeros" in the PTM.

Stage 3

In this case, the code weight is odd, so \(p = 2n + 1 = 2 \times 1 + 1 = 3\). It has to add \(p - \left( {n + 2} \right) = 3 - \left( {1 + 2} \right) = 0\) RPTM and \(p - \left( {n + 1} \right) = 3 - \left( {1 + 1} \right) = 1\) LPTM with PTM resulted by stage 1 and stage 2 (Cherifi et al. 2018).

$$\left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 1 & 1 & {\begin{array}{*{20}c} 1 & 0 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 1 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 1 & 0 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 1 & 0 & {\begin{array}{*{20}c} 0 & 0 & {\begin{array}{*{20}c} 0 & 0 & 1 \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \right]_{3 \times 9}$$
(10)

The 3D-PTZCC code can be designed based 1D-PTZCC code by taking three sequences X, Y and Z have code length M, N and P respectively where \(M = C_{1} p_{1}\), \(P = C_{2} p_{2}\) and \(N = C_{3} p_{3}\). \(X = \left\{ {x_{0} ,x_{1} ,x_{2} , \ldots \ldots ,x_{M - 1} } \right\}\) has code size \(C_{1}\) and code weight \(p_{1}\). Similary the code sequences \(Y = \left\{ {y_{0} ,y_{1} ,y_{2} , \ldots \ldots ,y_{N - 1} } \right\}\) and \(Z = \left\{ {z_{0} ,z_{1} ,z_{2} , \ldots \ldots ,z_{P - 1} } \right\}\) have \(C_{2} ,p_{2}\) and \(C_{3} ,p_{3}\) code size and code weight of Y and Z respecctively. The code sequences of X, Y and Z are \(X_{g} , Y_{h}\) and \(Z_{l}\) respectively. So It is possible to express the 3D-PTZCC as:

$$A_{g,h,l} = X_{g}^{T} Y_{h} Z_{l}$$
(11)

The total cardinality (C) can be expressed as:

$$C = C_{1} C_{2} C_{3}$$
(12)

The 3D-PTZCC codes cross correlation can be clarify within the property matrices \(A^{\left( d \right)}\) (d = 0.7) as following (Cherifi et al. 2018; Yeh et al. 2009):

$$\begin{aligned} A^{\left( 0 \right)} & = X^{T} YZ ,\quad A^{\left( 4 \right)} = X^{T} \bar{Y}Z \\ A^{\left( 1 \right)} & = X^{T} Y\bar{Z} , \quad A^{\left( 5 \right)} = X^{T} \bar{Y}\bar{Z} \\ A^{\left( 2 \right)} & = \bar{X}^{T} YZ,\quad A^{\left( 6 \right)} = \bar{X}^{T} Y\bar{Z} \\ A^{\left( 3 \right)} & = \bar{X}^{T} \bar{Y}Z,\quad A^{\left( 7 \right)} = \bar{X}^{T} \bar{Y}\bar{Z} \\ \end{aligned}$$
(13)

The \(A_{g,h,l}\) can be expressed as:

$$A_{g,h,l} = \left[ {\begin{array}{*{20}l} {a_{1,1,1} } \hfill & {a_{1,2,1} } \hfill & \ldots \hfill & {a_{1,N,1} } \hfill & {a_{1,1,2} } \hfill & {a_{1,2,2} } \hfill & \ldots \hfill & {a_{1,N,2} } \hfill & \ldots \hfill & {a_{1,1,P} } \hfill & {a_{1,2,P} } \hfill & \ldots \hfill & {a_{1,N,P} } \hfill \\ {a_{2,1,1} } \hfill & {a_{2,2,1} } \hfill & \ldots \hfill & {a_{2,N,1} } \hfill & {a_{2,1,2} } \hfill & {a_{2,2,2} } \hfill & \ldots \hfill & {a_{2,N,2} } \hfill & \ldots \hfill & {a_{2,1,P} } \hfill & {a_{2,2,P} } \hfill & \ldots \hfill & {a_{2,N,P} } \hfill \\ \vdots \hfill & \vdots \hfill & {} \hfill & \vdots \hfill & \vdots \hfill & \vdots \hfill & {} \hfill & \vdots \hfill & {} \hfill & \vdots \hfill & \vdots \hfill & {} \hfill & \vdots \hfill \\ {a_{M,1,1} } \hfill & {a_{M,2,1} } \hfill & \ldots \hfill & {a_{M,N,1} } \hfill & {a_{M,1,2} } \hfill & {a_{M,2,2} } \hfill & \ldots \hfill & {a_{M,N,2} } \hfill & \ldots \hfill & {a_{M,1,P} } \hfill & {a_{M,2,P} } \hfill & \ldots \hfill & {a_{M,N,P} } \hfill \\ \end{array} } \right]$$
(14)

The cross correlation between \(A^{\left( d \right)}\) and \(A_{g,h,l}\) is expressed as (Cherifi et al. 2018; Kadhim et al. 2015; Yeh et al. 2009):

$$R^{\left( d \right)} \left( {g,h,l} \right) = \mathop \sum \limits_{i = 0}^{M - 1} \mathop \sum \limits_{j = 0}^{N - 1} \mathop \sum \limits_{l = 0}^{P - 1} a_{i,j,l}^{\left( d \right)} a_{i,j,l}$$
(15)

where \(a_{i,j,l}^{\left( d \right)}\) and \(a_{i,j,l}\) are the element of \(A^{\left( d \right)}\) and \(A_{g,h,l}\) respectively. If we substitute Eqs. (13) into Eq. (15), we will obtain \(R^{\left( d \right)} \left( {g,h,l} \right)\) values which are zeros except \(R^{\left( 0 \right)}\) and \(R^{\left( 1 \right)}\). They are presented in Eqs. (16) and (17) as following:

$$R^{\left( 0 \right)} \left( {g,h,l} \right) = \mathop \sum \limits_{i = 0}^{M - 1} \mathop \sum \limits_{j = 0}^{N - 1} \mathop \sum \limits_{l = 0}^{P - 1} a_{i,j,l}^{\left( 0 \right)} b_{i,j,l} = \left\{ {\begin{array}{*{20}c} {p_{1} p_{2} p_{3} } &\; {for\;g = 0{\bigcap }h = 0{\bigcap }l = 0} \\ {0 } & {} \\ \end{array} } \right.$$
(16)
$$R^{\left( 1 \right)} \left( {g,h,l} \right) = \mathop \sum \limits_{i = 0}^{M - 1} \mathop \sum \limits_{j = 0}^{N - 1} \mathop \sum \limits_{l = 0}^{P - 1} a_{i,j,l}^{\left( 4 \right)} b_{i,j,l} = \left\{ {\begin{array}{*{20}c} {p_{1} p_{2} p_{3} } &\; {for\;g = 0{\bigcap }h = 0{\bigcap }l \ne 0} \\ {0 } & {} \\ \end{array} } \right.$$
(17)

5 System description

The corresponding system scheme of wavelength/time/space is presented in Fig. 2 SAC-OCDMA networks and contains \(C = C_{1} C_{2} C_{3}\) transmitters/receivers pair where each transmitter/receiver uses the 3D-PTZCC code word \(A_{g,h,l}\) as shown in Fig. 2 which composed of an unpolarised light source, an optical modulator (EOM) to convert the electrical signal to the optical signal, two sets of fiber bragg grating FBG1 and FBG2, N optical delay lines and a splitter has P outputs.

Fig. 2
figure 2

Structure of proposed spectral/time/spatial OCDMA system

In side of transmitting, the incoming data bits as electrical form are modulated by the EOM according to the ON/OFF keying schema resulting to convert into optical pulses.

The optical pulses are encoded in three dimensional by three steps:

In first step, they are encoded spectrally through the two sets of FBGs which have the similar grattings number but with opposite (inverse) arrangements where they are sent to the FBG1 to encode it in accordance with the spectral code sequence \(\varvec{X}_{\varvec{g}}\). FBG1 reflects back the components of spectral code sequence \(\varvec{X}_{\varvec{g}}\) with wavelengths matched to ‘1’ and the others are filtered. The reflected spectral components are sent to FBG2 where it also reflects them for compensation the run-trip delay.

The second step is interested in time-spreading encoding.

The FBG2output is sent to delay lines to encode by time-spreading. The delay lines input is split to \(\varvec{p}_{2}\) equal parts and pass through the optical delay lines with different time delays according to the code sequence \(Y_{h}\). After that, they are combined and sent to the splitter for spatial encoding. In the third step which is interested to encode in space domain. The delay lines outputs are split to \(\varvec{p}_{3}\) equal parts for transmitting to the star coupler with accordance to the spatial code sequence \(\varvec{Z}_{\varvec{l}}\).

The system scheme as shown in Fig. 2 is composed of a combiner, correlator, two sets of fiber bragg grating FBG1 and FBG2, one photo diode (PD) to convert optical pulses to electrical signal and low pass filter (LPF).

In side receiving which presents the opposite operation of transmitting, decoding the optical signals which come from the star couplers. The combiners regroup the star couplers in accordance with \(Z_{l}\).

The combiner output is split to \(w_{2}\) equal parts which are sent to dencode them timing accordance with \(Y_{h}\) by the correlator. Then, the correlator output is transmitted to FBG1 where it reflects back the components of spectral code sequence \(\varvec{X}_{\varvec{g}}\) which are matched ‘1’ to send to FBG2 for compensation the run-trip delay. The reflected spectral components are sent to FBG2 where it also reflects them for compensation the run-trip delay. Al last, the photo diode (PD) detects the reflected output and the low pass filter (LPF) filters it.

6 System performance

The 3D-PTZCC code system has been reduced the MAI influence totally. This is due to the cross correlation of our proposed system is equal to zero according to Eq. (Sahbudin et al. 2013) and there is not superposition of signals from different users. To calculate the signal to noise ratio, it takes a consideration the influence of shot noise, PIIN and thermal noise. The total photocurrent variance noise at receiver can be expressed as (Jellali et al. 2017a, b; Najjar et al. 2017; Nisar 2016; Kadhim et al. 2014):

$$\upsigma_{{\rm noise}}^{2} =\upsigma_{{\rm shot}}^{2} +\upsigma_{{\rm PIIN}}^{2} +\upsigma_{{\rm thermal}}^{2}$$
$$\upsigma_{{\rm noise}}^{2} = 2{\text{eB}}_{{\rm r}} {\text{I}} + {\text{B}}_{{\rm r}} {\text{I}}^{2}\uptau_{{\rm c}} + \frac{{4{\text{K}}_{{\rm b}} {\text{T}}_{{\rm n}} {\text{B}}_{{\rm r}} }}{{{\text{R}}_{{\rm l}} }}$$
(18)

where \({\text{e}}\) denotes the electron charge, \({\text{B}}_{\text{r}}\) denotes the electrical bandwidth, \({\text{I}}\). notes the average photo current,\({\text{T}}_{\text{n}}\) denotes the absolute temperature, \({\text{K}}_{\text{b}}\) denotes Boltzmann’s constant, \({\text{R}}_{\text{L}}\) denotes the load resistance and finally \(\uptau_{\text{c}}\) denotes the light coherence time which can be expressed as (Cherifi et al. 2018; Nisar 2016; Jyoti and Kaler 2011):

$$\uptau_{\text{c}} = \frac{{\mathop \int \nolimits_{0}^{\infty } {\text{G}}_{0}^{2} \left( {\text{v}} \right){\text{dv}}}}{{\left( {\mathop \int \nolimits_{0}^{\infty } {\text{G}}_{0} \left( {\text{v}} \right){\text{dv}}} \right)^{2} }}$$
(19)

To simplify the analysis, we use four suppositions (Jellali et al. 2017a, b; Nisar 2016; Kadhim et al. 2014; Jyoti and Kaler 2011):

  1. 1.

    Unpolarised broadband light source which has flat spectrum over \(\left[ {{\text{v}}_{0} - \frac{{\Delta {\text{v}}}}{2},{\text{v}}_{0} + \Delta {\text{v}}/2} \right]\) where \({\text{v}}_{0}\) is the central optical frecuency and \(\Delta {\text{v}}\) is the optical source bandwidth.

  2. 2.

    Similar spectral width for each spectral component produced by the spectral encoders.

  3. 3.

    Same power for each spectral component received by a user.

  4. 4.

    Synchronization for each bit stream from each user.

Using these suppositions, the power spectral density (PSD) of received signals observed by \({\text{r}}\left( {\text{v}} \right)\) can be written as (Kadhim et al. 2015; Yeh et al. 2009; Mostafa et al. 2015; Arief et al. 2013):

$${\text{r}}\left( {\text{v}} \right) = \frac{{{\text{P}}_{{\rm sr}} }}{{{\text{p}}_{2} {\text{p}}_{3} \Delta {\text{v}}}}\mathop \sum \limits_{{{{\rm c}} = 1}}^{{\rm C}} {\text{d}}_{{\rm K}} \mathop \sum \limits_{{{{\rm i}} = 0}}^{{{{\rm M}} - 1}} \mathop \sum \limits_{{{{\rm j}} = 0}}^{{{{\rm N}} - 1}} \mathop \sum \limits_{{{{\rm l}} = 0}}^{{{{\rm P}} - 1}} {\text{a}}_{{\left( {{\text{i}},{\text{j}},{\text{l}}} \right)}} \prod \left( {{\text{v}},{\text{i}}} \right)$$
(20)

where \({\text{P}}_{\text{sr}}\) is the received effictive power, \({\text{d}}_{\text{K}}\) is the data bit of \({\text{C}}{\text{th}}\) user, it may be "0" or "1", \({\text{M}}, {\text{N}}\) and \({\text{P}}\). e the code lengths of spectral, time and spatial code sequences respectively, \({\text{a}}_{{\left( {{\text{i}},{\text{j}},{\text{l}}} \right)}}\) presents the element of \({\text{C}}^{\text{th}}\) user’s code word and finally \(\prod \left( {{\text{v}},{\text{i}}} \right)\) presents the \({\text{i}}^{\text{th}}\) spectral element of broadband source (BBS), it can be defined as (Jellali et al. 2017a, b; Yeh et al. 2009; Mostafa et al. 2015; Arief et al. 2013):

$$\prod \left( {{\text{v}},{\text{i}}} \right) = \left\{ {\left. {{\text{u}}\left[ {{\text{v}} - {\text{v}}_{0} - \frac{{\Delta {\text{v}}}}{{2{\text{M}}}}\left( { - {\text{M}} + 2{\text{i}}} \right)} \right] - \left[ {{\text{v}} - {\text{v}}_{0} - \frac{{\Delta {\text{v}}}}{{2{\text{M}}}}\left( { - {\text{M}} + 2 + 2{\text{i}}} \right)} \right]} \right\}} \right.$$
(21)

where \({\text{u}}\left( {\text{v}} \right)\) is the unit step function which can be defined as:

$${\text{u}}\left( {\text{v}} \right) = \left\{ {\begin{array}{*{20}c} 1 & { \ge 0} \\ {0 } & {else} \\ \end{array} } \right.$$
(22)

Based on the cross correlation between \({\text{A}}_{0,0,0}^{{\left( {\text{d}} \right)}}\) and \({\text{A}}_{0,0,0}\), the output photo current of PD can be written as:

$$\begin{aligned} {\text{I}} & = \Re \mathop \int \limits_{0}^{\infty } {\text{r}}\left( {\text{v}} \right){\text{dv}} = \Re \mathop \int \limits_{0}^{\infty } \frac{{{\hbox{P}}_{{\rm sr}} }}{{{\hbox{p}}_{2} {\text{p}}_{3} \Delta {\text{v}}}}\mathop \sum \limits_{{{{\rm c}} = 1}}^{{\rm C}} {\text{d}}_{{\rm K}} \mathop \sum \limits_{{{{\rm i}} = 0}}^{{{{\rm M}} - 1}} \mathop \sum \limits_{{{{\rm j}} = 0}}^{{{{\rm N}} - 1}} \mathop \sum \limits_{{{{\rm l}} = 0}}^{{{{\rm P}} - 1}} {\text{a}}_{{\left( {{\text{i}},{\text{j}},{\text{l}}} \right)}} \prod \left( {{\text{v}},{\text{i}}} \right){\text{dv}} \\ {\text{I}} & = \frac{{\Re {\hbox{P}}_{{\rm sr}} }}{{{\text{p}}_{2} {\text{p}}_{3} {\text{M}}}}\left[ {{\text{p}}_{1} {\hbox{p}}_{2} {\text{p}}_{3} + \mathop \sum \limits_{{{{\rm c}} = 1}}^{{\rm C}} {\text{d}}_{{\rm K}} {\text{R}}_{0,0,0}^{\left( 0 \right)} } \right] = \frac{{\Re {\text{P}}_{{\rm sr}} }}{\hbox{M}}{\text{p}}_{1} \\ \end{aligned}$$
(23)

where \(\Re \;{\text{is the PD resposivity }}\). It can be expressed as (Jellali et al. 2017a, b; Yeh et al. 2009; Sahbudin et al. 2013; Ahmed and Nisar 2013):

$$\Re = \frac{{\eta \cdot {\text{e}}}}{{h \cdot {\text{v}}_{ 0} }}$$

\(\upeta,{\text{e}},{\text{h}},{\text{v}}_{0}\): denote the quantum efficiency, electron’s charge, Plank’s constant and central frequency of broad-band optical pulse respectively.

Although \({\text{M}} = {\text{C}}_{1} {\text{p}}_{1}\) and \({\text{C}}_{1} = {\text{C}}/{\text{C}}_{2} {\text{C}}_{3}\), we will obtain:

$${\text{I}} = \frac{{\Re {\text{P}}_{{\rm sr}} {\text{C}}_{2} {\text{C}}_{3} }}{\text{C}}$$
(24)

The variance of the PIIN current can be expressed as:

$$\begin{aligned}\upsigma_{{\rm PIIN}}^{2} & = {\text{B}}_{{\rm r}} \Re^{2} \mathop \int \limits_{0}^{\infty } {\text{G}}_{0}^{2} \left( {\text{v}} \right){\text{dv}} \\ \upsigma_{{\rm PIIN}}^{2} & = {\text{B}}\Re^{2} \left[ {\mathop \int \limits_{0}^{\infty } \frac{{{\text{P}}_{{\rm sr}} }}{{{\text{p}}_{2} {\text{p}}_{3} \Delta {\text{v}}}}\mathop \sum \limits_{{{{\rm c}} = 1}}^{{\rm C}} {\text{d}}_{{\rm K}} \mathop \sum \limits_{{{{\rm c}} = 1}}^{{\rm C}} {\text{d}}_{{\rm K}} \mathop \sum \limits_{{{{\rm i}} = 0}}^{{{{\rm M}} - 1}} \mathop \sum \limits_{{{{\rm j}} = 0}}^{{{{\rm N}} - 1}} \mathop \sum \limits_{{{{\rm l}} = 0}}^{{{{\rm P}} - 1}} {\text{a}}_{{\left( {{\text{i}},{\text{j}},{\text{l}}} \right)}} \prod \left( {{\text{v}},{\text{i}}} \right){\text{dv}}} \right]^{2} \\ \upsigma_{{\rm PIIN}}^{2} & = \frac{{{\text{B}}_{{\rm r}} \Re^{2} {\text{P}}_{{\rm sr}}^{2} }}{{({\text{p}}_{2} {\text{p}}_{3} \Delta {\text{v}})^{2} }}\left[ {\left( {{\text{p}}_{1} {\text{p}}_{2} {\text{p}}_{3} } \right)^{2} *\frac{{\Delta {\text{v}}}}{\text{M}}} \right] = \frac{{{\text{B}}_{{\rm r}} \Re^{2} {\text{P}}_{{\rm sr}}^{2} }}{{\Delta {\text{vM}}}}{\text{p}}_{1}^{2} = \frac{{{\text{B}}_{{\rm r}} {\text{I}}^{2} {\text{M}}}}{{\Delta {\text{v}}}} \\ \end{aligned}$$
(25)

By substituting Eq. (24) into Eq. (25) we have:

$$\upsigma_{{\rm noise}}^{2} = 2 {\text{eB}}_{{\rm r}} \frac{{\Re {\text{P}}_{{\rm sr}} {\text{C}}_{2} {\text{C}}_{3} }}{\text{C}} + \frac{{{\text{B}}_{{\rm r}} \Re^{2} {\text{P}}_{{\rm sr}}^{2} {\text{C}}_{2} {\text{C}}_{3} }}{{\Delta {\text{vC}}}} + \frac{{4{\text{K}}_{{\rm b}} {\text{T}}_{{\rm n}} {\text{B}}_{{\rm r}} }}{{{\text{R}}_{{\rm L}} }}$$
(26)

For each user at any time the probability of sending ‘‘1’’ is 0.5

$${\text{I}}^{2} = {\text{eB}}_{{\rm r}} \frac{{\Re {\text{P}}_{{\rm sr}} {\text{C}}_{2} {\text{C}}_{3} }}{\text{C}} + \frac{1}{2}\frac{{{\text{B}}_{{\rm r}} \Re^{2} {\text{P}}_{{\rm sr}}^{2} {\text{C}}_{2} {\text{C}}_{3} }}{{\Delta {\text{vC}}}} + \frac{{4{\text{K}}_{{\rm b}} {\text{T}}_{{\rm n}} {\text{B}}_{{\rm r}} }}{{{\text{R}}_{{\rm L}} }}$$
(27)

Finally, according to the results in Eqs. (24) and (27), the signal to noise ratio (SNR) can be calculated as:

$${\text{SNR}} = \frac{{{\text{I}}^{2} }}{{\upsigma_{\text{noise}}^{2} }} = \frac{{\left[ {\frac{{\Re {\text{P}}_{{\rm sr}} {\text{C}}_{2} {\text{C}}_{3} }}{\text{C}}} \right]^{2} }}{{{\text{eB}}_{{\rm r}} \frac{{\Re {\text{P}}_{{\rm sr}} {\text{C}}_{2} {\text{C}}_{3} }}{\text{C}} + \frac{1}{2}\frac{{{\text{B}}_{{\rm r}} \Re^{2} {\text{P}}_{{\rm sr}}^{2} {\text{C}}_{2} {\text{C}}_{3} }}{{\Delta {\text{vC}}}} + \frac{{4{\text{K}}_{{\rm b}} {\text{T}}_{{\rm n}} {\text{B}}_{{\rm r}} }}{{{\text{R}}_{{\rm L}} }}}}$$
(28)

BER can be calculated by using the Gaussian approximation as following (Jellali et al. 2017a, b; Yeh et al. 2009; Najjar et al. 2017; Shi and Ghafouri-Shiraz 2016; Singh et al. 2016; Sihmar and Gupta 2014):

$${\text{BER}} = 0.5 * {\text{erfc}}\sqrt {{\hbox{SNR}}/8}$$
$${\text{BER}} = 0.5 * {\text{erfc}}\sqrt {\frac{{\left[ {\frac{{\Re {\text{P}}_{{\rm sr}} {\text{C}}_{2} {\text{C}}_{3} }}{\text{C}}} \right]^{2} }}{{8{\text{eB}}_{{\rm r}} \frac{{\Re {\text{P}}_{{\rm sr}} {\text{C}}_{2} {\text{C}}_{3} }}{\text{C}} + 4\frac{{{\text{B}}_{{\rm r}} {\text{B}}\Re^{2} {\text{P}}_{{\rm sr}}^{2} {\text{C}}_{2} {\text{C}}_{3} }}{{\Delta {\text{vC}}}} + \frac{{32{\text{K}}_{{\rm b}} {\text{T}}_{{\rm n}} {\text{B}}_{{\rm r}} }}{{{\text{R}}_{{\rm L}} }}}}}$$
(29)

where

$$erfc\left( x \right) = \frac{2}{\sqrt \pi }\mathop \int \limits_{x}^{\infty } \exp \left( { - {\text{y}}^{2} } \right){\text{dy}}$$
(30)

7 Numerical results

This part indicates the performance of the 3D-PTZCC code in comparison of 3D-PD/MD and 3D-PD codes used in (Jellali et al. 2017a, b; Kadhim et al. 2015; Yen and Chen 2016; Yeh et al. 2009) for the same code length (M = 7, N = 21, P = 3) with existing shot noise, PIIN and thermal noise. The electrical bandwidth in case 3D codes equal to \(0.5*N*R_{b}\) while it is equal 0.5 × R for the 1D and 2D codes where \(R_{b}\) represents the data bit rate. The variation of BER is calculated in term of number of active users, effective source power, data bit rate and finally spectral width according to used parameters in Table 1.

Table 1 System parameters

Figure 3 Presents the variation of BER as function number of active users for effective power (Psr = − 10 dBm) at data rate (\({\text{R}}_{\text{b}}\) = 1 Gbps). As shown in this figure, 1D-PTZCC, 2D-PTZCC and 3D-PTZCC codes can satisfy property of the optical requirement. At acceptable BER equal to \(10^{ - 9}\), the number of active users are 69, 111 and 308 respectively despite high data rate. So that our proposed system improved 4.5 and 2.7 times the system performance based on 1D-PTZCC and 2D-PTZCC.

Fig. 3
figure 3

BER versus Number of active users for the same code lengths (M = 6, N = 21 and P = 3)

Furthermore, the capacity of others systems with 3D-PD and 3D-PD/MD codes are 66 and 80 users respectively, so the capacity of our proposed system enhanced by, 4.7 and 3.85 times the capacity of 3D-PD and 3D-PD/MD systems.

Furthermore, for the similar users number equal to 300 users, the BER values are 1.327 × \(10^{ - 3}\), 6.918 × \(10^{ - 4}\) and 3.259 × \(10^{ - 10}\) for the 3D-PD, 3D-PD/MD and 3D-PTZCC. All that interprets that MAI is eliminated fully and the effect of PIIN is reduced.

This Fig. 4 Show the relation between BER and effective power Psr for the same number of active users equal to 50 at 1 Gbps. At the acceptable BER = \(10^{ - 9}\) the effective power at receiver equal to − 17.9 dBm, − 15.3 dBm and − 11.4 dBm for 3D-PTZCC, 2D-PTZCC, 1D-PTZCC codes respectively.

Fig. 4
figure 4

BER versus Effective source power when number of users is C = 50

For others 3D-PD and 3D-PD/MD codes, they need − 12.4 dBm and − 14.2 dBm of received power respectively. This indicates that our proposed system has better performance and can save the received power around − 5.5dBm and − 3.7 dBm in comparison with 3D-PD and 3D-PD/MD codes respectively. Also, it can save around − 2.6 dBm and − 6.5 dBm by transiting from 2D to 3D and 1D to 3D respectively (Fig. 5).

Fig. 5
figure 5

BER versus data rate when number of active users is C = 250

BER is plotted against data rate where number of users C = 250 and received power Psr = − 10dBm. We observe that the 3D-PTZCC code can accommodate high data rate equal to \(R_{b}\) = 1.5 Gbps whereas the others codes: 2D-PTZCC, 3D-PD and 3D-PD/MD can accomdate 0.35, 0.33 and 0.39 Gbps. Thus, our proposed code can allows to satisfy the necessary of optical communication network (Fig. 6).

Fig. 6
figure 6

BER versus spectral Width when number of active users is C = 250

Finally, the last figure is the relation between BER as function the spectral width when number of active users 250 and received power is − 10dBm at data rate 1 Gbps. We note that our proposed code need bandwidth equal to 0.74 Thz so that the necessary of spectral width is smaller than other codes: 3D-PD and 3D-PD/MD.

Figure 7 shows number of active usesrs (K) versus the signal to noise ratio (SNR) with bandwidth is \(B_{r} = 10.5\) Ghz and effective power from each user is − 10 dBm. It is take a consideration of shot noise, PIIN and thermal noise expect case one dimensional shot noise and thermal noise only. 3D-PTZCC code has higher value of SNR users and outperforms the system performance than other comprised codes. With noise power.

Fig. 7
figure 7

SNR versus number of active users

The system performance is studied using optisystem software in term of BER, when the source power is − 115 dBm. The data rate of each user is 622 Mbps and the bandwidth of each FBG is 0.3 nm. For that, the eye diagrams for 3D-PTZCC code system are presented in Fig. 8. It is clear that the proposed system gave the best value of BER are around \(10^{ - 18}\) when the number of simultaneous users increase.

Fig. 8
figure 8

Eye diagram of 4 users using 3D-PTZCC code

8 Conclusion

In this study, we present a new 3D-PTZCC code with its corresponding wavelength/time/space system structure for comprised to 1D-PTZCC, 2D-PTZCC codes which it reduces the MAI totally thanks to zero cross correlation property. Also, 3D-PTZCC is compared to published codes recently: 3D-PD and 3D-PD/MD in multiple terms where it has a small BER value, improves the receiver complexity of them in different proportions, accommodates higher data rate and uses lower effective source power and spectral width of light so these improvements are important to the optical networks requirements.