1 Walsh Codes, PN Sequences and their role in CDMA Technology Term Paper - EEL 201 Kunal Singhal, 2012CS10231 Student, CSE Department, IIT Delhi 1 1 Abstract—Walsh codes are error correcting orthogonal codes H1 = 1 H2 = and PN sequences are deterministically generated sequences 1 −1 which appear to be random noises. Both of these concepts HN HN are used in error free communication. This paper outlines H2N = HN −HN properties of Walsh codes and PN sequences and discuss the For correctness, we see that, practical implementation in software and hardware. The paper T T T HN HN HN HN explores and model Walsh Codes and Hadamard matrices as a H2N H2N = T T finite orthogonal vector space. It further describe their role in HN −HN HN −HN T T T T communication technologies in particular CDMA. HN HN + HN HN HN HN − HN HN = T T T T Index Terms—Walsh code, Pseudo-Noise sequences, PN se- HN HN − HN HN HN HN + HN HN quence, generator matrix, recursion, hamming weight, hamming 2IN 0 distance, locally decodable, Hadamard matrices, linear codes, = = 2I2N 0 2IN pseudorandom sequences, shift registers, spreading spectrum technique, CDMA, Cryptographic Secure PN codes Walsh codes can be generated from Hadamard matrices of orders which are a power of 2. The rows of the matrix of order 2N constitutes the Walsh codes which encodes N I. INTRODUCTION bit sequences. Now, instead of 1 and -1 consider 1 and 0. ALSH codes are mutually orthogonal error correcting That is consider the matrix and the codes over the field F2 or W codes. They have many interesting mathematical prop- modulo 2. erties and vital applications in communication systems. In this Since Walsh codes is a linear code, there exist a generator or paper, apart from the standard linear code model, we shall a transformation matrix for the same. Consider the following explore Walsh Codes from view point of a orthogonal vector n × 2n generator matrix for encoding bit strings of length n : space over F2. Pseudo random sequences play an important 0 """ 1 role in encoding of messages for efficient transmission of Gn = @g0 g1 ··· g2n−1A messages. Further, many encryption schemes uses pseudo ### random sequences. They are easily implemented in hardware n as well as software, we give both the implementations in this where gi 2 f0; 1g is the binary representation of i: Walsh paper. Then we shall in detail discuss the working of CDMA Code WC(x) = x · Gn For instance, Generator matrix for technology specific to Walsh Codes and PN Sequences. n = 2 is given by 0 0 1 1 G2 = II. WALSH CODE 0 1 0 1 2 A. Definition Notice that. Gn is in fact a basis for H2n . The Walsh code is a linear code1 which maps binary strings n of length n to binary codewords codewords of length 2 : Theorem II.1. Any basis of the corresponding matrix can be Further these codes are mutually orthogonal. taken as generator matrix. Proof: The code space i.e., H2n of Walsh code is an B. Encoding Walsh Code and Hadamard Matrices 3 n n-dimensional vector space of order 2 over the field F2. A Hadamard matrix H of order n is an n × n matrix of Consider B to be a basis of H2n then by the theory of vector T n 1s and -1s in which HH = nIn.(In is the n × n identity spaces we have, 8y 2 H2n 9x 2 f0; 1g such that matrix.) For Walsh codes, we use an Hadamard matrix of the y = hxi; zi z2B order 2N . Hadamard matrices are conjectured to exist for all Now, putting WC(x) = y we get a Walsh encoding using B orders which are multiple of 4. For, powers of 2, there is a as the generator matrix. This proves the theorem. constructive proof. J.J. Sylvester gave the following recursive construction in 1867: 2basis of a vector space is the set of elements that span the whole vector space by their linear combination 1a code for which any linear combination of codewords is a new codeword 3Dimension of a space is defined as the size of it’s basis 2 C. Hamming Weight and Distance The above algorithm requires two bit uncorrupted for correct- ness namely, j and k. Thus, this Walsh code is (2; δ; 1 − 2δ)- The Walsh code for each string of length n has a hamming 2 distance of 2n−1: Further, the Distance or the Edit Distance locally deodable with this algorithm. between any two Walsh codes is also 2n−1. III. PN SEQUENCES Theorem II.2. Let W (x) denote the Hamming Weight of a A. Definition binary string/vector x: If x is a non-zero message in f0; 1gn; A Pseudo random Noise Sequence is a binary sequence then W (x · G ) = 2n−1: n which though deterministically generated by a circuit or an Proof: Let the ith biy of x be non-zero. Pair up two algorithm appears to be statistically random like in the case column vectors in the generator matrix Gn if they differ only of a fair coin flipping. at ith bit. Notice that this pairing, partitions the matrix into 1) Traditional definiton: In 1967, Golomb gave the follow- 2n−1 pairs. Now, if g and h are paired up then, exactly one ing three properties: th 1 of x· and x · h is 1. This is because they differ only in i bit P1 Relative frequencies of 0s and 1s are each 2 : n−1 4 and xi = 1 thus, g · x ⊕ h · x = 1: Since there are 2 pairs, P2 Run lengths are as expected in a coin flipping, i.e., n−1 n W (x · Gn) = 2 : 1=2 of all the runs would be of length n. P3 If the sequence is shifted by any non zero numbers Theorem II.3. Let ∆(a; b) denote hamming distance of a and of bits, then the relative hamming distance5 between b. Then, ∆(x · G ; y · G ) = 2n−1 n n the two sequences would be half. Proof: Being a linear code, the difference of two code- (P1 is known as Balanace and P2 is known as Run.) words is also a codeword, implying the Distance of two Walsh Any sequence which follow the above three properties within codes is also 2n−1: extremely small discrepancies can be called PN sequence. 2) Formal Definition: PN sequences are defined with the help of a polynomial of degree n: D. Orthogonality n X i As stated in the definition, Walsh codes are mutually orthog- P (x) = aix onal. And this in fact plays an important role in functioning i=0 of communication systems such as CDMA. with ai 2 F2 and an = a0 = 1: The PN Sequence Theorem II.4. Walsh codes are orthogonal corresponding to this will satisfy the following recursion: n−1 Proof: If a and b are two Walsh Codes over the alphabet X pn+k = aipk+i f g m ∆(a; b) = m=2: -1,1 of length then by Theorem II.3, i=0 This implies, a · b = m=2 − m=2 = 0: Thus a and b are over the field . Note that the p(x) = 0 is the characteristic orthogonal. F2 equation of the mentioned recursion. E. Decoding Walsh Sequence B. Correlation m Similarity between two sequences is denoted by correlation. Theorem II.5. Any codeword of length m with up to 4 − 1 corrupted can be decoded. Qualitatively, when two sequences compare different, they are said to have cross correlation and when same then autocorre- Proof: c m Let the given word be Less than 4 corruption lation. Quantitatively, correlation of two sequence x and y as ) 9a 2 H ; ∆(a; c) < m m 4 a function of time delay i is: ) 8b 2 Hn 6= a m m m L−1 ∆(b; c) ≥ ∆(a; b) − ∆(a; c) > 2 − 4 = 4 Thus, a is the X m r(i) = xk · yk+i only candidate for less than 4 corruption and thus c can be decoded to inverse of a. k=0 1) Algorithm: The following is a python implementation of As stated in [2], the correlation function r(i) of any PN the standard algorithm [3]: sequence of length N is given by ( 1 i = 0 r(i) = import random − 1 1 ≤ jij ≤ N − 1 y = raw_input() # the given codeword N n = int(raw_input()) #length of message C. Generation and Different PN sequences x = "" for i in xrange(n): Most of the PN sequences are easily implemented in hard- j = random.randint(0,pow(2,n)-1) ware as well as software. In fact, they are usually categorised k = j ˆ pow(2,i) on the basis of generation method. x += str(int(y[j])ˆint(y[k])) 4A run is a contiguos sequence of same bit i.e., 0 or 1 like 0000 or 111 print x 5relative hamming distance refers to the ratio of hamming disance of the two vectors over the length of vectors 3 1) Using shift registers with feedback: Maximal Length D. PN Sequences in Cryptography Sequences or m-sequence is the class of PN sequences which From Shannon’s theory of Cryptography we know that can be generated by this method. A shift register for length perfect security cannot be achieved unless we use large random n n can generate a maximal length sequence of 2 − 1 bits. keys. But, we use PN sequences, we can generate a pseudo Consider the following circuit characteristic polynomial: random sequences of lengths of the order 2n from a key of b P (x) = 1 + x + x4 bits.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages4 Page
-
File Size-