Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

MCC Expt 2 CSMA

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Department of Computer Engineering Exp. No.

Semester B.E. Semester VII– Computer Engineering

Subject Mobile Application Development Technology Lab

Subject Professor
In-charge

Assisting Teachers

Laboratory

Student Name

Roll Number 17102A0057

Grade and Subject


Teacher’s Signature

Experiment Number 2

Experiment Title Implementation of Carrier Sense Multiple Access (CDMA) technology.

Resources Required Python/Java/C/C++

Objectives (Skill Set / To understand how a signal is transmitted using CDMA technique in which
Knowledge Tested / multiple users can share same frequency for data transmission.
Imparted)

Code-division multiple access (CDMA) is a channel access method used by


various radio communication technologies. CDMA is an example of multiple
access, where several transmitters can send information simultaneously over a
single communication channel. ... CDMA is used as the access method in
many mobile phone standards. CDMA is achieved through the use of spreading
codes, whereby a single data bit is "spread" over a longer sequence of
transmitted bits. These codes, known as chip sequences, must be carefully
Theory of Operation chosen so that the data may be correctly "de-spread" at the receiver. Such codes
are known as orthogonal codes.

CDMA is a form of direct sequence spread spectrum communications. This


spread spectrum communication can be illustrated by using these key elements:

Multiple accesses: The use of spreading codes which is independent for each
user along with synchronous reception will allow multiple users to access the
same channel simultaneously.
Department of Computer Engineering Exp. No.2
Use of Wide Bandwidth: CDMA like other spread-spectrum technologies uses a
wider bandwidth than would otherwise be needed for the transmission of data.
This results in a number of advantages including an increased immunity to
interference and multiple user access.

Level of Security: In order to receive the data, the receiver synchronizes the code
to recover the data. The use of an independent data and synchronous reception
allows multiple users to access the same frequency band at same time.

Direct Sequence

Direct sequence is the most famous spread spectrum technique in which the
data signal is multiplied by a Pseudo-random noise code. A PN code is a
sequence of chips which is given values as -1 and 1 (non polar) or 0 and 1 (polar).
The number of chips within one code is known as the period of this code. The
digital data is directly coded at higher frequency, and the code is generated
pseudo randomly. A receiver knows how to generate the same code and
correlates the received signal with that code to extract the data.

Signal transmission consists of the following steps:

● A pseudo-random code is generated which is different for each channel


and each successive connection.
● The information data modulates the pseudo-random code, and a carrier
signal gets modulated.

The modulated carrier signal is amplified and broadcasted, and the signal
reception also involves the following steps:

● The carrier signal is received and amplified.


● The received signal is mixed with a local carrier to recover the spread
digital signal.
● A pseudo-random code is generated and matched with the anticipated
signal.
Department of Computer Engineering Exp. No.2
● The receiver acquires the received code and phase locks its own code to
it.
● The received signal is correlated with the generated code, and the
information data is extracted.

Example 1

In its simplest form, decoding involves calculating the dot product of the
received bit stream with one user’s spreading sequence. Note that when signals
arrive at the receiver from different users, they linearly add. See the example
below.

Length of chip sequences=n=4

Chip Sequence: 1 0 1 1 0 0

Spreading Sequence: 1 -1 1 1 -1 -1

Transmitted bits, data = 1: 1 -1 1 1 -1 -1

Transmitted bits, data = 0: -1 1 -1 -1 1 1

No transmission: 0 0 0 0 0

Station Spreading Data Transmitted Dot DP /


Sequence Sequence Product n

A -1 +1 -1 +1 Low +1 -1 +1 -1 -4 1

B -1 +1 -1 0 High +1 +1 -1 -1 +4 -1

C -1 -1 1 0 N/T 0 0 0 0 0 0

Received 2 0 0 -2

Thus all transmitted data has been recovered.

Example2.
Take as an example that the data to be transmitted is 1001, and the chip
or spreading code is 0010. For each data bit, the complete spreading
code is used to multiple the data, and in this way, for each data bits, the
spread or expanded signal consists of four bits.

1 0 0 1 Data to be transmitted
Department of Computer Engineering Exp. No.2
0010 0010 0010 0010 Chip or spreading code

1101 0010 0010 1101 Resultant spread data output

With the signal obtained and transmitted, it needs to be decoded within the
remote receiver:

Incoming
1101 0010 0010 1101 CDMA
signal

Chip or
0010 0010 0010 0010 spreading
code

Result of
000 000
1111 1111 de-sprea
0 0
ding

1 0 0 1 Integrated output

Program A_data = input("Enter A Data:")


A_data = -1 if A_data == '0' else 1

B_data = input("Enter B Data:")


B_data = -1 if B_data == '0' else 1

A_code = input("Enter 8-bit A Code:")


A_code = [-1 if x == '0' else 1 for x in A_code ]

B_code = input("Enter 8-bit B Code:")


B_code = [-1 if x == '0' else 1 for x in B_code]
Department of Computer Engineering Exp. No.2
A_station = []
B_station = []
C_station = []
for i in range(8):
A_station.append(A_data * A_code[i])
B_station.append(B_data * B_code[i])
C_station.append(A_station[i] + B_station[i])

print("A Code:", A_code)


print("B Code:", B_code)
print("A Station:", A_station)
print("B Station:", B_station)
print("C Station:", C_station)

decoded_A_data = 0
decoded_B_data = 0
for i in range(8):
decoded_A_data += A_code[i] * C_station[i]
decoded_B_data += B_code[i] * C_station[i]

print("Decoded A Data:", 1 if decoded_A_data > 0 else 0)


print("Decoded B Data:", 1 if decoded_B_data > 0 else 0)
Output

Conclusion CDMA technique applied for a given set of data bits for transmission.

You might also like