1 Introduction

Spectral amplitude coding optical code division multiple access (SAC-OCDMA) is a multiplexing technique originated from code division multiple access (CDMA) that was proposed earlier for radio frequency communication systems. The advantages of SAC-OCDMA techniques are to provide secured communication and allow multiple users to access optical network with a shared bandwidth. In a SAC-OCDMA system, each user modulates the data bit with the unique signature code assigned to the user and thereafter, the user initiates asynchronous transmission. The modulator at the transmitter side changes the appearance of the spectrum that is detected by the intended receiver only. The SAC-OCDMA approach has been one of the most popular code used in the optical code division multiple access technique (OCDMA) because of its ability to mitigate the effect of multiple access interference (MAI). MAI is the interference that is generated due to the simultaneous transmission of users, which reduces the signal-to-noise ratio (SNR) of the overall system. The effect of MAI is reduced by utilizing codes with fixed in-phase cross-correlation [1]. Another source of noise is the Phase Induced Intensity Noise (PIIN), which results due to the mixing of two uncorrelated light fields that has identical polarization, minimum self-intensity noise, same spectral property and equal intensity. Due to the PIIN, the spectrum is widened beyond maximum electrical bandwidth permissible, severely degrading the overall system performance [1]. The OCDMA system performance is limited by different noise sources such as Gaussian noise, shot noise, beat noise, thermal noise, dark current, PIIN, and multiple access interference (MAI) arising from other users. Out of these noises, the MAI and PIIN are generally considered as the dominating sources of noise [1]. Various one-dimensional OCDMA codes have been investigated in the literature to remove the effect of MAI and PIIN. Lots of one-dimensional OCDMA codes are developed in the literature for the SAC-OCDMA networks such as enhanced double weight (EDW) code, modified frequency hopping (MFH) code, modified quadratic congruence (MQC) code, optical orthogonal (OOC) code, prime code, Khazani–Syed (KS) code, random diagonal (RD) code, modified code using a balanced detection technique, dynamic cyclic shift (DCS) code and a multi-diagonal code [211]. However, these codes suffer from various drawbacks. Some of these codes are designed to have too long code length, which are difficult to handle and implement. Some codes are constructed to have variable cross-correlation. In addition, some of these SAC-OCDMA codes suggested in the literature do not support large number of simultaneous users or high data rates to achieve a threshold level of bit error rate (BER) [211].

To overcome these problems in this work, a novel modified new zero cross-correlation (MNZCC) code is suggested and compared with a novel modified random diagonal code (MRDC) [12]. The MNZCC code is designed by combining regular matrices. The proposed novel codes exhibit several advantages and have the following contributions as mentioned below.

  • Cross-correlation that lies between zero to one for the MRDC code and zero for the MNZCC code that cancels the MAI.

  • Flexibility in choosing the parameters such as code weight (W) and number of users (K).

  • A simple and flexible design.

  • Support larger number of active users with higher data rates for longer distances.

  • Almost no overlapping occurred for the spectra characteristics of different users and code length is minimum in case of MRDC code as compared to that of other existing SAC-OCDMA codes.

This paper is organized as follows. The design and construction of the proposed MRDC and MNZCC codes are described briefly in Sect. 2. Section 3 describes the mathematical analysis of the system performance in terms of signal to noise ratio (SNR). Simulation using the optisystem software, performance analysis, and comparison of the proposed MRDC and MNZCC codes with the other existing SAC-OCDMA codes are explained in Sect. 4. Finally, conclusions are drawn in Sect. 5.

2 The proposed code design techniques

The proposed one-dimensional OCDMA novel codes, namely MRDC and MNZCC, are designed and described as below. While designing the codes, care has been taken to ensure the following points as mentioned below:

  • Code length should be as minimum as possible, and it should not vary with the number of active users.

  • Cross-correlation should be kept minimum to minimize MAI and PIIN.

  • Code design steps should be simple.

  • The proposed codes should support large number of active users while achieving the minimum BER.

  • The designed code should support high data rate while achieving the minimum BER.

Table 1 Comparison of different properties of the proposed codes with the other existing codes used for the SAC-OCDMA systems [11]

2.1 The proposed MRDC code [12]

