## 1. Introduction

Code Division Multiple Access (CDMA) technique has been widely used in wireless communication networks. CDMA communication system allows multiple users to access the network simultaneously using unique codes. Optical CDMA (OCDMA) has the advantage of using optical processing to perform certain network applications, like addressing and routing without resorting to complicated multiplexers or demultiplexers. The asynchronous data transmission can simplify network management and control. Therefore, OCDMA is an attractive candidate for LAN applications. Among all OCDMA techniques, spectral amplitude coding (SAC) can eliminate first order multiple access interference (MAI) when using balanced detection. In SAC-OCDMA the frequency spectrum is partitioned into bins that are present or not according to the spectral code assigned to a particular user. Phase Intensity Induced Noise (PIIN) is known to be the most important source of impairment in SAC-OCDMA systems. Codes with ideal cross-correlation have been studied for many years. In this chapter, a new code with zero cross-correlation property has been constructed and designed for SAC-OCDMA system namely Random diagonal (RD) code. The performance of the OCDMA system is degraded as the number of simultaneous users’ increases, especially when the number of users is large. This is contributed by the MAI effects which arises from the incomplete orthogonal of the used signature codes. The great contribution of this code is the suppression of PIIN and it has been shown that the performance can be improved significantly when there is zero cross-correlation between the code sequences. Direct detection technique gives an advantage in the way to improve the performance of RD code. The study is carried out through a theoretical calculation, and simulation experiment. The simulation design is carried out using various design parameters namely; distance, bit rate, input power and chip spacing. The effect of these parameters on the system was elaborated through the bit error rate (BER) and PIIN. By comparing the theoretical and simulation results taken from the commercial optical systems simulator “ Optsim^{TM} “, we show that utilizing RD code considerably improves the system performance compared with Hadamard, Modified Quadratic Congruence (MQC) and Modified Frequency Hopping (MFH) codes. It is shown that the system using this new code matrices not only suppress PIIN, but also allows larger number of active users compare with other codes. Simulation results shown that using point to point transmission with three encoded channels, RD code has better BER performance than other codes. Also It is seen that the RD code family is effectively suppressed PIIN noise compared with the other SAC-OCDMA codes even though the weight is far less than other codes. This chapter is organized as follows: in section two and three we discus how the code is developed theoretically and also its properties; simulation results for different OCDMA codes are given in section four, and the conclusion is presented in section five.

## 2. RD Code Design for OCDMA Networks and its performance

When some pulses originate from sources other than the desired user, multiple access interference, MAI, limits performance. Detected intensity is only proportional to the number of pulses from interfering users (MAI) in the mean. Intensity fluctuates severely around this mean due to phase induced intensity noise (PIIN), causing much greater signal impairment than first order (in the mean) effects. PIIN is often neglected in theoretical analysis, but has been identified as the limiting noise source experimentally for several types of OCDMA, including spectral amplitude coded SAC-OCDMA. For instance, while a first order analysis of SAC systems using balanced detection shows MAI is completely eliminated (Kavehrad & Zaccarin, 1995), in fact the presence of interferers leads to severe PIIN and eye closing. While a new code for SAC-OCDMA systems called RD code suffers from less PIIN than other SAC-OCDMA codes (the zero cross correlation gain reduces the PIIN), it too is ultimately limited by PIIN. Phase-induced intensity noise arises in every multiple access systems where detection of multiple optical pulses occurs. These pulses may have the same origin, i.e., be time delayed versions of the same pulse, or may originate from different sources with the same or different center wavelengths*.* In general, the power of filtered PIIN depends on the number of interfering pulses and the ratio of optical signal coherence time to the integration time at the detector and never can be cancelled practically. The great contribution of this code is the suppression of PIIN and it has been shown that the performance can be improved significantly when there is zero cross-correlation between the code sequences. In order to effectively extract a signature sequence in the presence of other user’s signature sequences, a set of signature sequence must satisfy the following two properties (Maric, 1993).

