• No results found

Simulation of a CDMA system based on optical orthogonal codes

N/A
N/A
Protected

Academic year: 2021

Share "Simulation of a CDMA system based on optical orthogonal codes"

Copied!
81
0
0

Loading.... (view fulltext now)

Full text

(1)

optical orthogonal codes

Examensarbete utf¨ort i Datatransmission vid Tekniska H¨ogskolan i Link¨oping

av

Andreas Karlsson Reg nr: LiTH-ISY-EX-3532-2004

(2)
(3)

optical orthogonal codes

Examensarbete utf¨ort i Datatransmission vid Tekniska H¨ogskolan i Link¨oping

av

Andreas Karlsson Reg nr: LiTH-ISY-EX-3532-2004

Supervisor: Danyo Danev Tobias Ahlstr¨om Examiner: Danyo Danev Link¨oping 14th April 2004.

(4)
(5)

!" !" # $ $ % & $ ' (') * + , - $ . (- $. + & + *. $ , -/ 0 12" '3"-," " ! 4" " 1 . 0 $ $ 5555 ! + 6(()))7 7. 7 ( /800( ( !( ( " 1 . ' . $ 4 9 : 0 ; $ . * ' . 4 9 : 0 * & . + $ .& * #! : + : * . :0 &

1 * $ + + $+ * & 0 + 0 && & 0 &

& & ..) . . . * + &+ .7<

&+ = + * . . && 0 &"& * * . . && >?<"4 9 :@7 ?<"4 9 : &+ $ * $ = & & ..* & * ) * )+ &+ 0 & . + $ .& * ><<4@71+ &+ . ( & +

. & * ) * * + & * & .& . / & + 7

+ ...& * & & * + &+ 8 $ * 0 48

& * 471+ 0 * 8 * + + )+ . 47: ) ) + 0 A 0 &+& * ) * 48 * . + ) ..71+ $ + $+ & 0 $ * * + + * & + ) * * $ ) + .. 0 0. .. 71+ . + 0 . * 9 .07 1+ . + . + ) + B-% + ...& * && 0. *

&++ $+ + + * .& & 7B & + + $+ + & &

+ .* 0 * 0 . + *) . 0.7

) *

4 9 : ?<"4 9 : * <<4 & . & * . . . && 9 : B-%

(6)

Abstract

To take advantage of the high speed in an optic fiber, one of the basic concept in fiber optic communication is to allow several users to simultaneously transmit data over the channel. One technique that provides multiple access is fiber optic-code division multiple access (FO-CDMA). In FO-CDMA each user is assigned one or more signature sequences called codewords, which are subsets of a type of optical orthogonal code (OOC). The channel input/output consists of the superposition of several users codewords and at the receiver end an optical correlator extracts the information.

In the parallel code constructions, presented in this report, each user j is as-signed a subsetCj from a codeC. The subsets are disjoint and their union is the

whole setC. A new way to map the information bits is to insert up to L zeros before each codeword fromCj and let this represent information aswell. This gives

high rates for active users but an investigation is needed to ensure that this does not compromise the systems wanted property of sending information with a small probability of errors for all users. Therefore a simulation environment has been implemented in Matlab.

The result from these simulations shows that BER for theL parallel codes is acceptable and not much higher than for the traditional constructions. Because of the higher rate these construction should be preferred but an analysis if a hardware implementation is possible might be needed.

Keywords: CDMA, FO-CDMA, superimposed, OOC, correlation, cardinality, multiple access, MAI, BER, Matlab, simulation

(7)
(8)

Preface

This report is the result of my thesis work ”simulation of a CDMA system based on optical orthogonal codes” which comprise 20p and was done in datatransmission at ISY in Link¨oping. The thesis work started in November 2003 and was completed in April 2004 and it finally means the end of my university studies and a Master of engineering in electronics design.

The report is split into 5 chapters:

chapter 1 is an introduction to the report and gives the background, purpose and limitations for this thesis.

chapter 2 tells the basics of FO-CDMA as it is used today and the orthogonal codes needed for this technique to work.

chapter 3 presents theL parallel code constructions, that are later used in the simulations.

chapter 4 presents how theL parallel code constructions have been implemented in Matlab.

chapter 5 contains the results and conclusions from the simulations. Also sug-gestions for further studies are presented here.

(9)
(10)

Abbreviations

AOOC Acyclic Optical Orthogonal Code

BER Bit Error Rate.

TDMA Time Division Multiple Access. FDMA Frequency Division Multiple Access. CDMA Code Division Multiple Access.

FO-CDMA Fiber Optic Code Division Multiple Access. L,PCWS L Parallel Code Without Synchronization.

L,PCVS L Parallel Code with Varying Synchronization element. L,PCFS L Parallel Code with Fixed Synchronization element. L,PCE L Parallel Code with Error detecting property. L,PCEC L Parallel Code with Error Correcting property. MAI Multiple Access Interference.

OOC Optical Orthogonal Code

(11)
(12)

Contents

1 Introduction 1 1.1 Background . . . 1 1.2 Purpose . . . 2 1.3 Method . . . 2 1.4 Limitations . . . 2

2 Fiber optic communication 3 2.1 FO-CDMA . . . 4

2.2 Optical orthogonal codes . . . 6

2.3 Acyclic optical orthogonal codes . . . 8

3 L parallel code 11 3.1 L parallel code without synchronization . . . 12

3.1.1 Cardinality and rate forL, P CW S . . . 12

3.1.2 DecodingL, P CW S . . . 13

3.2 L parallel code with varying synchronization element . . . 14

3.2.1 Cardinality and rate forL, P CV S . . . 15

3.2.2 DecodingL, P CV S . . . 16

3.3 L parallel code with fixed synchronization element . . . 17

3.3.1 Cardinality and rate forL, P CF S . . . 17

3.3.2 DecodingL, P CF S . . . 19

3.4 L parallel code with error detecting property . . . 19

3.4.1 Cardinality and rate forL, P CE . . . 19

3.4.2 DecodingL, P CE . . . 21

3.5 L parallel code with error correcting property . . . 21

3.5.1 Cardinality and rate forL, P CEC . . . 22

3.5.2 DecodingL, P CEC . . . 23

3.6 Summary of the L parallel code schemes . . . 24

4 Matlab implementation of the L parallel code schemes 29 4.1 Code generators . . . 29

4.2 Implemented encoders . . . 30

4.3 Implemented decoders . . . 31 vii

(13)

4.4 Main functions . . . 35

5 Results and conclusions 41

5.1 System performance as a function of number of active users . . . 41 5.2 System performance as a function ofL . . . 50 5.3 Further studies . . . 63

(14)

Contents ix

List of Figures

2.1 A FO-CDMA system withi users . . . 3

2.2 Superposition of codewords. . . 5

2.3 Example of ordinary parallel code. . . 5

2.4 The message (0,1,0,1,1,1,1,0) encoded by the ordinary parallel code with four codewords. . . 5

2.5 Cyclic shifted codeword. . . 7

2.6 Acyclic shifted codeword. . . 9

3.1 The message (0,0,1,1,1,0,1,0,1,0,0,0) encoded byL, P CW S with two codewords. . . 14

3.2 Rate as a function ofL and a comparison with the ordinary parallel code with rate K/n. . . 26

3.3 Rate as a function of codeword length . . . 27

4.1 Overview of the Matlab functions. . . 40

5.1 BER as a function of number of active users for the ordinary parallel code. . . 43

5.2 BER as a function of number of active users for L, P CV S. . . 43

5.3 System performance as a function of number of active users for L, P CW S. . . 44

5.4 System performance as a function of number of active users for L, P CF S. . . 45

5.5 System performance as a function of number of active users for L, P CE. . . 46

5.6 System performance as a function of number of active users for L, P CEC. . . 47

5.7 Summary of BER as a function of number of active codewords. . . . 48

5.8 Summary of idle mode errors as a function of number of active code-words. . . 49

5.9 Rate as a function of L for the codes used in the simulations. . . 52