The proposed modified random diagonal code (MRDC) is a modified version of random diagonal code (RD) [1, 13]. In an OCDMA system, the signature sequence consists of unipolar (0, 1) sequence. Generally, a code is denoted as \((N, W, \lambda _{c})\) where ‘N’ is the code length, ‘W’ is the code weight and ‘\(\lambda _{c}\)’ is the in-phase cross-correlation. The cross-correlation is expressed as below in Eq. (1) [11].

$$\begin{aligned} \lambda _{c} =\sum _{i=1}^N {X_i } Y_i \end{aligned}$$
(1)

In the above Eq. (1), \(X_{i}\) represents the ith sequence of the Xth code and \(Y_{i}\) represents the ith sequence of the Yth code.

Many one-dimensional OCDMA code strategies are proposed in the literature where, the major concerns of designing the codes are to reduce the MAI, code length and code weight. However, in almost all the existing SAC-OCDMA codes, the code length increases with the increase in the number of users. As a result, the cross-correlation becomes more than one.

To reduce the MAI, the cross-correlation should be kept as small as possible. Therefore, in this work care has been taken to design a novel one-dimensional SAC-OCDMA code to reduce the code length so as to keep the cross-correlation minimum and autocorrelation maximum. This work presents a novel SAC-OCDMA code referred in this paper as modified random diagonal code (MRDC) [12].

This code consists of two parts.

  1. 1.

    Data segment

  2. 2.

    Code segment

2.1.1 Data segment

The data segment consists of a diagonal matrix, which has only one ‘1’ in each column. Hence, the cross-correlation in the code segment becomes ‘0’ and weight becomes ‘1’. In this paper, ‘K’ below represents the number of users.

$$\begin{aligned}&\hbox {For }K=2,\hbox { data segment}=\left[ {{\begin{array}{cc} 1&{}\quad 0 \\ 0&{}\quad 1 \\ \end{array} }} \right] \\&\hbox {For }K=3,\hbox { data segment}=\left[ {{\begin{array}{ccc} 1&{}\quad 0&{}\quad 0 \\ 0&{}\quad 1&{}\quad 0 \\ 0&{}\quad 0&{}\quad 1 \\ \end{array} }} \right] \\ \end{aligned}$$

2.1.2 Code segment

The code segment consists of a chess board matrix of two columns, and number of rows is equal to the number of users ‘K’.

$$\begin{aligned}&\hbox {For }K=2,\hbox { code segment }=\left[ {{\begin{array}{cc} 0&{}\quad 1 \\ 1&{}\quad 0 \\ \end{array} }} \right] \\&\hbox {For }K=3,\hbox { code segment}=\left[ {{\begin{array}{cc} 0&{}\quad 1 \\ 1&{}\quad 0 \\ 0&{}\quad 1 \\ \end{array} }} \right] \\ \end{aligned}$$

The final MRDC code (Z) is designed as below.

$$\begin{aligned} Z=\left[ {{\begin{array}{cc} D&{}\quad C \\ \end{array} }} \right] \end{aligned}$$

In the above code matrix, ‘D’ represents the data segment and ‘C’ represents the code segment.

Hence, for \(K=2\), the MRDC code becomes

$$\begin{aligned} Z=\left[ {{\begin{array}{cccc} 1&{}\quad 0&{}\quad 0&{}\quad 1 \\ 0&{}\quad 1&{}\quad 1&{}\quad 0 \\ \end{array} }} \right] \end{aligned}$$

For \(K=3\),

$$\begin{aligned} Z=\left[ {{\begin{array}{ccccc} 1&{}\quad 0&{}\quad 0&{}\quad 0 &{}\quad 1 \\ 0&{}\quad 1&{}\quad 0&{}\quad 1&{}\quad 0 \\ 0&{}\quad 0 &{}\quad 1&{}\quad 0&{}\quad 1 \\ \end{array} }} \right] \end{aligned}$$

In the proposed MRDC code, the length of the code (N) equals to \(K+W\), contrary to other existing one-dimensional SAC-OCDMA codes where the length of the code is \(K*W\). In this work, ‘K’ represents the number of users and ‘W’ denotes the weight of the code. Table 1 depicts the comparison between different SAC-OCDMA codes, and it is clearly seen that the proposed MRDC presents advantages over other existing SAC-OCDMA codes [211]. As is observed from Table 1, the code length of the proposed MRDC is the least among other codes for any arbitrary number of users. Furthermore, it is also observed that the proposed MNZCC code supports 30 users with variable weights ‘W’ while maintaining a cross-correlation value zero. The MRDC code is generated using Xilinx version 9.2i, the RTL schematics are shown in Figs. 1 and 2 and the resultant output code is shown in Fig. 3.

