Abstract In this paper, new spectral optical codes based on the construction parity check matrix of LDPC codes were designed and implemented in an optical code-division multiple access communication system. Two types optical family codes can be obtained with respectively a cross correlation of λ c = 0 {\lambda _c} = 0 and λ c = 1 {\lambda _c} = 1 . In each case, the codes can either be decoded using the direct detection or the balanced detection. Performance was evaluated by referring to the Q factor, the bit error rate and the eye pattern diagrams using Optisystem 9.0.