Code Division Multiplexing

Code division multiplexing (CDM) is a multiplexing technique that uses spread spectrum communication. In spread spectrum communications, a narrowband signal is spread over a larger band of frequency or across multiple channels via division. It does not constrict bandwidth’s digital signals or frequencies. It is less susceptible to interference, thus providing better data communication capability and a more secure private line.
When CDM is used to allow multiple signals from multiple users to share a common communication channel, the technology is called Code Division Multiple Access (CDMA). Each group of users is given a shared code and individual conversations are encoded in a digital sequence. Data is available on the shared channel, but only those users associated with a particular code can access the data.
Each communicating station is assigned a unique code. The codes stations have the following properties − 
If code of one station is multiplied by code of another station, it yields 0.
If code of one station is multiplied by code of another station, it yields 0.
If code of one station is multiplied by itself, it yields a positive number equal to the number of stations.
If code of one station is multiplied by itself, it yields a positive number equal to the number of stations.
The communication technique can be explained by the following example − 
Consider that there are four stations w, x, y and z that have been assigned the codes cw , cx, cy and cz and need to transmit data dw , dx, dy and dz respectively. Each station multiplies its code with its data and the sum of all the terms is transmitted in the communication channel.
Thus, the data in the communication channel is dw . cw+ dx . cx+ dy . cy+ dz . cz 
Suppose that at the receiving end, station z wants to receive data sent by station y. In order to retrieve the data, it will multiply the received data by the code of station y which is dy.
data = (dw . cw+ dx . cx+ dy  . cy+ dz . cz  ) . cy
	  =	dw . cw . cy + dx . cx . cy+ dy . cy . cy+ dz . cz . 
cy
	  =0 + 0 + dy . 4  + 0 = 4dy

Thus, it can be seen that station z has received data from only station y while neglecting the other codes.
The codes assigned to the stations are carefully generated codes called chip sequences or more popularly orthogonal sequences. The sequences are comprised of +1 or –1. They hold certain properties so as to enable communication.
The properties are − 
A sequence has m elements, where m is the number of stations.
A sequence has m elements, where m is the number of stations.
If a sequence is multiplied by a number, all elements are multiplied by that number.
If a sequence is multiplied by a number, all elements are multiplied by that number.
For multiplying two sequences, the corresponding positional elements are multiplied and summed to give the result.
For multiplying two sequences, the corresponding positional elements are multiplied and summed to give the result.
If a sequence is multiplied by itself, the result is m, i.e. the number of stations.
If a sequence is multiplied by itself, the result is m, i.e. the number of stations.
If a sequence is multiplied by another sequence, the result is 0.
If a sequence is multiplied by another sequence, the result is 0.
For adding two sequences, we add the corresponding positional elements.
For adding two sequences, we add the corresponding positional elements.
Let us ascertain the above properties through an example.
Consider the following chip sequences for the four stations w, x, y and z − 
[+1 -1 -1 +1], [+1 +1 -1 -1], [+1 -1 +1 -1] and [+1 +1 +1 +1]
Each sequence has four elements.
Each sequence has four elements.
If [+1 -1 -1 +1] is multiplied by 6, we get [+6 -6 -6 +6].
If [+1 -1 -1 +1] is multiplied by 6, we get [+6 -6 -6 +6].
If [+1 -1 -1 +1] is multiplied by itself, i.e. [+1 -1 -1 +1]. [+1 -1 -1 +1], we get +1+1+1+1 = 4, which is equal to the number of stations.
If [+1 -1 -1 +1] is multiplied by itself, i.e. [+1 -1 -1 +1]. [+1 -1 -1 +1], we get +1+1+1+1 = 4, which is equal to the number of stations.
If [+1 -1 -1 +1] is multiplied by [+1 +1 -1 -1], we get +1-1+1-1 = 0
If [+1 -1 -1 +1] is multiplied by [+1 +1 -1 -1], we get +1-1+1-1 = 0
If [+1 -1 -1 +1] is added to [+1 +1 -1 -1], we get [+2 0 -2 0].
If [+1 -1 -1 +1] is added to [+1 +1 -1 -1], we get [+2 0 -2 0].
The commonly used orthogonal codes are Walsh codes.