MATLAB Implementation of Multiuser Code Division ... - Google Sites

3 downloads 128 Views 184KB Size Report
implementation for various strategies like, multiuser code division multiple ... Index Terms—Multi-user CDMA, Hadamard
JOURNAL OF TELECOMMUNICATIONS, VOLUME 7, ISSUE 2, MARCH 2011 40

MATLAB Implementation of Multiuser Code Division Multiple Access A. A. Patel, A. D. Patel

Abstract—Some of the difficulties in the study of new generation wireless mobile systems are lack of practical implementation for various strategies like, multiuser code division multiple accesses, assigning radio resources using DSSS, use of orthogonal codes etc. In this paper we are going to discuss some of the above stated problems with their implementation issues. CDMA is a scheme by which multiple users are assigned radio resources using DS-SS techniques. Although all users are transmitting in the same RF band, individual users are separated from each other via the use of orthogonal codes. Capacity is defined as the total number of simultaneous users the system can support, and quality is defined as the perceived condition of a radio link assigned to a particular user. We have use MATLAB as a simulation tool and result shows how multi-user CDMA performs under certain circumstances. Index Terms—Multi-user CDMA, Hadamard code, Walsh code, Orthogonal code, MATLAB 1. INTRODUCTION Wireless communication is one of the most emerging areas in the field of voice and data transmission. The fast growing cellular industry provides higher and higher capacities for more and more subscribers each year. After a long discussion about the best method for multiple accesses, CDMA (Code -Division Multiple Access) has emerged as one of the best multiple access schemes. In CDMA communication systems, all the subscribers share the common channel. Unlike TDMA (Time-Division Multiple Access) and FDMA (Frequency-Division Multiple Access), where each user is assigned a unique time slot or channel, users in CDMA experience direct interference from the other users “[1].

1.1 Multi Access System Sharing of the uplink channel can be provided by one or more of the following multi access: Static Multi access Demand Assigned Multi access Random Multi access The choice of a multi access protocol depends upon the traffic characteristics of the network. Dynamic multi access methods are differentiated from the static multi access methods by virtue of their ability to allocate channels and channel resources to individual users “on demand.” In order to accommodate the demand for wireless communication services, efficient use of limited available

frequency spectrum is imperative. Static Multi access is very old and common technique. Under a static allocation, a user’s portion of the channel may be idle when another user could use it. In such instances, a dynamic allocation strategy is desirable. Furthermore, when the set of active users change with time, some method is needed to dynamically reallocate the channels to the various users as they come and go. Random multi access methods allow users to transmit whenever they want without considering orthogonality with other users. The need for random multi access arises in various scenarios like, if the number of potential users is much larger than the number of active users and when data from individual users are so busty that the control overhead of the DAMA protocol is unacceptable. “[5]

1.2 Code Division Multiple Access (CDMA) Cellular System These systems provide multiple accesses while using the same frequencies for all the users at the same time. This is made possible by using a technique called Spread-Spectrum Techniques. A CDMA system with orthogonal codes is an example of static channel sharing. That is, the user signals are completely separated by orthogonal codes as they are separated in frequency and time in FDMA and TDMA systems, respectively. When semiorthogonal codes are used in a CDMA system, interference occurs among active users just as collision occurs in a random multi access channel. Thus a CDMA system has some

© 2011 JOT http://sites.google.com/site/journaloftelecommunications/

JOURNAL OF TELECOMMUNICATIONS, VOLUME 7, ISSUE 2, MARCH 2011 41

characteristics of a random multi access channel. While random multi access channels generally require retransmission in case of collisions, CDMA systems allow detection of individual users even in the presence of multi access interference without necessitating retransmission. Consequently, a larger number of users can be accommodated in a CDMA system by allowing multiple access interference (MAI) in the uplink channel. Since the number of semi-orthogonal codes is not fixed, CDMA systems are said to be of soft capacity. “[5]

below once and invert diagonally as shown in the above example. For the given seed,

1.3 Orthogonal Codes Two general categories of spreading sequences have been used: PN (pseudo noise or pseudorandom number) sequences and orthogonal codes. PN sequences are the most common ones used in FHSS systems and DSSS systems not employing CDMA. In DSSS CDMA systems, both PN and orthogonal codes have been used. In this article, I'll examine orthogonal sequences. When the DSCDMA system can be guaranteed to be synchronous, it is preferable to use orthogonal sequences for spreading. This results in the complete elimination of MAI.