5.10 System performance as a function ofL for L, P CW S, P=0.2. . . 53

5.11 System performance as a function ofL for L, P CW S, P=0.3. . . 54

5.12 System performance as a function ofL for L, P CW S, P=0.4. . . 55

5.13 BER as a function ofL for L, P CV S. . . 56

5.14 System performance as a function ofL for L, P CF S, P=0.2. . . 57

5.15 System performance as a function ofL for L, P CF S, P=0.3. . . 58

5.16 System performance as a function ofL for L, P CE, P=0.2. . . 59

5.17 System performance as a function ofL for L, P CE, P=0.3. . . 60

5.18 System performance as a function ofL for L, P CEC, P=0.2. . . 61

(15)

List of Tables

2.1 Required codeword length for a given cardinality and weight for an

optimal OOC. . . 8

3.1 Properties forL and K for the L parallel code constructions. . . 24

3.2 Cardinality and rate for the L parallel code constructions. . . 24

3.3 Expression for whatL0 that gives the maximum rate. . . 25

(16)

Chapter 1

Introduction

Ever since the mid 90’s optical fibers have been used for point to point communi-cation at a very high speed. Often the optical fiber offers much higher speed than the speed of electronic signal processing at both ends of the fiber. So to be able to take the full advantage of the speed in optical fibers one of the basics concepts in fiber optic communication is the idea of allowing several users to transmit data simultaneously over the communication channel. This is calledmultiple access.

There are several techniques to provide multiple access and one of them is fiber optic-code division multiple access (FO-CDMA). In FO-CDMA each user is assigned one or more binary signature sequence, so called codewords. The data to be sent is mapped onto the codewords and the different users codewords are ”mixed” together and sent over the channel. At the receiver end a decoder, which is individual for each user, compares the incoming sequence with stored copies of the codewords to be able to extract the information bits.

A set of codes that are suitable for FO-CDMA are optical orthogonal codes (OOC) and was first introduced by Saheli [7], and are presented in chapter 2. These have the desired property that it should be easy to extract data with the desired codeword in the presence of other users codewords.

1.1

Background

The traditional encoding process for FO-CDMA is to send a codeword or the equal amount of zeros depending on the information bit being 1 or 0. This means that to be able to transmit one information bit we are sending a whole codeword and if the codewords are long the rate could be rather low. However this is often acceptable because of the high speed in the fiber optic channel. But as the speed of electronic signal processing increases it becomes more important to have a high rate in the optical channel. This can be achieved by an effective mapping of the information bits onto the codewords in the encoding process.

A new way of mapping the data bits onto the codewords is called L parallel 1

(17)

code [1], [2]. Here the information bits are encoded not only by the codewords itself but also by the successive delays between the transmission of the codewords (formal definitions will be given later). This gives high rates for active users but an investigation is needed to ensure that this does not compromise the systems wanted property of sending information with a small probability of errors for all users.

1.2

Purpose

High rates and many active users often result in many codewords are sent simul-taneously over the channel and this can cause interference between users. This is calledmultiple access interference (MAI). The purpose of this thesis work has been to create a model for theL parallel scheme described in chapter 3 and investigate how MAI affect the probability of error.

1.3

Method

The model has been implemented in Matlab because of its easy handling with vectors and matrices. For the encoding and decoding process each of the five L parallel codes were implemented in a Matlab function, which are called by a function that simulates transmitting and receiving.

For the simulation a suitable OOC has been chosen and each L parallel code has been simulated separately.

1.4

Limitations

In the real case there can be interference from noise in the fiber optic channel. In this report all physical noise (such as shot, thermal and beat noise) is neglected and it focus only on the crosstalk between users, i.e. MAI. This is an approximation because the inclusion of physical noise may have affect on the system performance [3]. However the purpose of this work is to investigate the performance with respect to MAI.

There are more or less complex decoding techniques that can use all users codewords to statistically decide whether or not a codeword has been sent. In the simulation environment created for this work the simplest decoder has been used, namely only comparison with the users own codewords.

Another limitation in the model is the absence of an external error correction method, such as a forward error correction (FEC) scheme. This might decrease the system performance but on the other hand the result of this model can be used for decision of what (FEC) scheme is necessary.

(18)

Chapter 2

Fiber optic communication

Code division multiple access (CDMA) is a technique that are used for several communication systems. Other techniques for multiple access are Frequency Divi-sion Multiple Access (FDMA) or Time DiviDivi-sion Multiple Access (TDMA) but one of the main advantages of CDMA is its flexibility. When a FDMA system has a user in every frequency channel or a TDMA system has a user in each time slot the systems are full and no more users are allowed to use the channel. In CDMA the maximum number of users are not fixed but allowing more users to access the channel means lower rates for active users. In a CDMA system you can control the potential number of active users versus the rate and this makes the system flexible. The figure below shows a FO-CDMA network withi pairs of transmitters and receivers. User 1 User 2 Useri Data in Data in Data in Encoder 1 Encoder 2 Encoder i Optical fiber Decoder 1 Decoder 2 Decoder i Code generator +

Figure 2.1. A FO-CDMA system with i users

(19)

In this chapter we will discuss how CDMA is used today in fiber optic commu-nication and the orthogonal codes needed for this technique to work.

2.1

FO-CDMA

Fiber optic code-division multiple access (FO-CDMA) is one technique to allow several users to transmit simultaneously over the same optical fiber. A FO-CDMA system can, for each user, be described by a data source, containing the data that will be sent, followed by an encoder and then a laser that maps the signal from electrical form to an optical pulse sequence. At the receiver end an optical correlator is used to extract the encoded data.

In a FO-CDMA system it is common that each user is assigned one signature sequence calledcodeword. Each bit of information data is encoded by the signature sequence consisting of a number of shorter bits calledchips. When this sequence is sent it represent that a user with that unique signature has sent the information bit ’1’. If the information bit is ’0’ it simply means that we send the corresponding length of zeros i.e. no light pulses during that interval.

All users encoded data are then added together chip by chip and the result, which is called thesuperposition, are sent over the channel. If a light pulse represent the binary bit 1 (mark that this is a chip and not an information bit) and the absence of a light pulse represent the binary bit 0 the superposition mechanism has the following properties.

0 + 1 = 1 + 0 = 1 + 1 = 1

0 + 0 = 0 (2.1)

In this report we will consider the system to bechip synchronized, that is all users chip durations (pulse widths) are of equal lengths and when creating the superposition of chips they overlap each other precisely. Of course the users can be delayed relative each other. Figure 2.2 on the next page shows an example of how the bits are encoded and the superposition of the users codewords that are sent over the channel. Here user 1 is delayed with 3 chips relative user 2.

The individual receivers, consisting of optical correlators, continuously observe the superposition of all incoming pulse transmissions and recovers the data from the corresponding transmitter. This is done by correlation between the incoming signal and stored copies of that users unique sequence. The correlator will give a peak if the incoming stream of optical pulses contains the unique sequence and the presence of other users will be considered as noise. The decoding process is accomplished by using optical correlation.

If a user is assigned one codeword of lengthn it means that n chips will carry one information bit. However some users require higher rate and are therefore assigned more codewords [6]. If a user is assigned K codewords we can encode a block ofK information bits onto n chips and we call this costruction ordinary parallel code. As an example (see figure 2.3) we consider a user having K = 4

(20)

2.1 FO-CDMA 5 Encoder 1 Encoder 2 data=(0,1) User 1 data=(1,1) User 2 + c2: c1: Superposition

Figure 2.2. Example of superposition of codewords. User 1 is delayed 3 chips relative

user 2 S/P 0 1 0 1 data=(0101) User 1 c1 idle c2 idle c3 idle c4 idle + + other users

Figure 2.3. Example of ordinary parallel code. User 1 is assigned four codewords and

sends the message (0,1,0,1)

codewords (c1, c2, c3, c4) and will send the message m1=(0,1,0,1). This will be

encoded by c2 + c4 where ′+′ indicates component wise addition according to

(2.1). The message m2=(1,1,1,0) will be encoded by c1+ c2+ c3. When encoding

