1 Introduction

The minimization of the Multiple User Interference (MUI) and the increasing in the number of active users are the two primary goals in Optical Code Division Multiple Access (OCDMA) networks. Such goals may be satisfied according to the following conditions (Yen and Chen 2016; Lalmahomed et al. 2010; Liu et al. 2007; Zoualfaghari and Gafouri-Shiraz 2012; Liu and Ghafouri-Shiraz 2007):

  1. (a)

    Maximizing the auto-correlation property peak value.

  2. (b)

    Minimizing the side lobe levels of the auto-correlation property.

  3. (c)

    Minimizing the cross correlation value between different codes.

The first and third conditions contribute to fulfilment of the MUI minimization, whereas the second condition simplifies the synchronization operation at the system receiver, which satisfies the second goal (Yen and Chen 2016; Lalmahomed et al. 2010; Liu et al. 2007; Zoualfaghari and Gafouri-Shiraz 2012; Liu and Ghafouri-Shiraz 2007; Kwong et al. 1991; Hamarsheh et al. 2005; Morsy et al. 2006; Liu and Tsao 2000; Gum and Wu 2005; Chung et al. 1989; Kwon 1994; Keshavarzian and Salehi 2002; Weng and Wu 2001). More importantly, the two goals described above will satisfy the orthogonality condition between any two different codes in OCDMA networks. In OCDMA networks, there are two important spreading code families such as the Optical Orthogonal Codes (OOCs) and the Prime Codes (PCs). The number of codes generated at a similar code length of the PC family and the OCC family is typically greater in the former than the latter (Liu et al. 2007; Morsy et al. 2006). This paper focuses on the PC family that are used in OCDMA networks. One among important PC types is the Modified Prime Code (MPC) given its capability to offer PC improvement within the OCDMA networks. After the advent of the MPC sequences, four new important codes appeared, which namely are new MPC (n-MPC), Uniform Cross-Correlation MPC (UC-MPC), Double Padded MPC (DPMPC), and Enhanced MPC (EMPC) (Lalmahomed et al. 2010; Liu et al. 2007; Zoualfaghari and Gafouri-Shiraz 2012; Liu and Ghafouri-Shiraz 2007). Each one of these codes has a several advantages and drawbacks with respect to the code length and code weight. Spreading codes of OCDMA networks relies mainly on these two important parameters. Such parameters must be enhanced to satisfy the primary goals of OCDMA systems. The first parameter is required to increase code rate and processing gain. On the other hand, the second parameter is required to decrease the MUI.

Nevertheless, this paper proposes a new spreading code sequences based on the MPCs. The proposed code has been named weighted MPC (WMPC). It was designed in a way that allows it to be used as the address sequence for the OCDMA communication applications. Generally, the main advantage of the MPCs is that it increase the number of sequences generated at similar code length of the PCs. Yet, one drawback of the sequence of the peak of auto-correlation value is its limitation to the value of the prime number (P). The n-MPC and UC-MPC that were previously proposed increase the code length by P and the peak of auto-correlation by 1. The DPMPC, however, increases the code length by 2P and the peak of auto-correlation by 2. More significantly, the EMPC increases the code length by 3P and the peak of auto-correlation by 3. All together, these codes tend to decrease the user bit rate. The bit rate is decreased by a factor of P2/(P2 + P) for the n-MPC and UC-MPC, P2/(P2 + 2P) for the DPMPC, and P2/(P2 + 3P) the EMPC. While these four codes increase the network performance in terms of bit error rate, they decrease the network throughput with respect to the MPC (Lalmahomed et al. 2010; Liu et al. 2007; Zoualfaghari and Gafouri-Shiraz 2012; Liu and Ghafouri-Shiraz 2007).

This paper introduces the construction principles and correlation properties of the MPC. Based on that, the construction principles and correlation properties of the WMPC were investigated. Additionally, the simulation results are compared with the other MPC families. While the WMPC and MPC share a similar sequence length, the former tended to increase the code weight to a value of 2P − 1 with good correlation property. Though, the network throughput remains the same. However, the proposed code enhances the peak of auto-correlation value in comparison with other MPC families. This paper is organized into five sections. Section 2 introduces the construction principles and correlation properties of MPC, and Sect. 3 investigates the construction principles and correlation properties of WMPC. While Sect. 4 presents and discusses the simulation results, Sect. 5 concludes the work.

2 Modified prime code (MPC)

MPC is the modified version of the PC sequences. These optical sequences are suitable for supporting a greater number of users that can be transmitted simultaneously with minimum MUI in a shared bandwidth.

