Spread spectrum modulation is used as a multiple-access technique in digital cellular communications. CDMA is a spread spectrum modulation technology which provides all users to occupy the same time and frequency by separating them with using their specific codes. A spreading code is multiplied and then a scrambling code is used, for spreading the signals. When the receiver, which has its unique scrambling and spreading codes, gets the summed signal, it extracts its own bitstream by demodulating, descrambling, and despreading the sum signal, basically correlating with known sequence.

If we call each single pulse of the code waveform as chip which has a duration of $T_{c}$ and the symbol period as T, we get a spreading factor $G_{p}=T/T_{c}$ which is the number of chips in one symbol.

If the cross-correlation function (CCF) of $c_{i}$'s and $c_{j}$ over the period is equal to zero: $CCF(i,j)=\int_{0}^{G_{p}T_{c}}c_{i}(t)c_{j}^{*}(t)dt=0$, for all $i\neq j$, they are orthogonal . Multiple information streams can be multiplexed for transmission with using orthogonality.

The same CDMA code is used for spreading and de-spreading. The autocorrelation function (ACF) is wanted to be a Dirac delta function to gain a good correlation with the original data. That is why it can be said that the desirable ACF at time $iT_{c}$ for a spreading sequence $p(t)$, normalized by $G_{p}$ can be given by $$ACF(i)=\left\{\begin{matrix} 1, & i=0 \\ 0, & otherwise \end{matrix}\right.$$

Three factors are considered on the selection of the spreading code:

Autocorrelation: In order to mitigate the ISI and despread the original code, good autocorrelation property can be used. It also helps with synchronization and reduction of interchip interference.

Cross correlation: If all the codes are orthogonal to each other, all the information of other users is demodulated as noise at the receiver. It is needed to have orthogonality between the codes with arbitrary delays, if the systems are unsynchronized.

Number of codes: To provide identification of the users, all the users in a cell and its surrounding cells must have different codes. That is why with the large number of codes the more users can be supported.