Fig. 1
figure 1

RTL schematic of the MRDC code with three users and \(W =2\) (top view)

Fig. 2
figure 2

RTL schematic of the MRDC code (three users and \(W = 2\))

Fig. 3
figure 3

Output of the MRDC code for two users with \(W=2\), three users with \(W=2\), and four users with \(W=1\) generated using Xilinx 9.2i version

2.2 The proposed MNZCC code

The novel modified new zero cross-correlation (MNZCC) code is constructed by developing an identity matrix for suitable code length (N) and weight of the matrix (W). In this work, the number of users supported is the order of the matrix where, the weight required equals to the number of ‘1’s in each row of the matrix. In the proposed code, the center wavelength for each of the users is varied without altering the performance of the OCDMA system.

2.2.1 The proposed novel MNZCC code design

The following steps describe the construction of the proposed MNZCC code. The following steps describe the MNZCC code for different values of K and W.

Step 1

First, an identity matrix of order \((K)= 2\) and weight \((W) = 1\) is taken. Order of the matrix represents the number of users ‘K’. For example, the matrix ‘A’ represents a single element matrix.

Suppose, \(A=\left[ 1 \right] , A_1 =\left[ {{\begin{array}{cc} A&{}\quad 0 \\ 0&{}\quad A \\ \end{array} }} \right] =\left[ {{\begin{array}{cc} 1&{}\quad 0 \\ 0&{}\quad 1 \\ \end{array} }} \right] \)

Next, a matrix of \(K=2\) and \(W=2\) is constructed by appending two A’s side by side

$$\begin{aligned} A_1 ^{{\prime }}=\left[ {{\begin{array}{cc} {A_1 }&{}\quad {A_1 } \\ \end{array} }} \right] =\left[ {{\begin{array}{cccc} 1&{}\quad 0&{}\quad 1&{}\quad 0 \\ 0&{}\quad 1&{}\quad 0&{}\quad 1 \\ \end{array} }} \right] \end{aligned}$$

Step 2

Similarly, the code for \(K=4\) and \(W=1\) is constructed as below.

$$\begin{aligned} A_2 =\left[ {{\begin{array}{cc} {A_1 }&{}\quad 0 \\ 0&{}\quad {A_1 } \\ \end{array} }} \right] =\left[ {{\begin{array}{cccc} 1&{}\quad 0&{}\quad 0&{}\quad 0 \\ 0&{}\quad 1&{}\quad 0&{}\quad 0 \\ 0&{}\quad 0&{}\quad 1&{}\quad 0 \\ 0&{}\quad 0&{}\quad 0&{}\quad 1 \\ \end{array} }} \right] \end{aligned}$$

The code for \(K=4\) and \(W=2\) is constructed as below.