(m1, m2)=(0,1,0,1,1,1,1,0) the user will send (c2+ c4, c1+ c2+ c3), which is two

consecutive blocks each of lengthn. This is shown in figure 2.4 below.

c2+ c4 c1+ c2+ c3

| {z }

n

| {z }

n

Figure 2.4. The message (0,1,0,1,1,1,1,0) encoded by the ordinary parallel code with

four codewords (c1, c2, c3, c4).

An important property for a code is itsrate, which is a measurement between the length of information bits and the length of the encoded sequence. So for user

(21)

withK codewords of length n we obtain the rate for the ordinary parallel code as. R = K

n (2.2)

Each user is assigned a subset from a code C. The assignment for the users j = 1, 2, ..., M is done by partitioning of C, so that each user j is assigned distinct subsetsCj. The subsets form a partitioning if they are disjoint and their union is

the whole setC, i.e.

M [ j=1 Cj=C and Ci \ Cj ={∅} f or i 6= j (2.3)

A prerequisite to successfully recover the data is that the signature sequences comes from a family of orthogonal codes. These codes are presented in the next section and have special properties for correlation between codewords and if the correlation is kept low it reduces the crosstalk between users. One of the main goal of a FO-CDMA system is that as many users as possible should be able to access the channel simultaneously and this with a low probability of error. However if we want to produce|C| number of codewords from an OOC with weight w (the number of ones each codeword has) and lowest possible correlation between the codewords, this require a codeword lengthn which is approximately [4].

n ≥ |C|w(w − 1) (2.4)

This tells us that if we want to produce more codewords of the same weight this means we get larger codewords. Because one codeword sent over the channel corresponds to one information bit we get a lower rate.

Therefore methods to develop codes with the desired properties are an essential part of FO-CDMA. Optical orthogonal codes was first introduced by Saheli [7], and these are presented in the next section.

2.2

Optical orthogonal codes

To reduce the crosstalk between users, an important property of the sequences (codewords) is that they produce a low correlation. OOC are a set of binary se-quences with special auto- and crosscorrelation properties. The correlation being low tells us that each sequence in the code can easily be distinguished from a shifted version of itself i.e. the autocorrelation is low, and it can easily be distinguished from any combination of shifted versions of other sequences inC i.e. the crosscor-relation is low. The size of the code is the number of codewords inC and is called itscardinality and is denoted |C|.

An (n, w, λa, λc) optical orthogonal codeC is a set of (0,1) sequences of length

n and weight w (the number of ones in every codeword). The set is constructed so that it has the following two properties [4].

(22)

2.2 Optical orthogonal codes 7

1. Autocorrelation property: for any x ∈ C and any integer τ , 0 ≤ τ < n

n−1

X

t=0

xtxt⊕τ ≤ λa (2.5)

2. Crosscorrelation property: for any x 6= y ∈ C and any integer τ

n−1

X

i=0

xtyt⊕τ ≤ λc (2.6)

The codewords can be cyclic shifted (see figure 2.5) and therefore ⊕ denotes modulon so the correlation becomes periodic correlation. λaandλcare often called

the correlation constraints and from now on we will only discussλa =λc=λ = 1,

which is the lowest possible correlation, and the notation for an OOC will become (n, w, 1). c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) Optical correlator

Figure 2.5. The incoming sequence (c1, c1, c1). The correlator looks at cyclic shifted

codewords.

Often an OOC is denoted by the positions where C has ones. As an ex-ample consider the code C = {c1, c2} = {110100000000000, 100010000100000},

which is an (15, 3, 1) OOC with two codewords. This can be written as C = {{0, 1, 3}15, {0, 4, 9}15}.

What the correlation constraint (λ = 1) also say is that no distances between the positions of ones in the code (C) are repeated. For example the distance between the first and the second one in c1 is 1, but as we look at two

consecu-tive c1’s (cyclic shifted) the distance 14 will also be taken into consideration. In

(23)

{14, 12, 13, 11, 6, 10} are due to cyclic shifts of the codewords (when we look at two consecutive codewords). We see here that no distance is repeated and therefore the code is an OOC withλ = 1. If λ = 2 it means that any distance between the positions of ones cannot be repeated more than once.

A desirable property of a code is that it should be as large as possible, i.e. contain as many codewords as possible. This to enable more users to access the channel. An OOC is said to beoptimal if it has the maximum cardinality for a givenn, w, λ. As mentioned in the previous section the codeword length n increases with increasing cardinality and weight (2.4). In the table below some optimal constructions are presented and it shows what codeword length n is required to construct a code with given size|C| and weight w.

|C| w n 12 5 241 14 5 281 6 6 181 21 6 631 11 7 463 21 7 883 18 8 1009 66 8 3697

Table 2.1. Example of required codeword length n for a given cardinality |C| and weight

w for an optimal OOC construction.

These optimal constructions are presented in [5] and are later used in the sim-ulations for the FO-CDMA system.

When the codewords are sent without any separation between them the cor-relator looks at cyclic shifted versions of the codewords. The cyclic shifts must be taken into consideration when producing an OOC and the correlation must be taken modulo n. But if the codewords are separated with at least the codeword length the correlator only look atacyclic shifted codewords (see figure 2.5). There-fore one can produce codes that only takes acyclic shifts into consideration and we call these codesacyclic optical orthogonal codes (AOOC).

2.3

Acyclic optical orthogonal codes

For the different constructions ofL parallel code, that will be presented in the next chapter, the sent codewords are separated with at least the codeword length. This means that the correlator only looks at acyclic shifted codewords.

If c = (c0, c1, . . . , cn−1) is a codeword of lengthn then cτ, |τ | < n − 1, is the τ

(24)

2.3 Acyclic optical orthogonal codes 9 c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) c1(0), ..., c1(n − 1) 0, 0, 0, 0, ..., 0, 0, 0 0, 0, 0, 0, ..., 0, 0, 0 0, 0, 0, 0, ..., 0, 0, 0 0, 0, 0, 0, ..., 0, 0, 0 0, 0, 0, 0, ..., 0, 0, 0 Optical correlator

Figure 2.6. The incoming sequence (c1, c1) separated with n zeros. The correlator looks

at acyclic shifted codewords.

cτ =                    (c0, c1, . . . , cn−1) ifτ = 0 (0, . . . , 0 | {z } −τ , c0, . . . , cn−1+τ) if − (n − 1) ≤ τ < 0 (cτ, . . . , cn−1, 0, . . . , 0 | {z } τ ) ifn − 1 ≥ τ > 0 (0, . . . , 0 | {z } n ) if|τ | ≥ n (2.7)

The auto- and cross correlation from the previous section were calculated with cyclic shifted codewords so the operations where taken modulon and we called this periodic correlation. If we instead produce the correlation with aτ acyclic shifted codeword (|τ | < n − 1) we call this aperiodic correlation and the produced code C will be an acyclic optical orthogonal code (AOOC) that only takes acyclic shifts into consideration.

The OOC presented in the previous section obviously fulfil aperiodic correlation as well but it can be reduced to only fulfil aperiodic correlation. The code then becomesC = {1101000000, 1000100001}. The codewords are now reduced to length 10 and do not fulfil periodic correlation because the zeros in the end are removed and some distances are therefore repeated (if we look at cyclic shifts). However it fulfils aperiodic correlation and this code is therefore an AOOC withλ = 1. If the codewords are separated in the channel this code should not cause greater bit error rate (BER) for the system, but this is one of the questions this report will investigate.

(25)

possible to find constructions with the same cardinality and weight as an OOC but with shorter codewords. The rate depends of the lengths of the codewords so this means that if we can use an AOOC instead of an OOC this will give us higher rates.

(26)

Chapter 3

L parallel code

In this chapter five types ofL parallel code constructions are presented. As for the ordinary parallel code presented in the previous chapter, every user is given a number of codewords that are a subset Cj from a larger code C (2.3). These