H2 H4= H2

In order to avoid mutual interference on the forward link, Walsh codes are used to separate individual users while they simultaneously occupy the same RF band. Walsh codes as used in IS-95 are a set of 64 binary orthogonal sequences. These sequences are orthogonal to each other, and they are generated by using the Hadamard matrix. Recursion is used to generate higher order matrices from lower order ones; that is,

H

2N

 HN =   HN

HN   H N 

H

Where, N contains the same but inverted elements of HN. The main purpose of Walsh codes in CDMA is to provide orthogonality among all the users in a cell. Each user traffic channel is assigned a different Walsh code by the base station. Rule of Thumb: For generating the matrix is for a given seed repeat it over right once and

H

2

 0 =   0

0   0 

Therefore, to derive a set of four orthogonal Walsh sequences W0, W1, W2, and W3, we only need to generate a Hadamard matrix of order 4 “[2], or

0

0

0

0

H 2 0 = H 2 0 0

1

0

1

0 1

1 1

1 0

2. RELATED WORK The first cellular networks were based on analog radio transmission technologies such as Advance Mobile Phone System (AMPS). “[7]

Figure 1: Evolution of Cellular Systems

2.1 Early Uses 1. One of the early applications for code division multiplexing—predating, and distinct from cdmaOne—is in GPS. 2. The Qualcomm standard IS-95, marketed as cdmaOne. 3. The Qualcomm standard IS-2000, known as CDMA2000. This standard is used by several mobile phone companies, including the Global star satellite phone network. 2.2 Ongoing Research On CDMA 1. Increase capacity by joint decoding (multiuser detection & interference cancellation) 2. Applying CDMA to other applications: optical CDMA, adhoc networks, dense wireless LANs

© 2011 JOT http://sites.google.com/site/journaloftelecommunications/

JOURNAL OF TELECOMMUNICATIONS, VOLUME 7, ISSUE 2, MARCH 2011 42

3. “MultiCDMA”: multiple antenna CDMA, multicarrier CDMA, multicode CDMA “[5]

M1(t) * W1(t) =

-1 +1 -1 +1

+1 -1 +1 -1

-1 +1 -1+1

Similarly for the M2 (t) and M3 (t)

3. MATLAB IMPLEMENTATION MATLAB has evolved over a period of years with input from many users. In university environments, it is the standard instructional tool for introductory and advanced courses in mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high productivity research, development, and analysis. “[4].

M2(t) * W2(t) = -1 -1 +1 +1

-1 -1 +1 +1

+1 +1 -1 -1

M3(t) * W3(t) =

-1 +1 +1 -1

-1 +1 +1 -1

+1 -1 -1 +1

The spread-spectrum signals for all three messages, M1 (t) * W1 (t), M2 (t) * W2 (t), and M3 (t) * W3 (t), are combined to form a composite signal C (t); that is, C(t) = M1(t) * W1(t) + M2(t) * W2(t) + M3(t) * W3(t)

The resulting C (t) is C(t) = -1 -1 -1 +3 -1 -1 +3 -1 -1 +3 -1 -1

Figure 2: generation of CDMA transmitted signals

Channelization is done in following steps: • Generate Walsh Codes • Generate Codes for each message • Transmitted Signal • Retrieval of message

C (t) is the composite signal that is transmitted in the single RF band. If there are negligible errors during the transmission process, the receiver intercepts C (t). In order to separate out the original messages M1 (t), M2 (t), and M3 (t) from the composite signal C (t), the receiver multiplies C (t) by the assigned Walsh code for each message “[3]: C(t)W1(t) = 1 -1 C(t)W2(t) = 1

1

1 3 1 -1 -3 -1 3 1

1

C(t)W3(t) = 1 -1 -1 -3 1 -1

Suppose that there are three different users, and each user wishes to send a separate message. The separate messages are: M

1

M

2

=

M

3

=

=

[+ 1 [+ 1 [− 1

−1

+ 1]

+1

− 1]

+1

+ 1]

C(t)W1(t) =1 M1(t) =

M2(t) =

W

1

W

2

=

W

3

=

= =

[− 1 [− 1 [− 1 [− 1

− 1

− 1

+ 1

− 1

− 1

+ 1

+ 1

+ 1

] + 1] + 1] − 1]

The signal to be transmitted is calculated to be M (t) * W (t). This is shown: M1(t)

=

+1

M1(t)

= +1 +1 +1 +1