Maximal auto-correlation properties: each sequence can be easily distinguished from a shifted version of itself (except for zero shift).

Minimal cross-correlation properties : each sequence can be easily distinguish from other sequences in the set.

An RD code is actually a collection of binary sequences that meet good auto- and cross-correlation, and maximum code weight properties. RD code is constructed using simple matrices operation. For other code, it is defined by Salehi (Chung, Salehi, & Wei, 1989; Salehi, 1989) and others (Hui, 1985; Marie, Hahm, & Titlebaum, 1995; Marie, Moreno, & C. Corrada, 1996) as a means to obtain CDMA on optical network.

Let the {0,1}- valued sequence of the *mth* user be denoted by
*m*=1,2,…..*K*, where *N* and *K* are the code sequence length and total number of subscribed users in the network respectively. *K* must be less than or equal to code family size. Two important conditions should be satisfied during the RD code design which are:

The number of ones,* W*, for the zero shift (s=0), given by the discrete auto-correlation,

Should be maximized

The number of coincidences for every shift’s, in the cross-correlation function of two sequence *C*
_{l}
*C*
_{m}

should be minimized.

The auto-correlation properties are used to enable the receiver to obtain synchronization, that is, to find the beginning of a message and subsequently locate the codeword boundaries. This property is also useful in boosting the signal-to-noise level. The cross-correlation property enables the receiver to estimate its message in the presence of multiple-access interference from other users.

According to the above discussion, RD code principles can be characterized by

In RD code there are two parameters that can be effectively used to evaluate the performance of the code family as a whole: the code family size and code multiple-access interference (MAI)-limited bit error rate. Generally speaking, we want to develop such a code sequence that has both good cross-correlation property, and large code family size. An

1- Zero cross-correlation will minimized the

2- No cross correlation at data segment. The design of this new code can be preformed by dividing the code sequence into two sub-matrixes which are code sub-matrix (code level) and data sub-matrix (data level). The advantages of dividing the RD codes into two parts became easier for hardware implementation using direct detection rather than using different types of detection techniques. Another major advantage of our new codes, including both MQC and MFH, lies in the first property, i.e., elements in each sequence can be divided into groups and each group contains only one “1”. This property makes it much easier to realize the address reconfiguration in a grating-based spectral amplitude-coding optical CDMA transmitter. We can use a group of gratings to reflect all the desired spectral components; and then use another group of gratings to compensate the delays of the desired components and again incorporate them into a temporal pulse.

Note that one of the disadvantages of this code is that the minimum number of weight should be designed for W

