# CDMA and correlation function

In layman terms, what does it mean that correlation function is being high between received signal and the code?

Does this mean that the received signal is compared against spreading codes and the one with most bits being equal to bits of received signal is used for despreading?

• To clarify, do you know what is a “correlation function” and what does it do? Have you looked at the mathematics of it? – Edgar Brown Jan 26 at 15:39
• @Edgar Brown Are you reffering to sliding dot product? – Navi Jan 26 at 15:41
• Yes. Is there any other? en.m.wikipedia.org/wiki/Cross-correlation. Do note that the exact same operations do the exact same thing regardless of the numerical representation space. – Edgar Brown Jan 26 at 15:46
• @Edgar Brown If I understood correctly, the second function is represented by the code and it's being time-shifted and then sliding dot product is calculated. But I still don't undetstand how the correct code it's choosen to despread the signal. – Navi Jan 26 at 15:53
• @Edgar Brown The one with the highest correlation between time-shifted versions, or between set of codes that are compared with received signal? – Navi Jan 26 at 15:59

## 1 Answer

In CDMA the spreading is for distributing the energy of each information symbol to a wider bandwidth. In time domain the operation is just multiplication of each symbol with a spreading sequence, that is the same for all symbols. The time period of the spreading sequence is the same as time period of a symbol. However, since the spreading sequence has much higher chip rate than symbol rate, this naturally causes the spread signal bandwidth to increase respectively.

In the receiver, the despreading is done by multiplying with the same spreading code as was used in the transmitter. Since this is effectively the same thing as correlation, you can consider the despreading also as correlation. The key thing in spreading codes is that they are orthogonal, meaning that they do not correlate with each other. So, despreading with a different spreading code gives zero as a result (or zero-averaged noise if despreading is done as sliding correlation). Only using the correct spreading code is able to combine the energy of the spreaded signal. So, mathematically speaking the despreading gives high correlation result for the used spreading code, and zero correlation for the other spreading codes.

• What exactly does it mean "despreading with a different spreading code gives just zero-averaged noise" on this example telecomhall.com/…? – Navi Jan 27 at 15:20
• @Navi I was thinking despreading done as filtering (FIR), like it can be implemented. You know, filtering is convolution in time domain, that is basically the same as correlation but in reversed order. However, if the spreading code values are set to filter taps in reversed order, then the result is the same as with correlation. Now, the correlation with a wrong spreading code gives exactly zero, but only when the symbols are exactly aligned. So, in case of filtering with a wrong spreading code the result is zero at instants where the symbols are aligned, but non-zero at other instants. – Malakias Jan 28 at 18:47