2.1 Construction principles

In case of PC sequences, the total available number of active users is the same as the prime number P (Lalmahomed et al. 2010; Liu et al. 2007; Zoualfaghari and Gafouri-Shiraz 2012; Liu and Ghafouri-Shiraz 2007). However, the number of users in the MPC sequences is increased to P2 with very good correlation properties. It is assumed that the original PC sequences generator Sxj is right or left rotated, where \(x, j \in \left\{ {0, 1, 2, \ldots \ldots \ldots , P - 1} \right\}\). Hence, the shifted sequences can be represented as \(S_{x,t} = \left( {S_{xt0} ,{\text{S}}_{{{\text{xt}}1}} , \ldots ,{\text{S}}_{\text{xtj}} , \ldots {\text{S}}_{{{\text{xt}}\left( {{\text{p}} - 1} \right)}} } \right)\), where t is the number of times Sx has been right or left rotated (Liu and Ghafouri-Shiraz 2007). This assumption makes a sufficient increase in the total number of users. Using this idea, the MPC sequences can be generated as follows.

$$C_{xti} = \left\{ {\begin{array}{*{20}l} {1,} \hfill & {i = S_{xti} + jP,\quad j = 0,1, \ldots ,(P - 1)} \hfill \\ {0,} \hfill & {Otherwise} \hfill \\ \end{array} } \right.$$
(1)

2.2 Correlation properties

The correlation properties such as the auto-correlation property and cross-correlation property between any two MPC sequences Cn and Cm is given by:

$$R_{{S_{nm} }} = \left\{ {\begin{array}{ll} P, \hfill & {\textit{if}}\quad m = n \hfill \\ 0, \hfill &{\textit{if}}\quad m\,{\textit{and}}\,n\,{\textit{share the same group}},\,m \ne n \hfill \\ 1, \hfill & {\textit{if}}\quad m\,{\textit{and}}\,n\,{\textit{are from different groups}},\,m \ne n \hfill \\ \end{array} } \right.$$
(2)

where \(m, n \in \left\{ {1, 2, \ldots , P^{2} } \right\}\).

The value of the cross-correlation between two code sequences depends on whether these two sequences exist in one group or two different groups. In case of two sequences existing in different groups, the maximum cross-correlation value is limited to 1. In addition, for n = m the auto-correlation peak value is bounded to P.

3 Weighted modified prime code (WMPC)

Following, the code construction principles and correlation properties of WMPC are introduced.

3.1 Construction principles

The WMPC is simply generated by performing an XOR operation (i.e., XOR ≡ ⊕) between the code words of each MPC sequence. For example, if the code sequence is ‘01234’, assuming the prime number P is equal to 5, the resulting MPC sequence is ‘10000-01000-00100-00010-00001,’ where ‘0’ ≡ ‘10000’ means no shift, ‘1’ ≡ ‘01000’ means one shift, and so on. Besides, the resulting WMPC sequence is (0 ⊕ 3)-(1 ⊕ 4)-(2)-(4 ⊕ 2)-(3 ⊕ 1), which is equivalent to ‘10010-01001-00100-00101-01010.’ This sequence is called code (A). If the resulting WMPC sequence is (1 ⊕ 4)-(0 ⊕ 3)-(2)-(3 ⊕ 1)-(4 ⊕ 2) that is equivalent to ‘01001-10010-00100-01010-00101,’ the sequence is called code (B). Finally, if the resulting WMPC sequence is (4 ⊕ 2)-(3 ⊕ 1)-(2)-(0 ⊕ 3)-(1 ⊕ 4) with an equivalency of ‘00101-01010-00100-10010-01001,’ it is called code (C). The two codes (B) and (C) are generated by changing the position of the resulting code words in code (A). After completing the coding in Table 1, it is clear that:

  1. a.

    Code (A) with Code (C) can be used in the same network.

  2. b.

    Code (B) with Code (C) can be used in the same network.

  3. c.

    Code (A) with Code (B) can’t be used in the same network because the cross-correlation between them is large. This is due to the minimum difference between them (i.e., the middle words only).

Table 1 Weighted MPC sequences when P = 5

By these results, the number of generated codes is doubled, and the throughput is enhanced with respect to the n-MPC, UC-MPC, DPMPC and EMPC. Finally, the length and weight of each code sequence are P2 and 2P − 1, respectively, with the total number of available code sequences having a value of 2(P2 − P).

Nowadays, the XOR operation in optical domain is simple to perform by using 2D-photonic crystals. This gives more reduction in the size of OCDMA encoder and decoder and overcomes the limitations of electronic components that typically occur at higher data rates (Tanabe et al. 2005; Kabilan et al. 2009). For generating WMPC sequences, there needs to be three groups of 2D-photonic crystal XOR gates, wherein the first group generates code A, the second group generates code B, and the third group generates code C. In addition, the use of these gates is simple with respect to the code words rotation operation.

3.2 WMPC correlation properties

For any two code sequences Cn and Cm, the auto and cross-correlation property are described in the Eq. (3). This equation is given at the synchronous time T, where it is equivalent to the code-length or data bit duration.

$$\varvec{R}_{{\varvec{S}_{{\varvec{nm}}} }} = \left\{ {\begin{array}{ll} {2\varvec{P} - 1,} \hfill & {\textit{if}}\quad m = n \hfill \\ {\bf 0}, \hfill & {\textit{if}}\quad m\,{\textit{and}}\,n\,{\textit{share the same group}},\,m \ne n \hfill \\ {\bf 1}, \hfill & {\textit{if}}\quad m\,{\textit{and}}\,n\,{\textit{are from different groups}},\,m \ne n \hfill \\ \end{array} } \right.$$
(3)

The comparison between prime codes family is illustrated in Table 2, where one can clearly see that:

  1. a.

    The minimum code length P2 refers to the MPC and the WMPC. This gives better network throughput in comparison with other PC codes families.

  2. b.

    The higher code weight 2P − 1 refers to the WMPC. This gives better network performance in comparison with other PC codes families.

Table 2 Comparison of MPCs families

The WMPC cross-correlation value is 0 between two codes (A) and (A) of the same group. Furthermore, the value is 0 between two codes (A) and (C) of different groups. As a result of such cross-correlation value, the MUI is reduced.

4 Simulation results

Simulations were performed in MATLAB to test the proposed auto- and cross-correlation functions of the WMPC and existing MPC family. For instance, Fig. 1 shows the auto-correlation functions of the MPC sequence S23, were the maximum value of auto-correlation is 5 at the synchronized time T. It is represented by shift number 25, which is referred to as P2 in all MPC simulation results. Furthermore, the cross-correlation between two different MPC sequences sharing the same group S22 and S23 is displayed in Fig. 2. The figure shows that the cross-correlation is 0 at each synchronized time T. Additionally, the cross-correlation function between two different MPC sequences in different groups S11 and S22 is illustrated in Fig. 3. The results show that the cross-correlation is 1 at the synchronized time T. From the simulation of the MPC sequences, the results show that the MPC sequences are suitable for OCDMA networks to accommodate a higher number of users in the same bandwidth while maintaining low MUI and good throughput. However, for sufficient network performance, code weight or the auto-correlation function peak value need to be increased.

Fig. 1
figure 1

MPC sequence of S2,3 auto-correlation values when P = 5

Fig. 2
figure 2

MPC sequences S2,2 and S2,3 cross-correlation values in the same group when P = 5

Fig. 3
figure 3

MPC sequences S1,1 and S2,2 cross-correlation values in different groups when P = 5

The auto-correlation and cross-correlation functions of the n-MPC are illustrated in Figs. 4, 5 and 6. An enhancement of P + 1 will occur in the peak of auto-correlation displayed in Fig. 4, which carries a weight of 6. Such enhancement resulted improving the performance of the network. However, the code length is increased to the value of P2 + P. Unfortunately, the increase in the code length results in reducing the network throughput in comparison with the network throughput of MPC. Meanwhile, the cross-correlation function between two different n-MPC sequences S12 and S14 of the same group is illustrated in Fig. 5, where results show that the cross-correlation is 0 at the synchronized time T represented by shift number 30, which is referred to as P2 + P in all n-MPC simulation results. Furthermore, the cross-correlation between two different n-MPC sequences existing in different groups is shown in Fig. 6, in which the cross-correlation value is 1 at the synchronized time T.

Fig. 4
figure 4

n-MPC sequence S2,3 auto-correlation values when P = 5

Fig. 5
figure 5

n-MPC sequences S1,2 and S1,4 cross-correlation values in the same group when P = 5

Fig. 6
figure 6

n-MPC sequences S1,2 and S2,4 cross-correlation values in the different groups when P = 5

On the other hand, the auto-correlation and cross-correlation functions of the DPMPC are illustrated in Figs. 7, 8 and 9. The peak of auto-correlation in Fig. 7 is enhanced to P + 2, which is equal to 7. This enhancement improves the performance of the network, but the code length is increased to the value of P2 + 2P. This makes more reduction in the network throughput in comparison with the network throughput of MPC. Meanwhile, Fig. 8 depicts the cross-correlation between two different DPMPC sequences S21 and S22 existing in the same group. At the synchronized time T represented by shift number 35 and referred to as P2 + 2P in all DPMPC simulation results, where the cross-correlation value is 0. Furthermore, Fig. 9 illustrates the cross-correlation between two different DPMPC sequences S21 and S34 existing in different groups. The results show that the cross-correlation has a value of 1 at the synchronized time T.

Fig. 7
figure 7

DPMPC sequence S3,1 auto-correlation values when P = 5

Fig. 8
figure 8

DPMPC sequences S2,1 and S2,2 cross-correlation values in the same group when P = 5

Fig. 9
figure 9

DPMPC sequences of S2,1 and S3,4 cross-correlation values in the different groups when P = 5

Figure 10, nevertheless, illustrates the auto-correlation function of the EMPC sequence S31. The results in the figure show that the peak of auto-correlation will be enhanced to be greater than n-MPC by 2 and greater than DPMPC by 1. As a results of increasing the difference between peak and side lobes, the MUI is reduced. Results in the figure shows that the EMPC offers better network performance than n-MPC and the DPMPC. On the other hand, the network throughput is reduced more in EMPC than in n-MPC and DPMPC. Figure 11, however, shows the cross-correlation between two different EMPC sequences S31 and S33 in the same group. From this figure, the cross-correlation is 0 at the synchronized time T, represented by shift number 40 and referred to as P2 + 3P in all EMPC simulation results. Furthermore, the corss-correlation between two different EMPC sequences S31 and S24 in different groups is illustrated in Fig. 12, where results show that the cross-correlation is bounded to 2 at the synchronized time T.

Fig. 10
figure 10

EMPC sequence S3,1 auto-correlation values when P = 5

Fig. 11
figure 11

EMPC sequences S3,1 and S3,3 cross-correlation values in the same group when P = 5

Fig. 12
figure 12

EMPC sequences S3,1 and S2,4 cross-correlation values in the same group when P = 5

Figures 13, 14 and 15 illustrate the auto-correlation function of the WMPC sequences S23A, S23B and S23C, respectively. The results show that the peak value is enhanced to the value of 2P − 1 and the difference between the peak and side lobe level is maximized. Figures 16 and 17 illustrate the cross-correlation between codes in the same and different groups, where the cross-correlation is equal to 0 for the two codes (A) and (A) in same group and the two codes (A) and (C) in different groups. From the results of the WMPC, it is clear that this code outperforms all MPC codes family with respect to MUI and network throughput.

Fig. 13
figure 13

WMPC sequence S2,3 A, auto-correlation values when P = 5

Fig. 14
figure 14

WMPC sequence S2,3 B, auto-correlation values when P = 5

Fig. 15
figure 15

WMPC sequence S2,3 C, auto-correlation values when P = 5

Fig. 16
figure 16

WMPC sequences S2,3 A and S2,4 A, cross-correlation values in the same group when P = 5

Fig. 17
figure 17

WMPC sequences S2,3 A and S3,3 C, cross-correlation values in the different groups when P = 5

5 Conclusions

In this paper a new spreading code sequence named WMPC has been proposed. The design analysis, construction and correlation properties have been accomplished. In addition, the auto and cross correlation properties of the MPC, n-MPC, DPMPC, and EMPC spreading codes sequences were investigated and studied. Moreover, the comparison in terms of code length, code weight, number of codes generated, auto-correlation property, and cross-correlation property between the new spreading code and the other spreading codes were investigated, where the simulation results show that:

  1. 1.

    The WMPC outperforms all the other MPC codes families.

  2. 2.

    The WMPC auto-correlation peak value when P = 5 is enhanced by factors illustrated as: 9/8, 9/7 and 9/6 in comparison with EMPC, DPMPC and n-MPC, respectively.

  3. 3.

    The code length of WMPC when P = 5 remains the same as the MPC but is reduced by factors illustrated as: 5/8, 5/7 and 5/6 in comparison with EMPC, DPMPC, and n-MPC, respectively.

  4. 4.

    The network throughput is increased with respect to all the other MPCs family.

In case where the P value is larger than 5, the results of n-MPC, DPMPC, and EMPC are not efficient in MUI calculation because the MUI is increased due to the rising of the auto-correlation function side lobe levels. In addition, the network throughput reduction factor were increased. Finally, The OCDMA networks that use the WMPC sequences appeared to have higher throughput and optimum performance in comparison with other MPCs family.