*Step1, data segment*: let the elements in this group contain only one “1” to keep cross correlation zero at data level (
_{1}] for example three users (K=3), y(K

Where [Y_{1}]–consists of (K

Notice, for above expression the cross correlation between any two rows is always zero.

*Step2, code segment :* the representation of this matrix can be expressed as follows for W=4

Where [Y_{2}] – consists of two parts weight matrix part and basics matrix part, basic part [B] can be expressed as

And weight part called

weights, let i= (W-3) and M_{i} =
_{i} matrix on [M],given by

For example if W=5, from Eq.(1) i=2, so that [M]=

Notice that to increase the number of users simultaneously with the increase of code word length we can just repeat each row on both Matrixes [M] and [B], for K-th user matrix [M] and [B] can be expressed as

Where j represents the value for K-th user (j=1,2…K), and the value of a_{j} is either zero or one. The weights for code part for both matrix [M], [B] are equal to W-1, so the total combination of code is represented as (K
_{1}], [Z_{1}] = [Y_{1}׀Y_{2}]. The RD code sequences are listed in Table (1) for K=3 and W= 4.

From the above basic matrix Z_{1}, the number of users (K) and the code length (N), is given by (K

As a result we can find that for W=5, 6, and 7 code word length N can be expressed as K+7, K+9 and K+11 respectively. As a result the general equation describing number of users K, code length N and code weight W is given as

The total spectral width

where

Figure 2. shows the spectra of the generated codes for all three transmitter channels. As we can see, the transmitted data of RD code (data segment) is carried over 1549.6 nm, 1548.8 nm and 1548 nm for channel 1, 2 and 3 respectively. The other wavelengths are considered idle (code segment) which will be cancelled at the receiver part using Fiber Bragg grating (FBG) optical filter.

Also RD code can be employed for the large number of users says K=6, with W=5, by evaluating the values of code weight (W) and number of users (K) in Eq. (10) we can get the RD code with code length (N=13). The RD code sequences constructions are shown in Table (2).

### 2.1. The Properties of RD Code

RD codes having the following properties:

1- The code is divided into two segments which is data segment (sub-matrix) and code segment (sub-matrix)

2- No cross-correlation at data segment which minimized λ_{c} and suppressed PIIN (Phase Induced Intensity Noise). Note that certain combinations of simultaneous transmission of codes are always results zero cross correlation. For example, when user 1 and user 4 are transmitted together (table 2).

3- Code segment can be replaced with any type of codes, code segments is divided into two sub-matrixes which are basic sub-matrix and weight sub-matrix. Note that the minimum weights combination at code segment are 2 (W=2), to increase the number of weight of the RD code we just increase the number of 1’s in weight sub-matrix as illustrated in section 3.4.

4- The general relationship between the Number of users (K) and code length (N) are given by

The number of users, K supported by RD code is equivalent to n. For RD codes, W can be fixed at any numbers regardless of the number of users. By fixing W, encoder/decoder design and the signal SNR will be maintained and will not be affected by the number of users. Thus, the same quality of service can be provided for all users. These two features cannot be achieved by other existing codes.

5-More overlapping chips will result in more crosstalk; the minimum number of weight can be achieved by the RD code are equal to three (W=3). Note that the RD code can be design for supporting system having W

6- Flexibility in choosing N, K parameters than other codes like MFH and MDW codes.

### 2.2. Code Comparisons

Many codes have been proposed for OCDMA systems, such as optical orthogonal code (OOC), modified frequency –hopping (MFH) codes, and Hadamard code, but the key points of RD code is that the code length (N), RD code offers better performance than other codes in term of code length for same number of users, K, of 30 as shown in Table 3. Short code length limit the addressing flexibility of the codes, while long code length are considered disadvantage in implementation, since either very wide –bandwidth source or very narrow filter bandwidth are required, RD codes exists for practical code length that are neither too short nor too long.

For example, if chip width (filter bandwidth) of 0.6 is used, the OOC code will require a spectrum width of 218.4 nm whereas, RD code only requires 19.8 nm, and for MFH code it requires 25.2 nm of spectrum width. RD code show shorter bandwidth than other codes. On the other hand too short a code may not be desired because limit the flexibility of the code.

## 3. Detection Schemes of OCDMA

In OCDMA systems, the detection schemes affect the design of transmitters and receivers. In general, there are two basic detection techniques namely coherent and incoherent (Prucnal, 2005). OCDMA communication system can be all optical or partly optical. The information bits may be originally optical or electrical. The all-optical CDMA system is usually an incoherent system. On the other hand, a system consisting of unipolar sequences in the signature code is called incoherent system. A system that uses bipolar codeword is called a coherent system. Since coherent is phase sensitive, the use of such techniques will of course be more difficult than that of incoherent ones. In this work, the incoherent SAC-OCDMA detection schemes will be considered. Based on the RD code constructions a new detection scheme is proposed called spectral direct detection scheme.

### 3.1. Spectral direct detection technique.

The setup of the proposed RD system using direct detection technique (known as spectral direct detection) is shown in Figure 3. The Figure illustrates the implementation of RD code using direct detection scheme whereby only one pair of decoder and detector is required as opposed to two pairs in the complementary subtraction techniques. There is also no subtraction process involved. This is achievable for the simple reason that, the information is assumed to be adequately recoverable from any of the chips that do not overlap with any other chips from other code sequences. Thus the decoder will only need to filter through the clean chips at data segment; these chips are directly detected by a photodiode as in normal intensity nodulation/ direct detection scheme. This technique has successfully eliminated the MAI because the only wanted signal spectral chips at data segment in the optical domain is filtered. This is made possible because, the code properties possess one clean signal chip for each of the channels at the RD data segment. Subsequently, the phase-induced intensity noise (PIIN) is suppressed at the receiver, thus the system performance is improved. Codes which possess non-overlapping spectra such as RD code can generally be supported by this detection scheme. It is also important to note that the whole code’s spectra still need to be transmitted to maintain the addressing signature. This distinguishes the technique from wavelength division multiplexing (WDM) technologies.

### 3.2. RD code detection scheme compared with other SAC-OCDMA codes

In recent years, several codes have been proposed for incoherent OCDMA networks. For example, Modified Frequency hopping (MFH), and Modified Quadratic Congruence (MQC), and Enhanced Double weight (EDW) codes (Hasoon, Aljunid, Anuar, Mohammad, & Shaari, 2007; X. Wei et al., 2001; Z. Wei & Ghafouri-Shiraz, 2002a). All these codes are based on SAC employing complementary detection techniques (known as the complementary subtraction). The transceiver design for RD code is based on direct detection technique. Figure 4 shows the setup of the proof-of- principle simulation for the proposed scheme. A simple schematic block diagram consists of four users is illustrated in Figure 4. Fibre Bragg Grating (FBG) spectral phase decoder is used to decode the code at data level. The decoded signal is decoded by a photo-detector (PD) followed by a low-pass-filter (LPF) and error detector respectively.

Figure 4.c shows another SAC-OCDMA codes employed complementary detection technique such as MFH, MQC, DW codes. As shown in Figure 4.c, two sets of decoders are used; decoder and complementary decoder, followed by two sets of detectors, correspondingly. The purpose of this setup is to cancel the MAI between the wanted and the unwanted code. The wanted codes are filtered by the corresponding encoder, while the unwanted codes are cancelled by the complementary decoder. The subtraction (the complementary subtraction) is performed after the detectors. In this scheme, it is important to ensure that the total optical power received by both photodiodes is balanced so that the subtraction of the unwanted overlapping channels can be completely done. This is not easily achieved, considering the imperfect and non-uniform responses of the components (such as the losses of the Bragg gratings and couplers), particularly in varying environmental conditions.

In the spectral direct detection technique, shown in Figure 4. b, there is only one single decoder and a single detector required and no subtraction is required for the detection. This is achievable for the simple reason; the information is adequately recovered from any of the chips that do not overlap with any other chips from other code sequences. Thus, the decoder will need only to filter the clean chips and this is easily be detected by the photodiode, as in the normal intensity modulation/direct detection scheme.

### 3.3. Mathematical analysis of RD code using direct detection technique

For the proposed system anlysis incoherent intensity noise (

But for RD code

When a broad-band pulse is input into the group of FBGs, the incoherent light fields are mixed and incident upon a photodetector, the phase noise of the fields causes an intensity noise term in the photodetector output. The coherence time of a thermal source

Where G(v) is the single sideband power spectral density (PSD) of the source. The Q-factor performance provides a qualitative description of the optical receiver performance, the performance of an optical receiver depends on the signal-to-noise ratio (SNR). The Q-factor suggests the minimum SNR required to obtain a specific BER for a given signal. The SNR of an electrical signal is defined as the average signal power to noise power [SNR= I^{2}/

Where

e electron’s charge

I Average photocurrent

I

^{2}The power spectral density for IB noise-equivalent electrical bandwidth of the receiver.

K

_{B}Boltzmann’s constant.T

_{n}Absolute reciver noise temperature.R

_{L}Receiver load resistor.

In Eq. (16), the first term results from the shot noise, the second term denotes the effect of Phase Intensity Induced Noise (PIIN) [9,8], and the third term represents the effect of thermal noise. The total effect of PIIN and shot noise obeys negative binomial distribution (Zheng & Mouftah, 2004). To analyze the system with transmitter and receiver, we used the same assumptions that were used in (X. Wei et al., 2001; Z. Wei & Ghafouri-Shiraz, 2002a, 2002b) and are important for mathematical simplicity. Without these assumptions, it is difficult to analyze the system. We assume the following:

Each light source is ideally unpolarized and its spectrum is flat over the bandwidth [

Each power spectral component has identical spectral width.

Each user has equal power at receiver.

Each bit stream from each user is synchronized.

Based on the above assumptions, we can easily analyze the system performance using Gaussian approximation. The power spectral density of the received optical signals can be written as (X. Wei et al., 2001):

where

From Eq. (17) the power spectral density at photodetector of the lth receiver during one bit period can be written as :-

Eq. (19), can be simplified further as follows

In Eq. (20),

where
_{c} is the central frequency of the original broad-band optical pulse.

By using the properties of RD code Eq. (22) becomes

The power spectral density for I^{2} can be expressed as

When all the users are transmitting bit “1,” using the average value as
^{2} as in Eq. (25)

Noting that the probability of sending bit ‘1’ at any time for each user is

Finally, from Eq. (23) and Eq. (26), we can calculate the average SNR as in Eq.(27)

Where P_{sr} is the effective power of a broadband source at the receiver. The bit-error rate (BER) or probability of error, P_{e} is estimated using Gaussian approximation (Goodman, 2005) as

P_{sr} = −10 dBm is the optical received power, B = 311 MHz is the receiver’s noise-equivalent electrical bandwidth, η = 0.6 is the photodetector quantum efficiency,
_{n} = 300 K is the receiver temperature, R_{L} = 1030

## 4. Simulation Results

Using Eq.(28), the BER of the RD code is compared mathematically with other codes which use similar techniques. Figure 5 shows the relation between the number of users and the BER, for RD, MFH, and Hadamard codes, for different values of K (number of active users). It is shown that the performance of the RD code is better compared with the others even though the weight is far less than other codes, which is 7 in this case. The maximum acceptable BER of 10^{-9} is achieved by the RD code with 125 active users than for 85 by MHF code. This is good considering the small value of weight used. This is evident from the fact that RD code has a zero cross-correlation while Hadamard code has increasing value of cross-correlation as the number of users increase. However, a few code specific parameters are chosen based on the published results for these practical codes (Aljunid, Ismail, & Ramil, 2004; X. Wei et al., 2001). The calculated BER for RD is achieved for W=7 while for MFH, MQC and Hadamrad codes were for W=14, W=8 and W=128, respectively.

In OCDMA systems, phase induced intensity noise (PIIN) is related to multiple access interference (MAI) due to the overlapping of spectra from different users. Here, the relations between PIIN noise and received power are analyzed. Previously it shown that MAI can be almost reduced due to the zero cross-correlation at data segment. Thus the effect of MAI is not elaborated further. Figure 6 shows the relations between PIIN noise and received power (P_{sr}). The values of B, K, and
_{sr} varied from -30 dBm to 30 dBm. When the received power increases the PIIN noise for MFH, MQC, Hadamard and RD codes increase linearly. The PIIN noise of RD codes family is less than compared to that of MFH and MQC codes. As shown in Figure 6 the PIIN noise can be effectively suppressed by using RD code family. This is because of the superior code properties of RD code family, such as zero cross-correlation at data level while Hadamard code has increasing value of cross-correlation as the number of users increase. It is shown that the performance of the RD code is better compared with the others even though the weight is far less than other codes, which are 3 in this case.

Figure 7. shows the bit error rate variation with the effective power P_{sr.} The number of simultaneous users (K=80), and W=7, 14 for RD and MFH codes respectively. The solid line represents the BERs, taking into account effects of intensity, shot noise and thermal noise. The dashed line indicates the BER performance when the effect of only intensity and shot noise is considered. It is shown that, when P_{sr} is low, the effect of intensity noise becomes minimal, and hence the thermal noise source becomes the main factor that limit the system performance. It is also shown that thermal noise is much more effective than intensity noise under same P_{sr.}

In table (4), the important properties of RD, MFH, and Hadamard codes are listed. The table shows that RD codes exist for any natural number while Hadamard codes exist only for the matrix sequence m, where m must at least be equivalent to two. On the other hand, MFH codes exist for prime number q only. The number of users supported by RD code is equivalent to n. On the other hand, for Hadamard and MFH codes, the number of user supported depends on m and q, respectively, which in turn, alters the value of weight W. This will affect both the design of the encoder–decoder and the SNR of the existing codes in use. In contrast, for RD codes n can be fixed at any even or odd numbers regardless of the number of users. From this table the RD codes have a zero cross-correlation while Hadamard code has increasing value of cross-correlation as the number of users increases. For MFH codes, although the cross correlation is also fixed at 1 but the BER is higher than the RD code. MFH needs higher number of q or W to increase SNR, as shown in Figure 5.

Figure 8 shows the BER increases as the fiber length increases for the different techniques. The tests were carried out at a rate of 2.5 and 5 Gb/s for 30-km distance with the ITU-T G.652 standard single-mode optical fiber (SMF). All the attenuation
_{C} can be expressed as: D_{C} = D
_{cen}, where P_{cen} is the optical power level which corresponds to the chip center. Thus, the data sent ‘‘1’’ is always well-detected. The only error that can occur in this situation is when the data sent is ‘‘0’’, as in the ideal case. In terms of fiber length, it can be noted that the dispersion effect increases as the fiber length increases. However, for this particular chip duration, the dispersion has no impact on the BER for optical fibers shorter than 20 km. on the other hand, when the fiber’s length is greater than 20 km, system performance is deteriorated. In this particular system, direct technique can support higher number users than the conventional technique because the number of filters at the receiver is reduced, thus a smaller power loss. Note that the very low BER values are just a measure of the quality of the received signals as calculated by the simulator, although they may not be very meaningful, practically speaking.

The eye pattern diagrams for RD code (employing spectral direct detection scheme) and MFH code (employing complementary detection scheme) are shown in Figure 9. The eyes diagram clearly depict that the RD code system gives better performance, having a larger eye opening. This figure shows the corresponding simulated BER for RD and MFH codes systems, the vertical distance between the top of the eye opening and maximum signal level gives the degree of distortion. The more the eye closes, the more difficult it is to distinguish between 1s and 0s in the signal. The height of the eye opening at the specified sampling time shows the noise margin or immunity to noise (Keiser, 2003).

## 5. Conclusion

In this chapter, method to develop, characteristics and performance analysis of a new variation of optical code structure for amplitude-spectral encoding OCDMA system are presented. The RD code is provide to provide simple matrices constructions compared to the other SAC-OCDMA codes such as Hadamard, MQC and MFH codes. This code posses numerous advantages including efficient and easy code construction, simple encoder/decoder design, existence for every natural number n, zero cross correlation at data level (

The cross correlation functions of the signature codes or sequences have very much to do with the detection construction of all future OCDMA applications. The reason is obvious, making traditional OCDMA signal detection very difficult if the cross correlation properties are not under control. In this chapter, a new detection technique known as spectral direct detection has been proposed for SAC-OCDMA systems. The performance was evaluated based on RD code. The simulation setup and mathematical equations are derived in term of the variance of noise source (shot noise, PIIN, and Thermal noise) and BER. This is achieved by virtue of the elimination of MAI and PIIN by selecting only the data segment from SAC-signal of the intended code sequence. The overall system cost and complexity can be reduced because of the less number of filters used in the detection process