CDMA Basics

Mariner 9 and Walsh Code
Channel Selection using Walsh Codes
Party Effekt to explain CDMA

Code Division Multiple Access

Frequency Spreading

Transmission of music or speech is considered “narrowband”. Only about 10 kHz bandwidth is required to transmit the signal with amplitudes or with frequency modulation. Even if the signal is digitized like in IS-54, it is still narrowband. This is good for a the capacity of a given frequency band, but it also has disadvantages. One of the disadvantages is that a narrow-band signal is more sensitive to interference. If there are poor transmission conditions at a certain frequency, it would be better to change the frequency. In GSM, this is achieved through frequency hopping. This practically means that on average the GSM signal is no longer narrowband but rather broadband. This is therefore referred to as frequency hopping spread spectrum (FHSS). A narrow band signal is artificially „spreader“ over a wider frequency range.

spread spectrum principle

Another way to “spread” a signal is to transmit a whole sequence of bits at a higher frequency instead of one bit at lower frequency. The sequence of bits used to „spread“ the signal should have certain properties. Especially it should create a “noise-like” spectrum. Such sequences are often referred to as “codes”. Such codes have certain interesting mathematical properties.

Examples are the Hadamard codes or Walsh codes.

Mariner 9 und Walsh Code

In 1971 a space craft flew to Mars. It was the first space craft ever to go into orbit around Mars and take pictures of the surface. Those pictured where send back to earth. This mission was called Mariner 9. So far there haven’t been many good pictures of Mars. All that was known so far from rough and noisy pictures from a previous missions was that Mars had many craters, similar to the Moon. Back in 1971 it was already a great achievement to send a space craft to Mars. Another achievement was a camera that could take „digital“ pictures and send these digital pictures back to earth. The camera had a resolution of 700 x 832 pixels. Each pixel had 64 brightness levels. So per pixel 6 bits of information had to be transmitted to earth.

Now, it is a long distance from Mars to Earth and the crafts’s transmitter didn’t have as much power as it would be required. This could not be compensated for by large receiving antennas on Earth. The received signals were noisy and at least 20% of the bits were disturbed. So it was necessary to protect the data. After trying several means for protection like e.g. repetition of data, it was decided to use so-called Hadamard codes. (In another context, these are also referred to as Walsh codes). Hadamard codes always have a length of a power of two, i.e. 2, 4, 8, 16, 32, and consist of binary values (1 and 0). The creation of the code is mathematically complex. For simplicity, all Hadamard codes with length 8 are shown in the following image.

Hadamard Codes with the length of 8

The Hadamard codes have the advantageous property that they all have a maximum Hamming distance when they are compared to each other. We remember that Hamming distance is the number of different bits. The more bits are different, the greater the distance and the more bits that are the same, the smaller the Hamming distance and the codes are more similar to each other. Let’s take code word 1 and code word 4 as an example

The Hamming distance is 4. In fact, the Hamming distance is always 4 no matter what code you use. This makes the codes suitable error protection. In our case, 3 bits can be encoded and one bit can always be corrected. The correction is made by always selecting the code at the receiver that has the shortest distance to the received code word.

A Hadamard code with a length of 32 bits was chosen for the Mariner. This allows the 6 bits of brightness levels to be encoded and it was possible to correct up to 7 bits. With this error correction, Mariner 9 was able to send thousands of sharp pictures of the surface of Mars, providing completely new insights into this planet.

Picture of the Mars surface after error correction with Hadamard Codes

The Hadamard codes had achieved two things. The signal for transmitting the images was spread (from 6 bit to 32 bit). This made it more broadband and less sensitive against disruptions. Furthermore transmission errors could be corrected.

Channel selection using Walsh Codes

Let’s say we spread a digital signal using Walsh codes. Let’s take the 8 Walsh Codes from the chapter above as an example. This time we code with 1 and -1.

Walsh Codes with 1 and -1

We spread a signal by multiplying the Walsh codes by the bits to be transmitted. So instead of one bit, we transmit 8 bits. The principle of CDMA is that all “channels” created by Walsh code spreading, are transmitted simultaneously at the same frequency. Let’s take three channels as an example: 2, 4 and 6. In these channels we transmit the following information: 1,-1; -1, 1 and -1,-1. We now spread with the three Walsh codes and obtain the sequence shown in the in the table below. If we add all sequences we obtain the orange sequence. This sequence will be transferred.

Example: Spreading with Code Words

If now, the received (orange) sequence is multiplied with the Walsh Code 2, and if we add all values and divide them by 8, we get the original information bit. The same holds for the codes 4 and 6. However if we use the same approach with the Walsh code 3, that was not used, the result is 0 and therefore invalid.

So we can reconstruct the original signals from the sum signal.

This makes it possible to create different transmission channels that do not differ in the time or frequency in which they are transmitted, but in the code that was used for spreading. For this reason it is called Code Division Multiple Access (CDMA). The principles of CDMA and the use of codes in communication was already known from military applications and space travel, but it took the effort and commitment of a company called Qualcomm to use it for mobile communications.

Party Effect explaining CDMA

It seems puzzling how create channels using spreading and codes. On the other hand, everybody understands the division in time slots and frequency channels. This is because there is a „free space“ in the space of time and frequency.

Let’s compare the situation with a gathering of perhaps 20 people in a room in which couples want to talk to each other. If everyone talks at once, no one understands anything. In order to ensure communication, there could e.g. be separate small rooms for each couple that separates them from the other couples. This would correspond to FDMA. Another possibility would be to introduce a time slots. Each couple can only talk to each other for a certain amount of time within a time slot. Then it’s another couple’s turn. That would correspond to TDMA.

Let’s assume that 10 couples speak 10 different languages. Even if everyone speaks at the same time, it is still possible to recognize and understand the own language. All other „foreign“ languages simply merge into background noise. Such a situation corresponds to CDMA, with the different codes corresponding to different languages.