Thursday, February 3, 2022

Python Code Implementation of Code Division Multiple Access(CDMA) with output to test the orthogonality and auto-correlation of code to be used for CDMA operation

Hello !!
Below is python program of CDMA and its basic function with output. The CDMA python program can be used to test the orthogonality and auto-correlation of code to be used for CDMA operation - cdma in Computer network program in python. CDMA in Mobile Communication python program with output.

Before understanding the program code for CDMA in python, let's take a look at the theory and revise the basic concepts of CSMA in Computer Networks and Mobile Computing.
 
CDMA Theory Summary in short:-
  • What is CDMA full form?

The full form of CDMA is “Code Division Multiple Access.” 

  • What is CDMA ?

It's a type of multiplexing that allows numerous signals to share the same transmission channel. CDMA employs a "spread-spectrum" approach, in which electromagnetic energy is dispersed to create a signal with a greater bandwidth. 

  • Why use of CDMA?

This method allows numerous individuals on different cell phones to share a frequency bandwidth by "multiplexing" them over the same channel. 

  • Advantages of CDMA?

Thus, making the best use of the available bandwidth.


The Complete Running Python source code of  CDMA :-

Implementation of a basic function of Code Division Multiple Access(CDMA) and to test the orthogonality and auto-correlation of code to be used for CDMA operation python code program



import numpy as np
print("***\nCDMA \n***\nEnter the data bits")
z1=int(input("Enter the D1 bit:"))
z2=int(input("Enter the D2 bit:"))
z3=int(input("Enter the D3 bit:"))
z4=int(input("Enter the D4 bit:"))
c1=[1,1,1,1]
c2=[1,-1,1,-1]
c3=[1,1,-1,-1]
c4=[1,-1,-1,1]
rc=[]
r1=np.multiply(c1,z1)
r2=np.multiply(c2,z2)
r3=np.multiply(c3,z3)
r4=np.multiply(c4,z4)
resultant_channel=r1+r2+r3+r4;
print("Resultant Channel",resultant_channel)
Channel=int(input("(Enter Digits as C1=1 ,C2=2, C3=3 C4=4)\nEnter  the station to listen : "))
if Channel==1:
    rc=c1
elif Channel==2:
    rc=c2
elif Channel==3:
    rc=c3
elif Channel==4:
    rc=c4
inner_product=np.multiply(resultant_channel,rc)
print("Inner Product",inner_product)
res1=sum(inner_product)
data=res1/len(inner_product) 
print("Data bit that was sent",data)


Output for the Complete Running Python source code of  CDMA :-


Programs:-

For many other Language Programs of Computer Network, Mobile Computing, microprocessor 8086, C++ , Data Structures , etc and MSBTE diploma,BCA,MCA and engineering related concepts visit our  BLOG

No comments:

Post a Comment