constructions are all a version of the ordinary parallel code but the mapping of information bits onto the codewords is different here to gain a higher rate. In the ordinary parallel code the mapping simply means the codewords are sent or not depending on the information bits being 1 or 0.

The L parallel codes also use a delay between sent codewords to represent information. If a codeword has been detected by the decoder it can calculate the delay between that codeword and other received codewords from the same user. If we know what codewords have been sent from a user and the delay between them, we can use this information to recover the encoded data. First a definition of a delayed codeword is needed.

Definition 1 ((L, l) delayed codeword) For a codeword c = (c0, c1, ..., cn−1)

and every (L, l) 0 ≤ l ≤ L, we define the (L, l) delayed codeword cL(l) to be

the sequence of length 2n + L. cL(l) = (0, 0, ..., 0 | {z } n+l , c0, c1, ..., cn−1 | {z } n , 0, 0, ..., 0 | {z } L−l ) (3.1)

Because the (L, l) delayed codeword start with at least n zeros the sent words are separated with at least the codeword length. This means that the code-words do not need to fulfil periodic correlation because we only look at acyclic shifted codewords.

For a given L the codeword can be delayed in L + 1 different ways (l = 0, 1, 2, ..., L), and therefore the codeword can be represented in L + 1 different ways. One can also represent information by the codeword not being sent, as in the ordinary parallel code presented in the previous chapter. So the number of combinations of binary information bits one codeword can represent can be up to

(27)

L + 2. Because the information bits are binary these combinations corresponds to log2(L + 2) number of bits.

In the next sections the five differentL parallel codes are presented.

3.1

L parallel code without synchronization

The L parallel code without synchronization uses every codeword in C to carry information. Each codeword can be delayed between 0 and L or not being sent. The definition forL parallel code without synchronization can be expressed as. Definition 2 (L parallel code without synchronization) From a code C with the codewords {cj}Kj=1 as elements, and for an integer L, the L parallel code

without synchronization, CL,P CW S is the set.

CL,P CW S =n K X j=1 bjcLj(lj) : (b1, b2, ..., bK)∈ {0, 1}K, (l1, l2, ..., lK)∈ {0, 1, ..., L}K o (3.2)

The sum means the superposition (2.1) of all (L, l) delayed codeword in C. bj

being 1 or 0 simply means the codeword being present in the combination or not. So what the definition above means is that every codeword can be delayed between 0 andL or not being present in the combination at all.

3.1.1

Cardinality and rate for L, P CW S

Thecardinality or the size, |C|, of a code C is the number of codewords the code contains. So if a user is given K codewords we have |C| = K, but if we apply L, P CW S onto these codewords we get another cardinality |CL,P CW S|. This is

the number of combinationsL, P CW S can produce for a given K and L.

As discussed in the section above every codeword inC can have L + 2 different combinations due tolj = (0, 1, ...L) or the codeword could not be sent, which also

is a combination. If there areK codewords in C this gives us that the total number of combinations|CL,P CW S| for a given L and K to be.

|CL,P CW S| = (L + 2)K (3.3)

Another important property of a code is itsrate, which is the relation between the length of the information bits and the length of the encoded sequence. For the ordinary parallel code the rate whereK/n, which means that a user having K codewords can encode K information bits onto n chips, n being the codeword length.

ForL, P CW S we have (L + 2)K different combinations so the number of binary

(28)

3.1 L parallel code without synchronization 13

length of the delayed codewords is 2n + L so the rate is given by. RL,P CW S =log2(L + 2)

K

2n + L =

Klog2(L + 2)

2n + L (3.4)

The expression tells us that if we doubleK the rate is doubled so the maximum rate is independent of the number of codewords and depends only onL (for a given n). d dL(R L,P CW S) = K ln(2) 2n + L − (L + 2)ln(L + 2) (L + 2)(2n + L)2 (3.5)

Setting the expression to zero we obtain the expression for L0 which gives the

maximum rate.

(L0+ 2)ln(L0+ 2)− L0= 2n (3.6)

Because we wantlog2(L + 2) to be a positive integer L must have the following

properties.

L = 2i− 2 : ∀i ∈ N, i ≥ 2

(3.7) To further explain how the mapping of information bits onto the codewords works, consider the following example.

Suppose a user having two codewords (c1, c2), (K = 2) and L = 6. We can

have L + 1 different delays for every codeword or it may not be sent. This gives us (L + 2) = 8 different combinations for each codeword which corresponds to log2(L + 2) = 3 binary bits. The mapping can be expressed as.

(0, 0, 0) ⇒ bj = 0 (0, 0, 1) ⇒ lj = 0 (0, 1, 0) ⇒ lj = 1 (0, 1, 1) ⇒ lj = 2 (1, 0, 0) ⇒ lj = 3 (1, 0, 1) ⇒ lj = 4 (1, 1, 0) ⇒ lj = 5 (1, 1, 1) ⇒ lj = 6

The first three bits are mapped onto c1, the next three bits are mapped onto

c2 and so on. The user has two codewords so the number of bits that can be

mapped onto these codewords is Klog2(L + 2) = 6. For example the message

m1=(0,0,1,1,1,0) will be encoded as c61(0)+c62(5) and the message m2=(1,0,1,0,0,0)

will be encoded as c6

1(4).When encoding (m1, m2)=(0,0,1,1,1,0,1,0,1,0,0,0) the user

will send (c6

1(0)+c62(5), c61(4)), which is two consecutive blocks each of length 2n+L.

This is shown in figure 3.1 on the next page.

3.1.2

Decoding L, P CW S

The decoding process for L, P CW S works in a similar way as for the ordinary parallel code described in chapter 2. The difference here is that the decoder also

(29)

c6 1(0) + c 6 2(5) c 6 1(4) | {z } 2n+L | {z } 2n+L

Figure 3.1. The message (0,0,1,1,1,0,1,0,1,0,0,0) encoded by L, P CW S with two

code-words (c1, c2) and L = 6.

has to compare the delay of the detected codewords. If two codewords have been detected using optical correlation the decoder can calculate the delay between them but to calculate the actual lj it has to know where the block starts. So a system

using L, P CW S has to have synchronized receivers and senders to calculate the actual delay. The decoder then becomes a block-decoder in the sense that the decoder knows when each block of length 2n + L starts. It then knows exactly the delaylj for detected codewords and the data can be recovered.

ForL, P CW S we gain a high rate but the systems flexibility might be decreased because the receivers and senders have to be synchronized during transmission. A solution to this problem can be to always send one codeword without delay (lj= 0),

called synchronization element, so that the delay of the next detected codewords can be compared to this. These constructions are presented in the next sections.

3.2

L parallel code with varying synchronization

element

TheL parallel code with varying synchronization element, L, P CV S also uses every codeword inC to carry information, but only the synchronization element can be sent without delay (lj = 0), and the other codewords are delayed between 1 and

L. The definition for L parallel code with varying synchronization element can be expressed as.

Definition 3 (L parallel code with varying synchronization element) A code C with the codewords {cj}Kj=1 as elements, and for an integer L, the L parallel

code with varying synchronization element, CL,P CV S is the set.

CL,P CV S =ncLs(0) + K X j=1 j6=s bjcLj(lj) :s ∈ {1, 2, ..., K}, bj ∈ {0, 1}, lj ∈ {1, 2, ..., L}, ∀j ∈ {1, 2, ..., K}, j 6= s o (3.8)

The encoding process works in a similar way as for L, P CW S (3.2), but one codeword is always sent without delay and the rest, if they are sent, have a delay between 1 andL. Which codeword that is chosen to be the synchronization element may vary between the encoded blocks. The remainingK − 1 codewords can then have a delay between 1 andL or not being sent at all.

(30)

3.2 L parallel code with varying synchronization element 15

The choice of synchronization element depends on the first log2(K) bits of

information in each block that will be encoded. For example if K = 2 this can represent two binary sequences, 0 and 1, and depending on the first bit in the block of information being 0 or 1 the first respectively second codeword inC becomes the synchronization one. If a user has been given four codewords (c1, c2, c3, c4), the

