: In this paper, new code families are constructed for spectral-amplitude coding optical code division multiple access, called random diagonal code for spectral amplitude coding optical code division multiple access networks. Random diagonal code is constructed using code level and data level. One of the important properties of this code is that the cross correlation at data level is always zero, which means that Phase Intensity Induced Noise is reduced. We find that the performance of the random diagonal code will be better than modified frequency hopping and Hadamard code. It has been observed through simulation and theoretical calculation that bit-error rate for random diagonal code perform significantly better than other codes. We analyze the performance of the proposed codes and examine how the code size and correlation properties are related. Three different decoding schemes are used for implementing the system: thin film filter, arrayed waveguide grating and Fiber Bragg Grating....