-1 -1 -1 -1

W1(t)

=

-1 +1 -1 +1

-1 +1 -1 +1

-1

1

+1 +1 +1+1 +1 -1 +1 -1+1

m(t) m(t) m(t)

-1

3 1

1 1 -1

3

1

3 -1

1

-3

-1 1

3

1

1

3

-1

-1

1

3

1

-3

-1

1 -1

4

1

3

-1

1

4

-3

-1

1

3

-1

1

-4

-1 -3 1 -1 3

-4

m(t) = 1 m(t) = -1

1

-4

C(t)W3(t) = 1 -1

− 1

1 -1

4

M3(t) = 0

1 3

4

C(t)W2(t) = 1

There respective codes are as follows: W

-1

-1

4

1

1 4

if M(t) > 0 if M(t) < 0 -1 1 1

1 -1 1

3.1 Mathematical Terms If original signal is d (t) of power Ps, and the code sequence is given by g(t), the resultant modulated signal is,

© 2011 JOT http://sites.google.com/site/journaloftelecommunications/

JOURNAL OF TELECOMMUNICATIONS, VOLUME 7, ISSUE 2, MARCH 2011 43

s (t ) = 2 P S d (t ) g (t )

rcv(t ) = 2 Ps d (t )

The multiplication of the data sequence with the spreading sequence is the first modulation. Then the signal is multiplied by the carrier which is the second modulation. The carrier here is analog.

In CDMA we do modulation twice. First with a binary sequence g(t), the properties of which we will discuss below and then by a carrier. The binary sequence modulation ahead of the carrier modulation accomplishes two functions,

s(t ) = 2 PS d (t ) g (t ) sin(2π fct )

1. It spread the signal and 2. It introduces a form of encryption because the same sequence is needed at the receiver to demodulate the signal.

Here, s(t)=Spreaded signal which is transmitted, sin (2Πfct) = carrier analog signal, Where, fc = carrier frequency and t = time. On the receive side, we multiply this signal again with the carrier. What we get is this.

In IS-95, we do this three times, once with a code called Walsh, then with a code called Short Code and then with one called Long code. “[6]

s(t ) = 2PS d (t ) g (t )sin 2 (2π fct )

4. RESULTS

By the trigonometric identity

sin 2 (2π fct ) = 1 − cos(4π fct ) We get

rcv(t) = 2Psd(t)g(t)(1− cos(4π fct)) Where, rcv (t) =received signal at receiver Where the underlined part is the double frequency extraneous term, which we filter out and we are left with just the signal.

The steps for getting the result from MATLAB code is given below. Let’s generate the hadamard code, hadamard(n); /* inbuilt function for generation of hadamard matrix, n is power of 2 */ zeros (n,n); /* Initialize matrix */ /* converting physical value to binary */ for i=1:n for j=1:n h (i,j)=(c(i,j)+1)/2; end; end;

rcv(t ) = 2 Ps d (t ) g (t )

Then XOR the input data with hadamard code,

Now we multiply this remaining signal with g(t), the code sequence and we get,

if d12(m1) = -1 then a2(:,m1) = h2; else a2(:,m1) = (-1)*h2; Here d12 is data variable, when data is -1, output is as it is otherwise negative, h2 is walsh code and a2 is output.

rcv(t ) = 2 Ps d (t ) g (t ) g (t ) Now from having used a very special kind of sequence, we say that correlatation of g(t) with itself (only when perfectly aligned) is a certain scalar number which can be removed, and we get the original signal back.

Now perform addition off all signals which we will get from above procedure. A=a2sym+a3sym+………....... + aNsym

© 2011 JOT http://sites.google.com/site/journaloftelecommunications/

JOURNAL OF TELECOMMUNICATIONS, VOLUME 7, ISSUE 2, MARCH 2011 44

Performance of multiuser CDMA

-1

10

Now add the noise,

data1 data2

EbNovec =0:1:20; /* noise vector */ sn=length(EbNovec); /* noise vector length */ for i=1:sn EbNo = EbNovec(i); snr=EbNo; /* signal to noise ratio */ r = awgn(A,snr); /* generating noise through inbuilt function */ rth=zeros(1,spred2); r1=zeros(1,spred2); for m=1:spred2

-2

BER

10

-3

10

-4

10

0

2

4

6 8 EbNo (dB)

10

12

14

Figure 4: Result of BER versus Eb\No for two users Performance of multiuser CDMA

-1

10

if r(m)