choice of synchronization element will depend on the firsttwo bits of the information block. (0, 0) ⇒ cL 1(0) (0, 1) ⇒ cL2(0) (1, 0) ⇒ cL 3(0) (1, 1) ⇒ cL 4(0)

This implies that every user must have at least two codewords to be able to send information and the number of codewords K given to each user should be chosen as.

K = 2i

:∀i ∈ Z+ (3.9)

This is of course a limitation but one advantage is that the synchronization element will be able to carry information.

3.2.1

Cardinality and rate for L, P CV S

The synchronization element can be chosen inK different ways. The remaining K − 1 codewords in C are then allowed to be delayed with lj= (1, 2, ..., L) or may

not be sent at all. This gives us the total number of combinations or the cardinality forL, P CV S for a given K and L to be.

|CL,P CV S| = K(L + 1)K−1

(3.10) The total number of combinations can then be used to encode a binary infor-mation sequence of length log2(K(L + 1)K−1). The length of the superimposed

delayed codewords (3.1) is 2n + L so the rate for L, P CV S will be. RL,P CV S= log2(K(L + 1)K−1)

2n + L =

log2(K) + (K − 1)log2(L + 1)

2n + L (3.11)

This means thatK codewords and an integer L can encode log2(K(L + 1)K−1)

information bits onto 2n + L chips. The expression for rate differs from (3.4) because the maximum rate depends both onL and K. To get this expression the derivative with respect toL for a fixed K is calculated and set to zero.