$$\begin{aligned} A^{{\prime }}_2 =\left[ {{\begin{array}{cc} {A_2 }&{}\quad {A_2 } \\ \end{array} }} \right] =\left[ {{\begin{array}{cccccccc} 1&{}\quad 0 &{}\quad 0 &{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0 &{}\quad 0\\ 0&{}\quad 1 &{}\quad 0 &{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0 &{}\quad 0\\ 0&{}\quad 0 &{}\quad 1 &{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1 &{}\quad 0\\ 0&{}\quad 0 &{}\quad 0 &{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0 &{}\quad 1\\ \end{array} }} \right] \end{aligned}$$

Similarly, other codes can be constructed for ‘K’ number of users.

For \(K=2^{n}\) and \(W=1\), the corresponding code is expressed as below.

\(A_n =\left[ {{\begin{array}{cc} {A_{n-1} }&{} \quad 0 \\ 0&{} \quad {A_{n-1} } \\ \end{array} }} \right] \) and for \(K=2^{n}\) and \(W=2\), the code matrix becomes \(A_n ^{{\prime }}=\left[ {{\begin{array}{cc} {A_n }&{}\quad {A_n } \\ \end{array} }} \right] \).

In this case, ‘n’ represents any arbitrary integer greater than one.

In this proposed MNZCC code, the code

length \((N) =\hbox { code weight}\, (W)\times \hbox {number of users}\, (K)\).

The final code is designed as below.

$$\begin{aligned} Z^{{\prime }}=\left[ {{\begin{array}{cc} {D{^{{\prime }}}}&{}\quad {C{^{{\prime }}}} \\ \end{array} }} \right] \end{aligned}$$

where \(D'\) is the data segment and \(C'\) is the code segment.

Fig. 4
figure 4

Flow chart for the novel MNZCC code family construction

Fig. 5
figure 5

RTL schematic of the MNZCC code (eight users with \(W = 2\)) (top view)

The novel MNZCC code sequence for \(W=3\), \(K=4\) and \(N=12\) is shown as below.

$$\begin{aligned} D{^{{\prime }}}= & {} \left[ {{\begin{array}{cccc} 1&{}\quad 0&{}\quad 0 &{}\quad 0\\ 0&{}\quad 1&{}\quad 0 &{}\quad 0\\ 0&{}\quad 0&{}\quad 1 &{}\quad 0\\ 0&{}\quad 0&{}\quad 0 &{}\quad 1\\ \end{array} }} \right] \\ C{^{{\prime }}}= & {} \left[ {{\begin{array}{cccccccc} 1 &{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0 &{}\quad 0\\ 0 &{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0 &{}\quad 0\\ 0 &{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1 &{}\quad 0\\ 0 &{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0 &{}\quad 1\\ \end{array} }} \right] \end{aligned}$$

So the novel code becomes

$$\begin{aligned} Z{^{{\prime }}}= & {} \left[ {{\begin{array}{cc} {D{^{{\prime }}}}&{}\quad {C{^{{\prime }}}} \\ \end{array} }} \right] \\= & {} \left[ {{\begin{array}{cccccccccccc} 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0 \\ 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0 \\ 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0 \\ 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1 \\ \end{array} }} \right] _{4\times 12} \end{aligned}$$

The MNZCC code family is constructed based on the following conditions.

  1. (a)

    \(N=K\) and \(W=1\) for data segment \((D')\)

  2. (b)

    \(N=K\) and \(W>1\) for code segment \((C')\)

  3. (c)

    \(N>K\) and \(W>1\) for code segment \((C')\)

Figure 4 depicts the flow chart for the novel MNZCC code family construction. So, the code word for each user according to the above example is expressed as below.

$$\begin{aligned} \hbox {Code word}=\left\{ {{\begin{array}{c} {user1=\lambda _1 ,\lambda _5 ,\lambda _9 } \\ {user2=\lambda _2 ,\lambda _6 ,\lambda _{10} } \\ {user3=\lambda _3 ,\lambda _7 ,\lambda _{11} } \\ {user4=\lambda _4 ,\lambda _8 ,\lambda _{12} } \\ \end{array} }} \right\} \end{aligned}$$

The novel MNZCC code design represents the changing matrix elements resulting zero cross-correlation that cancels the PIIN and MAI. The novel MNZCC code provides more flexible design in terms of ‘W’ and ‘K’ parameters to have a large number of users compared to the other codes. The code length of the proposed novel MNZCC code depends on the weight (W) of the code. The code only supports \(2^{G }\) number of active users where \(G\ge 1\). It is possible to support other than \(2^{G }\) active users also using the proposed MNZCC code. For example, for ten numbers of active users, G should be equal to four. Therefore, the proposed code generates sixteen user codes and only ten codes are utilized and the other six codes remain unutilized. Similarly, for fifteen users, one generated code remains unutilized. The proposed MNZCC code is generated using Xilinx version 9.2i, the RTL schematics are shown in Figs. 5 and 6 and the resultant output code is shown in Fig. 7.

Fig. 6
figure 6

RTL schematic of the MNZCC code (eight users with \(W= 2\))

Fig. 7
figure 7

Output of the MNZCC code for two users with \(W=2\), four users with \(W=2\) and eight users with \(W=2\) generated using Xilinx 9.2i version

Table 1 shows a comparison among the existing SAC-OCDMA codes with the proposed MRDC, MNZCC codes in terms of code length (N), code weight (W) and cross-correlation value \((\lambda _{c})\). It is shown that the proposed MRDC exhibits the least code length as compared to the other existing codes for 30 numbers of active users.

3 System performance analysis (Gaussian approximation)

For the analysis of the proposed system, Gaussian approximation is used for the calculation of BER [1, 14, 15]. Since MNZCC code has zero cross-correlation property, there is no overlapping in the spectra of different users. In this work, the effect of incoherent intensity noise is neglected, and therefore, the effect of PIIN is also ignored. The performance of an optical receiver depends on the signal to noise ratio (SNR).The SNR of an electrical signal is defined as the average signal power to noise power \(\left( \hbox {SNR}= \frac{I^{2}}{\sigma ^{2}}\right) \),where \(\sigma ^{2}\) is defined as the variance of different noise sources. ‘I’ is the average photocurrent. In this work, for MNZCC code, only shot noise \((\sigma _\mathrm{sh} )\) and thermal noise \((\sigma _{t})\) are taken into consideration. The noise variance is expressed as below in Eq. (2).

$$\begin{aligned} \sigma ^{2}=\sigma _\mathrm{sh} +\sigma _{t} =2eIB+\frac{4K_{B} T_n B}{R_{L} } \end{aligned}$$
(2)

In the above Eq. (2), ‘e’ is the electronic charge, ‘B’ is the noise equivalent of electrical bandwidth of the receiver,‘\(K_{B}\)’ is Boltzmann constant, ‘\(T_n\)’ is the absolute receiver temperature and ‘\(R_{L} \)’ is the receiver load resistance.

In this work, at the receiver the direct detection technique is utilized, and hence, the code sequence for the proposed MNZCC code that offers zero cross-correlation is expressed as below in Eq. (3) [1].

$$\begin{aligned} \sum _{i=1}^N {C_k (i)C_l (i)} = \left\{ {\begin{array}{l} W\; (k=l) \\ 0 \;(\hbox {otherwise}) \\ \end{array}} \right. \end{aligned}$$
(3)

\(C_k (i)\) represents the ith element of the kth MNZCC code sequence, and \(C_l (i)\) represents the ith element of the lth MNZCC code sequence.

Since shot noise and thermal noise obey negative binomial distribution, the following assumptions are used to analyze the system with transmitter and receiver without much difficulty and for mathematical straight forwardness [1].

The assumptions are

  • Each light source is ideally unpolarized, and its spectrum is flat over the bandwidth \(\left[ {v_0 -{\Delta v}/2,v_0 +{\Delta v}/2} \right] \) where \(v_0 \) and \(\Delta v\) are the central optical frequency and optical source bandwidth, respectively, expressed in Hz.

  • Each power spectral component has an identical spectral width.

  • Each user has equal power at the transmitter.

  • Each bit stream from each user is synchronized.

Using the above assumptions, the system performance is analyzed using Gaussian approximation. The power spectral density (PSD) of the received optical signal is expressed in Eq. (4) as below [1, 1416].

$$\begin{aligned} r\left( v \right) =\frac{P_{r}}{\Delta v}\sum _{k=1}^K {b_k \sum _{i=1}^N {c_k (i)rect(i)} } \end{aligned}$$
(4)

In the above Eq. (4), ‘\(P_{r} \)’ is the effective power of a broadband source at the receiver, ‘K’ is the number of active users, ‘N’ is the MNZCC code length and ‘\(b_k \)’is the data bit of the kth user.

The rect(i) function in Eq. (4) is expressed in Eq. (5) as below [1].

$$\begin{aligned} rect(i)= & {} u\left[ {v-v_0 -\frac{\Delta v}{2N}(-N+2i-2} \right] \nonumber \\&-u\left[ {v-v_0 -\frac{\Delta v}{2N}(-N+2i)} \right] =u\left[ {\frac{\Delta v}{N}} \right] \end{aligned}$$
(5)

In Eq. (5), u(v) represents the unit step function.

From Eq. (4), the sum of power spectral density at the photodetector of the ith receiver during one period can be obtained and is expressed in Eq. (6) as below [1].

$$\begin{aligned} \int _0^\infty {G(v)\hbox {d}v=\int _0^\infty {\left[ {\frac{P_{r} }{\Delta v}\sum _{k=1}^K {b_k \sum _{i=1}^N {c_k (i)c_l (i)rect(i)} } } \right] } } \hbox {d}v \end{aligned}$$
(6)

Substituting Eqs. (3), (4) and (5) in Eq. (6), the power spectral density at the photodetector of the ith receiver during one period is simplified and is expressed as below in Eq. (7) [1].

$$\begin{aligned} \int _0^\infty {G(v)\hbox {d}v=\frac{P_{r} }{\Delta v}} \left[ {\sum _{k=1}^K {b_k W\frac{\Delta v}{N}} } \right] \end{aligned}$$
(7)

In the above Eq. (7), ‘\(b_k \)’is the data bit of the kth user and that takes the value of either one or zero. When all users transmit bit ‘1’, the data become as expressed below in Eq. (8) [1].

$$\begin{aligned} \left[ {\sum _{k=1}^K {b_k } } \right] =\left[ {b_1 +b_2 +b_3 + \cdots +b_K } \right] =W \end{aligned}$$
(8)

Therefore, substituting Eqs. (6) and (7) in Eq. (8) the power spectral density at the photodetector is expressed in Eq. (9) [1].

$$\begin{aligned} \int _0^\infty {G(v)\hbox {d}v=\frac{P_{r} W^{2}}{N}} \end{aligned}$$
(9)

The photocurrent ‘I’ at the output of the photodetector is described in Eq. (10) [1].

$$\begin{aligned} I=\mathfrak {R}\int _0^\infty {G(v)\hbox {d}v} =\frac{\mathfrak {R}P_{r} W^{2}}{N} \end{aligned}$$
(10)

In the above expression, ‘\(\mathfrak {R}\)’ is the responsivity of the photodetector. Other variables are described previously and hence not mentioned here.

Fig. 8
figure 8

A simulation circuit for three users [11]

Power spectral density (PSD) of signal is represented as below in Eq. (11) [1].

$$\begin{aligned} I^{2}=\left( {\frac{\mathfrak {R}P_{r} W^{2}}{N}} \right) ^{2} \end{aligned}$$
(11)

Substituting Eq. (10) in Eq. (2), the noise variance is found and is expressed in Eq. (12) as below.

$$\begin{aligned} \sigma ^{2}=\frac{2eBP_{r} \mathfrak {R}W^{2}}{N}+\frac{4K_B BT_n }{R_L } \end{aligned}$$
(12)

Since the probability of sending bit ‘1’ is 0.5, noise variance is expressed in Eq. (13) as below [1].

$$\begin{aligned} \sigma ^{2}=\frac{eBP_{r} \mathfrak {R}W^{2}}{N}+\frac{4K_B BT_n }{R_L } \end{aligned}$$
(13)

From Eqs. (11) and (13), the average signal to noise ratio (SNR) is calculated in Eq. (14) as below [1, 1416].

$$\begin{aligned} \hbox {SNR}=\frac{I^{2}}{\sigma ^{2}}=\left[ {\frac{\left( {\frac{\mathfrak {R}P_{r} W^{2}}{N}} \right) ^{2}}{\frac{eBP_r \mathfrak {R}W^{2}}{N}+\frac{4K_B BT_n }{R_L }}} \right] \end{aligned}$$
(14)

The probability of error \((P_\mathrm{e})\) or the BER is estimated using Gaussian approximation as described in Eq. (15) as below [1, 1416].

$$\begin{aligned} P_\mathrm{e} =\hbox {BER}=\frac{1}{2}erfc\left( {\sqrt{\frac{\hbox {SNR}}{8}}} \right) \end{aligned}$$
(15)

SNR represents the signal to noise ratio, and erfc is the error complimentary function.

4 Simulation and observation

The developed MRDC and MNZCC codes are validated using an OCDMA transreceiver circuit. The receiver in the circuit employs a direct detection receiving technique. This OCDMA transreceiver circuit simulated using optisystem version 12.0 software. Figure 8 presents the simulation circuit for 3 users.

As shown in Fig. 8, in the encoder side continuous wave (CW) lasers are used as optical source with the input power varying from 0 to −10 dBm, which produces pulses with a repetition rate equal to the bit rate of the system. The code chips for different users are given as input through the user-defined bit sequence generators and are encoded to the equivalent non-return to zero (NRZ) signals. A Mach–Zehnder modulator modulates the signal/data. The modulated signals are multiplexed in a WDM multiplexer or may be combined in a power combiner and are transmitted through a standard single-mode optical fiber. In the receiver side, first a demultiplexer is used to transmit the data to three different receivers. For each receiver, a uniform Fiber Bragg Grating (FBG) that acts as a band-pass filter is used to filter the received signal corresponding to the transmitted wavelength at the source. A PIN photodiode detector is used to convert optical data to electrical signal, which is then transmitted through a low-pass Gaussian filter and regenerators. A visualizer (eye diagram analyzer) is connected at the end to analyze the received signal. Table 2 depicts the parameters used in the simulation.

To test the efficacy of the proposed MRDC and MNZCC codes, various simulation tests are carried out and compared with various recent developed codes addressed in the literature as mentioned below.

Table 2 Parameters used in the simulation [1, 11, 15, 16]
Fig. 9
figure 9

Comparison of the proposed MRDC and MNZCC codes with MS code in terms of BER (log) versus number of active users [15]

Figure 9 exhibits the plot of BER (log scale) versus the number of active users. Figure 9 compares the proposed MRDC and MNZCC codes with a multi-service code (MS) in terms of BER for different numbers of active users. It is observed from the graph that both the MRDC and MNZCC exhibit better BER compared to MS (NB \(=\) 2) and MS (NB \(=\) 3) for almost different numbers of active users. It is also observed that the proposed MNZCC code exhibits the best BER compared to that of the proposed MRDC and multi-service code. However, the variation in BER for all active numbers of users is significantly small between the proposed MRDC and MNZCC codes. This experiment proves that the proposed codes can be used for more than 90 active users while maintaining a low BER and are better compared to the multi-service (MS) code at a data rate of 622 Mbps [15].

Fig. 10
figure 10

Comparison of the proposed MRDC and MNZCC codes with FFH code in terms of BER (log) versus number of active users [17]

Figure 10 also exhibits the plot of BER (log scale) versus the number of active users. Figure 10 compares the proposed MRDC and MNZCC codes with a fast frequency hopping code (FFH) in terms of BER for different numbers of active users. It is observed from this experiment that both the MRDC and MNZCC exhibit better BER compared to the FFH code for almost different number of active users. It is also observed that the proposed MNZCC code exhibits the best BER compared to that of the proposed MRDC and FFH codes. However, the variation in BER for all active number of users is significantly small between the proposed MRDC and MNZCC codes. This experiment is simulated at a data rate of 1 Gbps, and the input power was kept fixed at −10 dBm. It is observed from the results that the proposed codes can accommodate 80 simultaneous active users while maintaining a low BER [17].

Fig. 11
figure 11

Comparison of the proposed MRDC and MNZCC codes with MS code in terms of code length versus number of active users [15]

Figure 11 shows the plot of code length versus the number of active users. Figure 11 compares the proposed MRDC and MNZCC codes with a multi-service code (MS) in terms of code length for different numbers of active users. It is observed from the plot that the proposed MRDC code exhibits least code length compared to the MS code for almost different number of active users. It is also observed that the proposed MNZCC code requires the worst code length compared to that of the proposed MRDC and MS codes. However, the variation in the code length for all active number of users is significantly small between the proposed MNZCC and MS codes [15]. For example, for 50 numbers of active users, MS and MNZCC require 128 code length. Similarly, for 60 numbers of active users, MS requires 150 code length and MNZCC requires 128 code length. However, when the number of active users increases to 80, the code length required by the MNZCC code is 256 and the code length required by the MS code is 200. However, the code length of the proposed MRDC code remains at the bottom and least among many other existing SAC-OCDMA codes [15].

Fig. 12
figure 12

Comparison of the proposed MRDC and MNZCC codes with MS code in terms of BER (log) versus number of active users for different data rates [15]

Figure 12 exhibits the plot of BER (log scale) versus the number of active users. Figure 12 compares the proposed MRDC and MNZCC codes with a multi-service (MS) code in terms of BER for different numbers of active users at two different data rates such as 2.5 and 10 Gbps. It is observed from the plot that both the MRDC and MNZCC exhibit better BER compared to MS (NB \(=\) 2) for almost different number of active users at respective data rates. It is also observed that the proposed MNZCC code exhibits the best BER compared to that of the proposed MRDC and multi-service code at both 2.5 and 10 Gbps. However, the variation in BER for all active number of users is significantly small between the proposed MRDC and MNZCC codes at 10 Gbps. Or, in other words the performance of the proposed MNZCC and MRDC is almost similar at a data rate of 10  Gbps. This experiment indicates that the proposed codes can accommodate or support 50 simultaneous active users at a data rate of 10 Gbps while maintaining a low value of BER [15].

Fig. 13
figure 13

Comparison of the proposed MRDC and MNZCC codes with variable cross-correlation code in terms of BER (log) versus fiber length (km) for different data rates [16]

Figure 13 exhibits the plot of BER (log scale) versus the fiber length (km). Figure 13 compares the proposed MRDC and MNZCC codes with a variable cross-correlation (VCC) code in terms of BER for different fiber lengths at two different data rates 622 Mbps and 2.5 Gbps. It is observed from the simulation graph that both the MRDC and MNZCC exhibit better BER compared to the VCC code for different fiber lengths at respective 622 Mbps and 2.5 Gbps data rates. The pattern observed is similar for all types of codes. As the fiber distance increases, the BER decreases and as is obvious the BER is less for higher data rates. For example, the BER for a particular code, say the proposed MNZCC code at a distance of 40 km at 622 Mbps, is less compared to that of BER for the same MNZCC code at a distance of 40 km at 2.5 Gbps. Data rate and BER are inversely proportional to each other. However, at 622 Mbps the MRDC and MNZCC codes exhibit the same value of BER for the fiber length of 10–50 km. At 2.5 Gbps also both the proposed codes show similar performance except when the fiber length varies from 15 to 30 km. However, for both the cases the proposed MRDC and MNZCC codes exhibit better performance compared to the variable cross-correlation code at both 622 Mbps and 2.5 Gbps [16]. This experiment clearly indicates that both the proposed MNZCC and MRDC codes are suitable for a fiber distance of 40–45 km while maintaining the threshold value of BER. On other hand, the variable cross-correlation code is suitable only for 25–30 km [16].

Fig. 14
figure 14

Eye diagram for 10 active users, at a data rate of 622 Mbps, and fiber length 40 km for the proposed MNZCC code

Figure 14 represents the eye diagram of the proposed MNZCC code at 622 Mbps while keeping the fiber length fixed at 40 km and the number of active users are kept fixed at ten. It is found that the BER to be better than many other existing SAC-OCDMA codes such as ZCC code and MD code as addressed by the authors recently [1]. All other simulation parameters are kept identical to that of MD code. MD code exhibits a BER of \(10^{-13 }\) for 10 numbers of active users, and the proposed MNZCC code exhibits a BER of \(10^{-24}\) for the same numbers of active users. It is also found to be better than the ZCC code as reported by the authors recently [18].

5 Conclusion

Two novel codes, one referred in this work as MRDC code with zero to one cross-correlation and another referred as MNZCC code with zero cross-correlation property for SAC-OCDMA systems, are successfully designed and simulated. The new code family shows a better system performance as compared to the former SAC-OCDMA codes with the same system complexity [1, 1518]. The MNZCC code offers several advantages such as zero cross-correlation, minimum BER, more flexibility, and simple code construction as compared to that of other existing SAC-OCDMA codes [211]. Also, the codes offer better flexibility in terms of code parameters such as number of users, fiber distance (km), code weight, cross-correlation, and the number of users can be increased without any increase in the code weight and code complexity. In the absence of multiple access interference and PIIN, the system shows excellent performance with spectral amplitude coded asynchronous optical CDMA. Unlike the other existing SAC-OCDMA codes, in the proposed MRDC code, the code length does not increase with the increase in the number of users, no overlapping of spectra for different users [12]. Finally, simplicity in the code construction, flexibility in cross-correlation control and minimum BER during transmission have made these codes suitable for future OCDMA applications. It is observed from the simulation experiments that both the proposed MRDC and MNZCC codes support 100–120 active users at 622 Mbps, 80 simultaneous active users at 1 Gbps and 50 simultaneous active users at 10 Gbps respectively. The proposed codes can accommodate a fiber distance of 40–45 km with an acceptable level of BER at different data rates. This implies that the code is suitable for (fiber to the home) FTTH applications at a data rate of 622 Mbps to 10 Gbps. In almost all the other existing SAC-OCDMA codes, the code length grows exponentially with the number of active users, which is very much unlikely in case of the proposed MRDC code. In the proposed MRDC code, the code length equals the sum of the number of active users and the code weight unlike the other existing codes keeping the code length within a limit [12].