d dL(R L,P CV S) = −ln(K) (2n + L)2ln(2)+ (K − 1) 2n + L − (L + 1)ln(L + 1) (2n + L)2(L + 1) =−ln(K)(L + 1) + (K − 1)(2n + L − (L + 1)(ln(L + 1)) (2n + L)2ln(2)(L + 1) (3.12)

(31)

Setting this to zero we obtain the expression for whatL0 that gives the

maxi-mum rate for a givenK.

(K − 1)(2n + L0− (L0+ 1)(ln(L0+ 1)) =ln(K)(L0+ 1) (3.13)

We have already made some limitation for what valuesK can be. We also want log2(L + 1) to be a positive integer so the following restriction for L is needed.

L = 2i− 1 : ∀i ∈ Z+ (3.14)

To explain how the encoding process works forL, P CV S consider the following example.

Suppose a user having four codewords (c1, c2, c3, c4), (K = 4) and L = 7. The

first log2(K) = 2 information bits are encoded by the synchronization element,

which can be any of the four codewords. The remaining three codewords are then used in a similar way asL, P CW S except the delay cannot be zero (lj 6= 0). The

mapping for the remaining codewords can be expressed as. (0, 0, 0) ⇒ bj = 0 (0, 0, 1) ⇒ lj = 1 (0, 1, 0) ⇒ lj = 2 (0, 1, 1) ⇒ lj = 3 (1, 0, 0) ⇒ lj = 4 (1, 0, 1) ⇒ lj = 5 (1, 1, 0) ⇒ lj = 6 (1, 1, 1) ⇒ lj = 7

So the first two bits are mapped onto the synchronization element. The next three bits are mapped onto c2, and the next three bits are mapped onto c3and so

on. Each of the remaining codewords can then be used to map log2(L + 1) = 3 information bits so the three codewords can totally map (K −1)log2(L+1) = 9 bits.

The message (0,1,1,0,1,1,0,0,1,1,1) will then be encoded by c7

2(0) + c71(5) + c73(4) +

c74(7), and the message (1,1,0,0,0,0,0,1,1,1,0) will be encoded by c7

4(0)+c72(1)+c73(6).

The′+here means chip wise addition according to (2.1).

3.2.2

Decoding L, P CV S

An advantage when decoding L, P CV S is that the receiver does not need to be synchronized with the sender. The decoder is searching for the synchronization element with optical correlation described in chapter 1 and when this element has been found the remaining (K − 1) codewords should be found within L light pulses and the data can be recovered. To be sure that the detected codeword really is a synchronization element and not interference from all other users codeword one can compare the time arrival with the last detected and approved synchronization element, which should be 2n + L chips before. For the approval of the first found

(32)

3.3 L parallel code with fixed synchronization element 17

synchronization element, a buffer can be used and search 2n+L chips forward after the next synchronized element.

The interference from other users codewords and the interference from the users own codewords can cause that a synchronization element can be detected and approved in a wrong place. When using L, P CV S we still obtain a large rate but the decoding process where any codeword can be the synchronized one can be rather complex and decrease the systems flexibility. A way to further increase the flexibility is to let one fixed codeword to always be the synchronization element.

3.3

L parallel code with fixed synchronization

el-ement

L parallel code with fixed synchronization, L, P CF S, works in a similar way as L, P CV S except that the synchronization element is fixed and cannot carry any information itself. What codeword that is chosen to always be the synchronization element has to be known for the decoder to successfully recover the encoded data. This codeword is always sent without delay and the remaining codewords can then be delayed between 0 and L. The definition for L parallel code with fixed synchronization element can be expressed as.

Definition 4 (L parallel code with fixed synchronization element) From a code C with the codewords {cj}Kj=1 as elements and for an integer L, the L

par-allel code with fixed synchronization element, CL,P CF S with c

1 as synchronization

element is the set. CL,P CF S =ncL1(0) + K X j=2 bjcLj(lj) : (b2, ..., bK)∈ {0, 1}K−1, (l2, ..., lK)∈ {0, 1, ..., L}K−1 o (3.15)

The synchronization element is sent for every block i.e. every period of length 2n + L. The remaining K − 1 codewords from C are then delayed between 0 and L or not being sent at all.

3.3.1

Cardinality and rate for L, P CF S

IfC contains K codewords (|C| = K), one of them is always sent as a synchroniza-tion element that do not carry informasynchroniza-tion itself. The remainingK − 1 codewords can each produceL + 2 combinations because lj = (0, 1, ..., L) or the codeword is

not sent. The cardinality forL, P CF S will then become.

|CL,P CF S| = (L + 2)K−1 (3.16)

The total number of combinations can then be used to encodelog2(L + 2)K−1

(33)

is 2n + L so the rate for L, P CF S will be. RL,P CF S =log2(L + 2) K−1 2n + L = (K − 1)log2(L + 2) 2n + L (3.17)

This means that K codewords and the integer L can encode log2(L + 2)K−1

information bits onto 2n + L chips. As for L, P CW S the maximum rate only depends onL. d dL(R L,P CF S ) =K − 1 ln(2) 2n + L − (L + 2)ln(L + 2) (L + 2)(2n + L)2 (3.18)

Setting the expression to zero we obtain the expression for L0 which gives the

maximum rate. This is exactly the same expression that gives the maximum rate forL, P CW S (3.6).

(L0+ 2)ln(L0+ 2)− L0= 2n

Forlog2(L + 2) to be a positive integer L must follow (3.7). Because the

syn-chronization element does not carry any information all users must at least be assignedtwo codewords (K ≥ 2) to be able to send information.

Consider the following example. A user has been assigned the codewords (c1, c2, c3), (K = 3) and L = 14. The first element c1 is the synchronization

element and is always sent without delay. The remainingK − 1 = 2 codewords can haveL + 1 different delays each or it may not be sent. This gives us (L + 2) = 16 different combinations for each codeword which can representlog2(L + 2) = 4

bi-nary information bits. The mapping for each of the remaining codewords can be expressed as. (0, 0, 0, 0) ⇒ bj = 0 (0, 0, 0, 1) ⇒ lj = 0 (0, 0, 1, 0) ⇒ lj = 1 (0, 0, 1, 1) ⇒ lj = 2 (0, 1, 0, 0) ⇒ lj = 3 (0, 1, 0, 1) ⇒ lj = 4 (0, 1, 1, 0) ⇒ lj = 5 (0, 1, 1, 1) ⇒ lj = 6 (1, 0, 0, 0) ⇒ lj = 7 (1, 0, 0, 1) ⇒ lj = 8 (1, 0, 1, 0) ⇒ lj = 9 (1, 0, 1, 1) ⇒ lj = 10 (1, 1, 0, 0) ⇒ lj = 11 (1, 1, 0, 1) ⇒ lj = 12 (1, 1, 1, 0) ⇒ lj = 13 (1, 1, 1, 1) ⇒ lj = 14

(34)

3.4 L parallel code with error detecting property 19

So the remaining two codewords can encode (K − 1)log2(L + 2) = 8 bits. The

message (1,0,0,0,1,0,1,1) will be encoded with c14

1 (0) + c142 (7) + c143 (10) and the

message (0,0,0,0,1,1,1,1) will be encoded as c14

1 (0) + c143 (14).

3.3.2

Decoding L, P CF S

If a user is sending information the synchronization element will be sent in every 2n + L period. The decoder is continuously searching for the synchronization element and when it has been found we know that the remaining codewords that carry the information should appear withinL light pulses. To further ensure that the found synchronization element is found in the right position one could compare its time arrival with the last found synchronization element, which should have been found 2n + L chips before. For the approval of the first found synchronization element, a buffer can be used and search 2n + L chips forward after the next synchronized element.

It is a desirable property that the code itself can detect errors when decoding the incoming sequence. The code presented in the next section is constructed in such way.

3.4

L parallel code with error detecting property

L parallel code with error detecting property, L, P CE, works in a similar way as L, P CF S but every codeword in C is sent in each period. In every period of 2n + L the synchronization element is sent without delay and all of the remaining codewords are sent with a delay between 0 and L. The definition for L parallel code with error detecting property can be expressed as.

Definition 5 (L parallel code with error detecting property) From a code C with the codewords {cj}Kj=1as elements and for an integer L, the L parallel code

with error detecting property, CL,P CE with c

1 as synchronization element is the

set. CL,P CE =ncL 1(0) + K X j=2 cLj(lj) : (l2, ..., lK)∈ {0, 1, ..., L}K−1 o (3.19)

Because every codeword fromC is sent exactly once in every period of 2n + L one can make the decision that an error has occurred if a codeword is found more than once withinL light pulses after the detection of the synchronization element or ifall codewords are not found.

3.4.1

Cardinality and rate for L, P CE

If C contains K codewords (|C| = K), one of them is always sent as a synchro-nization element without delay and do not carry information itself. The remaining

(35)

K − 1 codewords are always sent and can each produce L + 1 combinations because lj= (0, 1, ..., L). The cardinality for L, P CE will then become.

|CL,P CE| = (L + 1)K−1 (3.20)

The total number of combinations can then be used to encodelog2(L + 1)K−1

binary information bits. The length of the superimposed delayed codewords (3.1) is 2n + L so the rate for L, P CE will be.

RL,P CE =log2(L + 1) K−1 2n + L = (K − 1)log2(L + 1) 2n + L (3.21)

This means that K codewords and the integer L can encode log2(L + 1)K−1

information bits onto 2n + L chips. As for L, P CF S and L, P CW S the maximum rate only depends onL.

d dL(R L,P CE ) =K − 1 ln(2) 2n + L − (L + 1)ln(L + 1) (L + 1)(2n + L)2 (3.22)

Setting the expression to zero we obtain the expression for L0 which gives the

maximum rate.

(L0+ 1)ln(L0+ 1)− L0= 2n (3.23)

Because the synchronization element does not carry any information all users must at least be assignedtwo codewords (K ≥ 2). We also want log2(L + 1) to be

an integer soL must follow (3.14).

The following example shows how the encoding process forL, P CE might work. A user is assigned five codewords (c1, c2, c3, c4, c5), (K = 5) and L = 7. The

first element inC is chosen to be the synchronization element and is always sent without delay (l1= 0). The remaining four codewords are always sent with a delay

lj = (0, 1, ..., 7). This gives us L + 1 = 8 combinations for each codewords, which

can be used to maplog2(L + 1) = 3 information bits for each remaining codeword.

The mapping can be expressed as.

(0, 0, 0) ⇒ lj = 0 (0, 0, 1) ⇒ lj = 1 (0, 1, 0) ⇒ lj = 2 (0, 1, 1) ⇒ lj = 3 (1, 0, 0) ⇒ lj = 4 (1, 0, 1) ⇒ lj = 5 (1, 1, 0) ⇒ lj = 6 (1, 1, 1) ⇒ lj = 7

The first three bits are mapped onto c2, the next three bits are mapped onto c3

and so on. The remaining four codewords are then be used to map a total of (K − 1)log2(L+1) = 12 information bits. The message (0,1,0,1,0,1,1,1,0,0,0,0) is encoded

by c7

1(0) + c72(2) + c73(5) + c74(6) + c75(0) and the message (0,0,0,0,0,0,1,1,1,1,0,1)

will be encoded as c7

(36)

3.5 L parallel code with error correcting property 21

3.4.2

Decoding L, P CE

When decodingL, P CE the decoder is continuously searching for the synchroniza-tion element (which codeword that has been chosen to be the synchronized one is of course known by the decoder). When this has been found we know thatall the remaining codewords should be found within L light pulses. If a codeword is detected more than once within L pulses we know that an error has occurred and the incorrect bits can be retransmitted. If however an incorrect detection of a codeword is due to interference from the users own codeword the same combination of delayed codewords will be sent again and the same error will occur.

If we have not detected all codewords L pulses after the detection of the syn-chronization element we know that these detection is due to interference and can be disregarded, and not be used to restore data.

The L parallel code with error detecting property can correct errors to the extension that it can discard detections when all codewords have not been detected withinL pulses, but it can only detect errors when a codeword has been found more than once withinL pulses after the synchronization element. It is therefore desirable to have a code that can correct these errors as well. In the next section such construction is presented.

3.5

L parallel code with error correcting property

In all the code constructions above we have used definition (3.1) for delayed code-words. InL parallel code with error correcting property, L, P CEC, every codeword is sent twice with a separation parameterS between them so a new definition for delayed codeword is needed. This construction is presented in [2].

Definition 6 ((L, l) delayed repeated codeword with separation S) If we have a codeword c = (c0, c1, ..., cn−1), then for every (L, l) 0 ≤ l ≤ L, we define

the (L, l) delayed repeated codeword with separation S, cS,L(l) to be the sequence

of length 3n + L + S. cS,L(l) = (0, 0, ..., 0 | {z } n+l , c(0), c(1), ..., c(n − 1) | {z } n , 0, 0, ..., 0 | {z } S , c(0), c(1), ..., c(n − 1) | {z } n , , 0, 0, ..., 0 | {z } L−l ) (3.24) What this means is that every delayed codeword to be sent is repeated with a separation ofS chips, where S is between 0 and n (n being the codeword length). One should therefore be able to detect this copyn + S chips after the first repeated codeword. If we chooseS = 0, the codeword is repeated without separation so the correlator will look at cyclic shifted codewords and we will need an OOC. If we instead chooseS = n the codewords are separated with the codeword length and we only look at acyclic shifted codewords. IfS = n we should then be able to use an AOOC discussed in section 2.3 on page 8.

L, P CEC works in a similar way as L, P CE in the sense that a synchronization element (known to both sender and receiver) is sent without delay (lj = 0) and

(37)

the remaining codewords are always sent and are delayed between 0 and L. The difference is that the delayed codewords are repeated once with the separationS. The definition forL parallel code with error correcting property can be expressed as.

Definition 7 (L parallel code with error correcting property) From a code C with the codewords {cj}Kj=1 as elements that satisfy correlation based on

S ∈ {0, 1, ..., n}, and for an integer L, the L parallel code with error correcting property, CL,P CEC with c

1 as synchronization element is the set.

CL,P CEC =ncS,L1 (0) + K X j=2 cS,Lj (lj) : (l2, ..., lK)∈ {0, 1, ..., L}K−1 o (3.25) This means that the synchronization is sent in every period of 3n + L + S and a repeated copy n + S chips after. The remaining K − 1 codewords are always sent with a delay between 0 andL, (lj = 0, 1, ..., L), and a repeated copy n + S

chips after. Because every codeword is sent in every period we have the same error detecting property as forL, P CE. But we also know that if a codeword has been detected there should appear a copy of that codewordn+S after. If there is no such copy one can make the decision that the codeword is detected due to interference.

3.5.1

Cardinality and rate for L, P CEC

If C contains K codewords (|C| = K), one of them is always sent as a synchro-nization element without delay and do not carry information itself. The remaining K − 1 codewords can each produce L + 1 combinations because lj = (0, 1, ..., L).

The cardinality forL, P CEC will then become.

|CL,P CEC| = (L + 1)K−1 (3.26)

This is the same cardinality as for L, P CE (3.20) and the mapping of infor-mation bits onto the codewords works in a similar way. So the total number of information bits that can be mapped in each block is thenlog2(L + 1)K−1. The

length of the superimposed delayed repeated codewords (3.24) is 3n + L + S so the rate forL, P CEC will be.

RL,P CEC= log2(L + 1)

K−1

3n + L + S =

(K − 1)log2(L + 1)

3n + L + S (3.27)

LikeL, P CF S, L, P CW S and L, P CE the maximum rate only depends on L. d dL(R L,P CEC) = K − 1 ln(2) 3n + L + S − (L + 1)ln(L + 1) (L + 1)(3n + L + S)2 (3.28)

Setting the expression to zero we obtain the expression for L0 which give the

maximum rate.

(38)

3.5 L parallel code with error correcting property 23

Because of the similarity withL, P CE, L and K must have the same properties as forL, P CE. The mapping of information bits onto the delayed repeated code-words works in the same way asL, P CE with the difference that we use definition 1 instead of definition 6 for the delayed elements. Consider the following example on how the mapping works forL, P CEC.

A user is assigned three codewords (K = 3), (c1, c2, c3), that is a partition of an

OOC satisfying (2.5) and (2.6). Because we have an OOC we chooseS = 0. Fur-thermore we chooseL = 15 so that each codeword can produce L + 1 = 16 different combinations. The synchronization element is always sent without delay (c0,151 (0)). These combinations can be used to maplog2(L + 1) = 4 binary information bits

for each of the remaining two codewords. So the total remaining codewords can be used to map (K − 1)log2(L + 1) = 8 bits. The message (0,0,1,0,1,1,1,1) will be

encoded as c0,151 (0) + c0,152 (2) + c0,153 (15), and the message (1,1,0,1,1,0,1,1) will be encoded as c0,151 (0) + c0,152 (13) + c0,153 (11).

3.5.2

Decoding L, P CEC

The decoder searches for the synchronization element and before it approves that detection as a synchronization element it must be confirmed that there exists a copy of that element n + S chips forward. If it has been approved all of the remaining codewords should be detected withinL light pulses after the approved synchronization element. As a further assurance it also confirms all the detected codewords with their respective copyn + S chips forward. If all these properties are not fulfilled we know that the codewords are detected due to interference and should be discarded and not be used to restore any data.

The code construction can correct the following errors.

• If a potential synchronization element is not followed by a copy n + S chips forward, it is discarded.

• If all remaining codewords are not found within L light pulses after the syn-chronization element, the ones found where detected due to interference. • If any detected codewords does not have a copy n + S chips forward, one can

make the decision that they are detected due to interference.

• If a codeword has been found more than once within L pulses after the detection of the synchronization element, one can make the decision that the one with a copyn + S forward is the correct one.

If a codeword has been found twice withinL pulses and they both have a copy we can still detect this error but not correct it because we cannot confirm which is the correct one. The incorrect data can then be retransmitted. However if this interference is due to the users own codewords the same error will occur again because the same superposition of delayed repeated codewords will be sent.

(39)

3.6

Summary of the L parallel code schemes

L, P CW S is the construction that gives the highest rate but the senders and re-ceivers must be synchronized for this to work. L, P CV S gives a slightly lower rate but here a synchronization element is sent so there are no need for the system to be synchronized. Still, because the element chosen to be the synchronized one varies for every block, the decoding process might be rather complex. If we choose a fixed synchronization element, as forL, P CF S, the decoding process might become more simplified but the rate is decreased. L, P CE also uses a fixed synchronization el-ement and can also detect errors (and correct to some extension) to the expense of lower rate. L, P CEC can detect errors in the same way as L, P CE and to be able to correct errors in the decoding process, a copy of each codeword is sent. Every detected codeword can then be confirmed as an information carrier and not interference.

In the tables below some properties for the L parallel code constructions are summarized. L K L, P CW S 2i− 2 : ∀i ∈ N, i ≥ 2 ≥ 1 L, P CV S 2i− 1 : ∀i ∈ Z+ 2i:∀i ∈ Z+ L, P CF S 2i− 2 : ∀i ∈ N, i ≥ 2 ≥ 2 L, P CE 2i− 1 : ∀i ∈ Z+ ≥ 2 L, P CEC 2i− 1 : ∀i ∈ Z+ ≥ 2

Table 3.1. Properties for L and K for the L parallel code constructions.

|C| Rate L, P CW S (L + 2)K Klog2(L+2) 2n+L L, P CV S K(L + 1)K−1 log2(K)+(K−1)log2(L+1) 2n+L L, P CF S (L + 2)K−1 (K−1)log2(L+2) 2n+L L, P CE (L + 1)K−1 (K−1)log2(L+1) 2n+L L, P CEC (L + 1)K−1 (K−1)log2(L+1) 3n+L+S

(40)

3.6 Summary of the L parallel code schemes 25

L0 that gives maximum rate

L, P CW S (L0+ 2)ln(L0+ 2)− L0= 2n

L, P CV S (K − 1)(2n + L0− (L0+ 1)(ln(L0+ 1)) =ln(K)(L0+ 1)

L, P CF S (L0+ 2)ln(L0+ 2)− L0= 2n

L, P CE (L0+ 1)ln(L0+ 1)− L0= 2n

L, P CEC (L0+ 1)ln(L0+ 1)− L0= 3n + S

Table 3.3. Expression for what L0 that gives the maximum rate.

The tables above are arranged in descending rate with L, P CW S as the code with highest rate. To easier be able to see how the rate differs between the different L parallel codes, the figures on the next page shows the rate as a function of L. In this example an OOC with codeword lengthn = 337 respectively n = 1873 has been used and every user is assignedtwo codewords i.e. K = 2. Because we have an OOC,S is set to S = 0 in the case for L, P CEC. They are also compared with the ordinary parallel code with a rateK/n (2.2).

(41)

0 2 4 6 8 10 12 14 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 Rate L,PCWS L,PCVS L,PCFS L,PCE L,PCEC K/n log2(L) (a) n=337 0 2 4 6 8 10 12 14 16 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5x 10 −3 Rate L,PCWS L,PCVS L,PCFS L,PCE L,PCEC K/n log2(L) (b) n=1873

Figure 3.2. Rate as a function of L and a comparison with the ordinary parallel code

with rate K/n. Codeword length is (a) n = 337 and (b) n= 1873, number of codewords assigned to each user is K = 2. S = 0 for L, P CEC

(42)

3.6 Summary of the L parallel code schemes 27

As one can see the rate for theL parallel code constructions is greater than K/n ifL is chosen properly. Note also the similarity between L, P CF S and L, P CE which have almost the same rate.

In the figure below rate is plotted as a function of the codeword lengthn and L is chosen for maximum rate for every value of n.

0 500 1000 1500 2000 2500 3000 3500 4000 10−4 10−3 10−2 10−1 codeword length n Rate L,PCWS L,PCVS L,PCFS L,PCE L,PCEC:S=0 L,PCEC:S=n ordinaryPC

Figure 3.3. Rate as a function of codeword length n. L is chosen for maximum rate for

every value of n. Codewords assigned to each user is K = 2

To summarize this chapter one can say that to gain a more flexible and stable system the rate becomes lower. Another maybe even more important property is how the bit error rate, BER, for the system is affected by the choice of code construction. To be able to analyze this (which is the main part of this thesis) a simulation environment has been implemented in Matlab.

(43)
(44)

Chapter 4

Matlab implementation of

the L parallel code schemes

Often when investigating a systems performance it is interesting to know how BER depends on the number of simultaneously active users. This is of course an interesting property for theL parallel codes as well, so the program is created to simulate that. As discussed in the previous chapter the rate depends on the choice ofL. Therefore the program is also able to simulate how BER depends on L.

To be able to simulate this some suitable codes must be generated.

4.1

Code generators

In this report we want to compare acyclic codes with cyclic codes. To generate OOC’s example−OOC.m has been used and AOOC’s are generated with

cre-ateAOOC.m.

example−OOC.m takes weight w as input. The user then chooses codeword

lengthn from a presented list and the function returns an optimal OOC as a matrix with codewords as rows. The construction comes from [5]. How-ever for some lengths the construction cannot return an optimal OOC and if such length has been chosen it is stored in n−faliure.mat and will not be

presented the next time the list of possible codeword lengths are shown. modulo.m returns the rest after division. Matlab’s own function mod.m cannot

deal with to great numbers so this function uses mod.m in several steps. distance.m takes a code matrix C as input and calculates all the distances

be-tween the position of ones in the code. It does not calculate distances for cyclic shifts.

codetest.m takes a code matrix as input and returns true if no acyclic distances are repeated. This function is used for the testing of created codes.

(45)

createAOOC.m returns an AOOC with codewords as rows, that only take acyclic shifts into consideration. Input parameters are cardinality, weight and corre-lation constraints.

To explain how the simulation environment works we start by explaining how the encoding process has been implemented.

4.2

Implemented encoders

The encoders for the different L parallel codes are implemented in five Matlab functions. They are all block encoders, which means that the output is a vector of length 2n + L or 3n + L + S depending on the chosen code construction. The input parameters are:

- C , which is the code matrix with codewords as rows. - L is the chosen value of delay parameter L.

- K ,the number of codewords that will be used when encoding data

- data is the information that will be encoded. The length is one block length that depends onL and K and the choice of code construction.

- S is the separation parameter when encoding with L, P CEC.

Below is a description of how the encoders have been implemented. The functions delayed−Codeword.mand delayed−Codeword−Separation.mhas

been used to create the delayed codewords respectively delayed repeated codewords. The superposition of all delayed codewords is created with a simple ”or” operator. The returned result is the superposition of delayed codewords inC having length 2n + L and 3n + L + S respectively.

L−PCWS.m: With definition L, P CW S it encodes the binary vector data of

lengthKlog2(L + 2). If it is not of right length an error message is shown.

data is divided into K parts of length log2(L + 2), where each part will be

encoded with one codeword inC. These binary sequences are converted to decimal form and depending on the result the codeword has different delay between 0 andL, or not being sent at all if the result is zero.

L−PCVS.m: Encodes the vectordata of length log2(K) + (K − 1)log2(L + 1) with

L, P CV S. The first log2(K) elements in the vector data are converted to

decimal, and depending on the result different codewords inC will become the synchronization element, which is sent without delay. The remaining (K − 1)log2(L + 1) bits are divided into K − 1 parts of length log2(L + 1),

and each part is encoded with one of the remaining codewords inC. These parts are converted to decimal and the delayed codewords are created (delay between 1 andL). If the decimal result is zero the respectively codeword is not sent.

(46)

4.3 Implemented decoders 31

LPCFS.m: Encodesdata of length (K − 1)log2(L + 2) with L, P CF S. The first

codeword inC is always sent without delay so the (L, 0) delayed codeword for the first row in C is created. data is divided into K − 1 parts of length log2(L + 2), where each part will be encoded with one of the remaining

codewords in C. These parts are converted to decimal and if the result is not zero the delayed codeword is created based on the decimal result and added to the superposition.

LPCE.m: Encodes a vector of length (K − 1)log2(L + 1) with L, P CE. The

first row inC is the synchronization element so the (L, 0) delayed codeword for the first element is created. The remaining K − 1 codewords are then used to each encode parts of log2(L + 1) bits from the data vector. They

are converted to decimal and the resultmdec is used to create the (L, mdec)

delayed codeword. The superposition of all the delayed codewords in C is then returned.

LPCEC.m: Encodes a vector of length (K − 1)log2(L + 1) with L, P CEC. The

(L, 0) delayed repeated codeword with separation S for the first element is created representing the synchronization element. The remainingK −1 code-words are then used to each encodelog2(L + 1) information bits. These parts

are converted to decimal and the resultmdec is used to create the (L, mdec)

delayed repeated codeword with separation S. The superposition of all the delayed repeated codewords of length 3n + L + S is then returned.

If we want to encode a very long sequence, it must be divided into blocks of the corresponding block length for each construction. Every encoded block is then added together as for the case in figure 3.1 where two blocks is shown.

To be able to compare the L parallel code constructions with the ordinary parallel code from chapter 2, an encoder for this construction has also been imple-mented.

ordinary−PC.m: This is not a block encoder, so the length of the input vector

data, that will be encoded, is arbitrary. This vector is searched in steps of K and depending on the combination of theK data bits different superpositions of lengthn from the K codewords is added to the already encoded vector. When all information bits have been searched the encoded vector is returned.

4.3

Implemented decoders

The decoders for the five L parallel code constructions have been implemented in each Matlab function. In the case L, P CW S the senders and receivers are synchronized so the receiver knows where each block starts. decode−L−PCWS.m

is therefore a block decoder that decodes a block of length 2n+L. All other decoders are not block decoders, so they can take a vector of arbitrary length and decode it.

The input parameters for the implemented decoders are: - C , which is the code matrix with codewords as rows.

(47)

- L is the chosen value of L. It has the same value as for the encoding process. - K ,the number of codewords that the user is assigned. It has the same value

as for the encoding process.

- Encoded is the sequence that will be decoded.

- Statistics is a string that says how much information from the decoding pro-cess that will be shown on the screen. For decode−L−PCWS.mthis is not

an input.

- S is the separation parameter for L, P CEC.

The decoders are searching for codewords in the encoded sequences by correla-tion, which has been implemented in Matlab as:

sum(and(encoded(i:i+n-1),C(j,:)))==weight

The decoder makes the decision that a codeword has been found if the correla-tion between the incoming sequence and the codeword equals the weight of the codeword.

decode−L−PCWS.m: Decodes a block of length 2n+L. This is possible because

the senders and receivers are synchronized so the receiver always knows when every block starts. The decoder loops the encoded sequence and when the correlation equals the weight of the codewords it decides that a codeword has been sent. A codeword found on position i means that the correlation between the codeword and encoded(i:i+n-1) equals the weight. When a codeword is found on positioni=n+1 it has delay lj = 0. Because this is a block decoder it

can decide if the codeword is found in a suitable position, and some detections will therefore be rejected. No codewords should be found on position1:n. This is due to the definition of delayed codewords (3.1). When the entire block has been searched the information can be recovered because we know what codewords have been found and their respectively delay.

The four other decoders works in a different way because the constructions their selves are synchronized with one element from the code. Here the encoded vector can be of arbitrary length and the decoder is looping the entire encoded vector and continuously searching for the synchronization element. But before approval of a found synchronization element we look at the position of the last found synchronization element, which should have been found 2n + L positions before. If the position for the last found is not 2n+L before (or if a synchronization element not yet has been found), it searches 2n + L forward to confirm that the it has been found in an appropriate position. This result in a limitation, because we must sent at least two blocks for any synchronization element to be approved. However this limitation is not a problem in the simulations where a large amount

References

Related documents

Förare Förare Förare Förare Kartläsare Kartläsare Kartläsare Kartläsare. Klubb

[r]

[r]

Förare Förare Förare Förare Kartläsare Kartläsare Kartläsare Kartläsare. Klubb

Plac..

Plac..

Stnr..

Förare Förare Förare Förare Kartläsare Kartläsare Kartläsare Kartläsare. Klubb