Padilla Cynthia

download Padilla Cynthia

of 45

Transcript of Padilla Cynthia

  • 7/27/2019 Padilla Cynthia

    1/45

    DECODING OF THE (31,15,8) AND (41,20,10) QUADRATIC RESIDUE CODES

    BEYOND THEIR

    ERROR CORRECTING CAPABILITIES

    A Thesis

    Presented to the

    Faculty of

    San Diego State University

    In Partial Fulfillment

    of the Requirements for the Degree

    Master of Arts

    in

    Mathematics

    by

    Cynthia Padilla

    Spring 2011

  • 7/27/2019 Padilla Cynthia

    2/45

  • 7/27/2019 Padilla Cynthia

    3/45

    iii

    Copyright c 2011by

    Cynthia Padilla

  • 7/27/2019 Padilla Cynthia

    4/45

    iv

    DEDICATION

    Dedicated to my brother Cayetano for always telling me to have more confidence and

    encouraging me to take Calculus. If he hadnt done so I wouldnt have majored in

    Mathematics.

  • 7/27/2019 Padilla Cynthia

    5/45

    v

    Dont let the fear of the time it will take to accomplish something stand in the way ofyour doing it. The time will pass anyway; we might just as well put that passing time to the

    best possible use.

    Earl Nightingale

  • 7/27/2019 Padilla Cynthia

    6/45

    vi

    ABSTRACT OF THE THESIS

    Decoding of the (31,15,8) and (41,20,10) Quadratic Residue Codes Beyond Their

    Error Correcting Capabilities

    by

    Cynthia Padilla

    Master of Arts in Mathematics

    San Diego State University, 2011

    Binary quadratic residue codes are nominally one-half-rate codes that are interesting

    because of their cyclic structure and the fact that their error-correction capabilities usually

    beat those of other codes of comparable rates. Decoding them efficiently has been a major

    challenge due to the lack of the so-called strings of known consecutive syndromes. Once

    these are determined, the decoding of a QR code can be performed efficiently by either thePeterson-Gorenstein-Zierler or the Berlekamp-Massey algorithm.

    The method of determining unknown syndromes was first presented by He et al. in the

    early 2000s for decoding the (47, 24, 11) quadratic residue code. In this method, an unknownsyndrome, say, si, is calculated as si = fi(t1, . . . , tk) where fi is a polynomial and t1, . . . , tkare known syndromes. Determining fi for QR codes of different lengths (in general) is aresearch problem.

    In this thesis we focus on the (31, 15, 8) and (41, 20, 10) QR codes. Althoughdecoding algorithms for them are well known in the literature, the ones proposed here will

    correct errors beyond the error-correction capabilities of those codes. Ultimately, the goal of

    having such algorithms is to improve the performance of the codes when they are used in very

    noisy channels.

  • 7/27/2019 Padilla Cynthia

    7/45

    vii

    TABLE OF CONTENTS

    PAGE

    ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi

    ACKNOWLEDGEMENTS .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

    CHAPTER

    1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1.1 Contribution of this Work.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1.2 Thesis Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    2 CODING THEORY BACKGROUND . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    2.1 Binary Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Block Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    2.3 Correcting and Detecting Error Patterns .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . 4

    2.4 Information Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    2.5 Some Basic Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    2.6 Maximum Likelihood Decoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    2.7 Weight and Distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    2.8 Error-Correcting Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    2.9 Linear Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    2.10 Important Matrices Associated to a Linear Code .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 6

    2.11 Cyclic Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    2.12 Quadratic Residue Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    2.13 Decoding Cyclic Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    3 DETERMINATION OF UNKNOWN SYNDROMES.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . 12

    3.1 Determination of Syndrome s6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . 13

    3.2 Efficient Method of Determining Sets I and J . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 154 DECODING THE (31,15,8) QUADRATIC RESIDUE CODE BE-

    YOND ITS ERROR-CORRECTING CAPABILITY .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 19

    4.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    4.2 Calculation of(x) for the (31,15,8) QR Code.. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    4.3 Example Using Decoding Algorithm for Decoding (31,15,8) QR Code .. . . . 23

  • 7/27/2019 Padilla Cynthia

    8/45

    viii

    5 DECODING THE (41, 20, 10) QUADRATIC RESIDUE CODE BE-YOND ITS ERROR-CORRECTING CAPABILITY .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 26

    5.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    5.2 Calculation of the Error-Location Polynomial.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . 27

    5.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    6 CONCLUSIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    6.1 Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    6.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

    BIBLIOGRAPHY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

  • 7/27/2019 Padilla Cynthia

    9/45

    ix

    ACKNOWLEDGEMENTS

    I would like to thank my advisor, Professor Carmelo Interlando for all of his guidance

    and support. I appreciate all the time he took to meet with me and answer e-mails to any

    questions I had. Even though I took Coding Theory and Algebra classes in the past there were

    some concepts I struggled to understand while I was in the class. I appreciate him being

    patient with me and helping me understand these concepts. I really enjoyed working on this

    thesis and it was really interesting to see how ideas from Abstract Algebra are used in Coding

    Theory. I would also like to thank Professor Mike OSullivan and Professor Carl Eckberg for

    being on my thesis committee.

  • 7/27/2019 Padilla Cynthia

    10/45

    1

    CHAPTER 1

    INTRODUCTION

    In digital communication systems, information is represented by binary digits or bits.

    As these travel accross a communication channel such as telephone lines, mobile telephony,

    satellite links, and fiber optics, they get corrupted, that is, zeroes are converted into ones and

    vice-versa. These errors are random and after a certain point, they are outside of our

    control. However, we can model their statistical behavior and then use it to combat them.

    The theory of error-correcting codes was founded by the American scientist Claude

    Shannon in his 1948 seminal paper [10]. In that paper, Shannon associated a positive real

    number C to each channel and showed that if information is properly encoded at any fixed

    rate less than C, then it can be delivered to the user almost error-free, meaning that the

    probability of error can be made as small as one wishes, although not zero. Shannons

    theorem was a major breakthrough in communications engineering and marked the birth of

    information and coding theory.

    Shannons theorem is an existence theorem. This means that it does not help us

    determine the codes promised by it explicitly, at least in an efficient way. Moreover, even if

    those codes were given to us by an oracle, a practical problem would be how to encode and

    decode them efficiently. If one wishes to be a little more precise, an efficient task is one

    that can be performed in polynomial time.A noteworthy class of codes and the main topic of the present work is the class of

    quadratic residue (QR) codes, discovered by Prange in 1957 [8]. QR codes are nominally

    half-rate codes that are powerful with respect to their error-correction capabilities. Berlekamp

    [1] describes them as good codes which are hard to decode. In fact, they can be found often

    in tables of optimal linear codes [4], and although decoding QR codes is a formidable

    problem in general, great progress has been made in the binary case since the work of Elia [3]

    and He et al. [5].

    1.1 CONTRIBUTION OF THIS WOR KIn this work, we propose decoding algorithms for the QR codes of lengths 31 and 41

    that will correct errors beyond the codes error-correction capabilities. This is significant

    because the algorithms take advantage of the full potential of the code, which ultimately

    means that the codes can offer more reliability at the cost of a slight increase in decoding

  • 7/27/2019 Padilla Cynthia

    11/45

    2

    complexity.

    More specifically, the QR code of length 31 is guaranteed to correct three errors in any

    block of31 bits. However, it is possible that the code will still correct some combinations of

    four errors in a block of31 bits. When this happens, we say that an error pattern of weightfour is correctable. We present an algorithm that not only will detect when a correctable error

    pattern of weight four occurs, but also will determine the error pattern.

    The QR code of length 41 is guaranteed to correct four errors in any block of 41 bits.

    We present an algorithm that not only will detect when a correctable error pattern of weight

    five occurs, but also will determine the error pattern.

    To the best of our knowledge, algorithms for decoding the above-mentioned codes

    beyond their error-correction capabilities are not known in literature.

    1.2 THESIS OVERVIEW

    In Chapter 2 we define quadratic residue codes and explain the algorithm for decoding acyclic code. We describe the challenge of the algorithm when the cyclic code is a QR

    code.

    In Chapter 3 we give the theorems that help overcome the challenge of decoding QRcodes.

    In Chapter 4 we give an algorithm for decoding the quadratic residue code of length 31beyond the error correction capability of the code. In Chapter 5 we give an algorithm for the QR code of length 41 beyond the error

    correction capability of the code.

    Chapter 6 we give the conclusion. We discuss the challenges we overcame as well asfuture work.

  • 7/27/2019 Padilla Cynthia

    12/45

    3

    CHAPTER 2

    CODING THEORY BACKGROUND

    2.1 BINARY CHANNEL

    A binary channel is one in which only two digits 0 and 1 are used to transmit a

    message. A binary channel is symmetric if0 and 1 are transmitted with equal accuracy. This

    means that the probability of receiving the correct digit is independent of which digit, 0 or 1 is

    transmitted. The reliability of a binary symmetric channel (BSC) is a real number p,

    0 p 1, where p is the probability that the digit sent is the digit received. Ifp is theprobability that the digit received is the same as the digit sent, then 1p is the probabilitythat the digit received is not the digit sent. We say that one channel is more reliable than

    another if its reliability is higher. Any channel with 0 p 1/2 can be easily converted intoa channel with 1/2 p 1. For this reason we will assume that a BSC is being used withprobability p satisfying 1/2 p 1.

    2.2 BLOCK CODES

    In digital communications, the information to be sent consists of sequences of zeros

    and ones. We call a 0 or a 1 a digitand call a sequence of digits a word. The length of a word

    is the number of digits in the word. For example, 0110101 is a word of length seven. A word

    is transmitted by sending its digits one after the other, across a binary channel. The codeconsisting of all words of length two is

    C = {00, 10, 01, 11}

    A block code is a code which has all its words of the same length; this number is called the

    length of the code. The words that belong to a given code C, will be called codewords

    whereas the number of codewords in a code C is denoted by |C|.

    We assume that noise is scattered randomly as opposed to occurring in clumps, calledbursts. As a result, the probability of any digit being affected in transmission is the same as

    that of any other digit and is not influenced by errors made in digits nearby. If the channel

    were perfect, meaning it were noiseless, then there would be no need for coding theory. There

    are no perfect channels; however, some channels are less noisy than others and some are more

    reliable than others.

  • 7/27/2019 Padilla Cynthia

    13/45

    4

    2.3 CORRECTING AND DETECTING ERROR

    PATTERNS

    Suppose a word that is not a codeword is received. Clearly some error has occurred

    during the decoding process, so we have detected that an error or perhaps several errors have

    occured. If however a codeword is received, then we cannot detect any error [6]. A codewordthat can be formed from a word w with the least number of digits being changed is called the

    closestcodeword. We define the parity-checkdigit as an added digit to each element of a code

    C.

    2.4 INFORMATION RATE

    The addition of digits to codewords may improve the error correction and detection

    capabilities of the code. However, the longer the codewords, the longer it takes to transmit

    each message. The information rate of a code is a number that is designed to measure the

    proportion of each codeword that carry the message. The information rate of a code C oflength n is defined to be

    1

    nlog2|C|

    Since 1 |C| 2n, it follows that the information rate ranges between 0 and 1. Ifevery word is a codeword it is 1 and it is 0 if|C| = 1.

    2.5 SOM E BASIC ALGEBRA

    If the code has many codewords then it is impractical to compare each received word

    w to each codeword in order to find which codeword disagrees with w in as few positions as

    possible. Imagine trying to do this with a code that has 250 codewords. Trying to compare

    each word received to each codeword is not efficient because by doing so, one would not be

    able to keep up with incoming transmission. Introducing some structure into the code helps

    overcome this problem.

    Let K = {0, 1} and let Kn be the set of all binary words of length n. Addition andmultiplication of elements ofK are defined as follows:

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

    0 0 = 0, 1 0 = 0, 0 1 = 0, 1 1 = 1

    Addition for elements in Kn is defined componentwise. For example ifv = 01101 and

    w = 11001 then v+w = 10100. Addition of two binary words results in a binary word which

  • 7/27/2019 Padilla Cynthia

    14/45

  • 7/27/2019 Padilla Cynthia

    15/45

    6

    For a code C containing at least two words the distance of the code C is the smallest

    of the numbers d(v, w) as v and w range over all the pairs of different codewords in C. Note

    that since d(v, w) = wt(v + w), the distance of the code is the smallest value of wt(v + w) as

    v and w, v = w range over all possible codewords.

    2.8 ERROR-C ORRECTING CODES

    If a word v in a code C is transmitted over a Binary Symmetric Channel and if w is

    received resulting in the error pattern u = v + w, then IMLD correctly concludes that v was

    sent ifw is closer to v than to any other word in C. A code is said to be a t- error-correcting

    code if it corrects all error patterns of weight at most t and does not correct at least one error

    pattern of weight t + 1.

    Theorem 2.1. A code of distance d will correct all error patterns of weight less than or equal

    to

    d12

    . Moreover, there is at least one error-pattern of weight1 +

    d12

    which C will not

    correct.

    2.9 LINEAR CODES

    A non-empty subset C ofKn is called a linear code ifv+w is in C whenever v and w

    are in C. In other words, a linear code C is a subspace ofKn. The dimension ofC as a

    subspace ofKn is denoted by k. Therefore, |C| = 2k.Definition 2.1. LetC be an (n, k) linear code, that is, a code of length n and dimension k.

    The orthogonal complement ofC, denoted by C, is called the dual code ofC.

    From linear algebra, C has length n and dimension n k.

    2.10 IMPORTANT MATRICES ASSOCIATED TO A

    LINEAR COD E

    Definition 2.2. LetC be an (n, k) linear code. A generator matrix G forC is any k nmatrix whose rows consist of k linearly independent codewords.

    Encoding of a linear code is performed as follows: An information sequence

    u = (u0, . . . , uk1) is encoded as v = u

    G. Therefore, the encoder does not have to keep the

    entire codebook of2k codewords; it only needs k codewords.

    Definition 2.3. LetC be an (n, k) linear code. A parity-check matrix H forC is any

    n (n k) matrix whose columns form a basis forC.From the definition, it follows that v C if and only ifv H = 0, where 0 denotes a

    vector consisting ofn k zeroes.

  • 7/27/2019 Padilla Cynthia

    16/45

    7

    2.11 CYCLIC CODES

    Denote by the mapping Kn Kn given by((a0, a1, . . . , an2, an1)) = (an1, a0, a1, . . . , an2).

    Definition 2.4. LetC be an (n, k) linear code. C is said to be cyclic if(v)

    C for all

    v C.

    When working with cyclic codes, it is frequently convenient to associate n-tuples in

    Kn to polynomials in GF(2)[x] as follows:

    v = (a0, a1, . . . , an2, an1) v(x) = a0 + a1x + + an1xn1.

    Ifv(x) corresponds to v, then x v(x) mod (xn + 1) corresponds to (v).

    Theorem 2.2. An (n, k) cyclic code C has a unique nonzero polynomial g(x) of degree n k,called the generator polynomial ofC. Moreover,

    a) C = {a(x) g(x) | a(x) GF(2)[x] and deg a(x) < k};b) g(x) divides xn + 1.

    Encoding of an (n, k) cyclic code C with generator polynomial g(x) of degree n kis as follows: An information polynomial u(x) = u0 + + uk1xk1 is encoded asv(x) = u(x) g(x).

    In view of Theorem 2.2, Part b), if we assume that n is odd, then g(x) never has

    repeated roots in any extension ofF2. In this case, we have the following result:

    Theorem 2.3. Letn be odd, v(x) GF(2)[x] a polynomial of degree less than n, andg(x)the generator polynomial of a cyclic code C of length n. Moreover, let

    Z= { roots of g(x) in some extension ofGF(2)}.

    Then v(x) C if and only ifv() = 0 for every Z.

    2.12 QUADRATIC RESIDUE CODES

    Let p be a prime number. We say that an integer a is a quadratic residue modulo p if

    p a and x2

    a (mod p) has a solution. It is well known from Number Theory that a is aquadratic residue (mod p) if and only ifa

    p1

    2 1 (mod p).

    Let Qp denote the set of quadratic residues modulo p andNp the set of non-residues.If is a primitive element of the field GF(p), then e Qp iffe is even and e Np iffe isodd. It follows that Qp is a cyclic group generated by 2.

  • 7/27/2019 Padilla Cynthia

    17/45

    8

    If2 Qp and if is a primitive pth root of unity over the field GF(2m), then the QRcode of length p is a cyclic code with generator polynomial defined as

    g(x) =iQp

    (x i). (2.1)

    or as

    h(x) =iNp

    (x i). (2.2)

    Both polynomials have coefficients in GF(2).

    Let C be a (p, k, d) QR code. A codeword is defined algebraically as a multiple of its

    generator polynomial g(x) over GF(2). The number p denotes the length of the code and is a

    prime number of the form 8b 1 with b some integer. The number k is the dimension of thecode and is equal to

    p+1

    2 . The number d is the minimum Hamming distance of the code.

    The set Qp of quadratic residues is given by

    Qp = {i | i j2 (mod p);j = 1, 2, . . . , p 12

    } (2.3)

    .

    Let R be the ring GF(2)[x]/(xp 1). It follows that xp 1 = (x 1)g(x)h(x),

    where g(x) and h(x) GF(2)[x]. The cyclic codes generated by g(x) and h(x) are calledaugmented codes. Consider the sets Q = {0} Qp and N= {0} Np. They define thegenerating polynomials (x 1) g(x) and (x 1) h(x) respectively. We refer to the QRcodes generated by these generating polynomials as expurgated codes. The permutation of

    coordinates in R induced by x xi for a fixed nonresidue i interchanges Qp andNp so thatthe codes generated by g(x) and h(x) are equivalent and have dimension p+1

    2. Similarly, the

    codes generated by (x 1) g(x) and (x 1) h(x) are also equivalent and have dimensionp12

    . The minimum distance d of the codes generated by g(x) and h(x) is d p. In practice,this bound proves to be very loose, that is, d is much higher than

    p [7].

    2.13 DECODING CYCLIC CODES

    Here we review the Peterson-Gorenstein-Zierler algorithm in the case where the

    generator polynomial has a special form. Let C be a cyclic (n, k) code where n the length of

    the code is equal to 2r 1 (where r 2 Z), and is a primitive element of the fieldGF(2r). Let g(x) = (x + m+1)(x + m+2) (x + m++1) be the generator polynomial ofthe code, where m Z, and N.

  • 7/27/2019 Padilla Cynthia

    18/45

  • 7/27/2019 Padilla Cynthia

    19/45

    10

    4. Find the roots of(x) = 0 + 1x + + 1x1 + x in an extension ofGF(2).They are the error-location numbers zi =

    ji , i = 1, . . . , .

    It is well known that the mapping between the syndromes si of a linear code and the

    error patterns of weight

    t =

    12

    is one-to-one. To decode a cyclic code it suffices to find

    the error locator polynomial (x). The i are the elementary symmetric functions and are

    related to the syndromes via Newtons identities. The Newton Identities are the equations in

    step 3 of the Decoding algorithm for cyclic codes shown above. The Newton Identities can be

    solved efficiently when there is a sufficient number of consecutive known syndromes.

    However, when decoding QR codes, this is typically not the case. Recall that, If p is a prime

    number of the form 8b 1 then the generating polynomial for the quadratic residue of lengthp is given by g(x) =

    iQp

    (x i).A binary vector c = (c0, c1, . . . , cp1) is a codeword if and only if its associated

    polynomial c(x) = c0 + c1x + + cp1xp1

    is a multiple ofg(x). Ifr = (r0, r1, , rp1) isa received vector, then its associated polynomial r(x) = r0 + r1x + . . . + rp1x

    p1 can be

    expressed as a sum of the transmitted code polynomial c(x) and the error polynomial

    e(x) = e0 + e1x + + ep1xp1 [2]. If errors occur in the received vector then the errorpolynomial has nonzero terms. The error polynomial takes the form

    e(x) = xr1 + xr2 + . . . + xr , where 0 r1 r2, . . . r < p 1 for i {0, 1, . . . p 1}.

    For any k Z, the syndrome sk = e(k). Since e(2k) = (e(k))2 in GF(2). Itfollows that s2k = s

    2k, for all k

    Z. Also, for all k, l

    Z, sk = sl whenever k

    l (mod p).

    The set of known syndromes is obtained by evaluating r(x) at the roots ofg(x). Since

    c(x) is a multiple ofg(x) and g(i) = 0 it follows that c(i) = 0. Since

    r(i) = c(i) + e(i), it follows that r(i) = e(i) when i Qp. As a result, for any i Qpwe have that si = r(

    i).

    Since 2 Qp the set Qp is closed under multiplication by 2 [5]. Thus Qp is a disjointunion of cyclotomic cosets, modulo p. The cyclotomic cosets are given by,

    Qr =

    {r

    2j

    |j = 0, 1, . . . , nr

    1

    }where nr is the smallest positive integer such that r 2nr r (mod p) and r is the

    smallest element in Qr

    Ifi Qr, in other words i r 2ni (mod p) for some integer ni, then

    si = sr2ni

  • 7/27/2019 Padilla Cynthia

    20/45

    11

    For Q31, the cyclotomic cosets Qr are given by r {1, 5, 7}. Thus Q31 can be can bepartitioned as follows:

    Q31 =

    {1, 2, 4, 8, 16

    } {5, 9, 18, 10, 20

    } {7, 14, 19, 25, 28

    }.

    As a result we have the following equalities for the syndromes of the code: s2 = s21,

    s4 = s41, s8 = s

    81, s16 = s

    161 , s10 = s

    25, s20 = s

    45, s9 = s

    85, s18 = s

    165 ,s14 = s

    27, s28 = s

    47,

    s25 = s87, s19 = s

    167 . Also s0 = v (mod 2)

    Decoding QR codes is a challenge since only those syndromes whose index i Qpare known. However, one can overcome this challenge by calculating one or more of the

    unknown syndromes. In the next chapter we give some helpful theorems that help determine

    the unknown syndromes.

  • 7/27/2019 Padilla Cynthia

    21/45

    12

    CHAPTER 3

    DETERMINATION OF UNKNOWN

    SYNDROMES

    As mentioned in the previous chapter, to decode a cyclic code it suffices to find the

    error location polynomial. To illustrate this take the QR code of length 31.

    Let Q31 = {1, 2, 4, 5, 7, 8, 9, 10, 14, 16, 18, 19, 20, 25, 28} be the set of quadraticresidues of 31 andN31 the set of quadratic nonresidues of 31. The smallest extension ofF2 = GF(2) containing , a primitive thirty-first root of unity, is F25 = GF(2

    5). Let

    Z= {0} Q31 and define g(x) F2[x] as

    g(x) =

    iZ(x i) = x16 + x13 + x10 + x8 + x4 + x3 + x + 1.

    The cyclic code generated by g(x) is the expurgated quadratic residue code of length

    31 [6]. Its minimum Hamming distance is equal to 8, for this reason error patterns of weight

    up to three are guaranteed to be corrected.

    Suppose c(x) = 0 is transmitted and r(x) = x3 + x4 is received. In this case two errors

    have occured, one may use the decoding algorithm for cyclic codes in order to correct the two

    errors. We will need to determine the error location polynomial of degree 2. The coefficients

    of the error location polynomial can be obtained by solving the linear system in the third step

    of the decoding algorithm with = 2. To solve the linear system we need a string of4

    consecutive syndromes. Recall that sj = r(j) = e(j), where Z. For the quadratic

    residue code of length 31, we may use s7, s8,s9,s10 since all of these are quadratic residues

    modulo 31. When trying to decode error patterns of weight three decoding quadratic residue

    codes is a challenge. In order to use the algorithm for decoding cyclic codes, knowledge of a

    string of six consecutive syndromes is required. One choice is s5,s6,s7,s8,s9,s10, however; s6

    is not known since 6 is a non-residue modulo 31. In order to use the algorithm for decodingthe QR code of length 31, we will first need to determine the unknown syndrome s6.

    Fortunately, one may overcome such difficulty by calculating one or more of the unknown

    syndromes with the aid of the following result [5]. A proof of the theorem was given in [2].

  • 7/27/2019 Padilla Cynthia

    22/45

    13

    3.1 DETERMINATION OF SYNDROME s6

    Theorem 3.1. LetI = {i1, i2, . . . , i+1} andJ = {j1, j2, . . . , j+1} be two subsets of{0, . . . , 30}. Let denote the weight of the error pattern. The two sets define two (+ 1) matrices and one

    diagonal matrix given, respectively, by

    XI =

    zi11 zi12 zi1

    zi21 zi22 zi2

    ......

    ......

    zi+11 z

    i+12 zi+1

    andXJ =

    zj11 zj12 zj1

    zj21 zj22 zj2

    ......

    ......

    zj+11 z

    j+12 zj+1

    Then the

    (+ 1) (+ 1) matrix defined by S(I, J) = XIXTJ is equal to

    S(I, J) =

    si1+j1 si1+j2 si1+j+1si2+j1 si2+j2 si2+j+1

    ......

    ......

    si+1+j1 si+1+j2 si+1+j+1

    The indices are mod p. Furthermore, det(S(I, J)) = 0.

    Proof. Define two matrices as follows:

    XI =

    zi11 zi12 zi1

    zi22 zi22

    zi2

    ... ... ... ...

    zi+11 z

    i+12 zi+1

    and XJ =

    zj11 zj12 zj1

    zj22 zj22

    zj2

    ... ... ... ...

    zj+11 z

    j+12 zj+1

    Since S(I, J) = XIXTJ , the (r, s)th entry ofS(I, J) equals the inner product of the

    rth row vector of XI and the sth column vector ofXJ which is

    (zir1 , zir2 , . . . , z

    ir ) (zjs1 , zjs2 , . . . , +zjs ) = zir+js1 + zir+js2 + zir+js = sir+js ,

    so that the (r, s)th entry ofS(I, J) is sir+js .

    Recall that zli = irl, ifl l mod p, then ri l ri l.

    It follows that zli = irl = irl

    = (ri )l = zl

    i .

    Hence sk = zl1 + z

    l2 + + zl = zl1 + zl2 + + zl = sl, ifl l mod p; that is, the

    summation of the indices of the entries in S(I, J) is modulo p.

  • 7/27/2019 Padilla Cynthia

    23/45

  • 7/27/2019 Padilla Cynthia

    24/45

    15

    Since we assume just3 errors in the matrix S(I, J), we have thatdet(S(I, J)) = 0.

    Since s6 is the only unknown syndrome among the entries then s6 can be expressed as a

    function in terms of the known syndromes. During the decoding process one is able to

    calculate the value s6 with the information of the known syndromes.

    If the conditions of theorem 3.1 have been satisfied then one can obtain an unknown

    syndrome in terms of the known syndromes. The trick in finding an S(I, J) matrix in which

    there is only one unknown syndrome among the entries lies in the choice of subsets

    I, J {0, 1, . . . , p 1}. To correct up to three errors, the subsets must be of size four. By anexhaustive search for the quadratic residue (QR) code of length 31 there are at most31

    4

    2= (31!/((31 4)!(4!)))2 = 990046225 possibilities. With the aid of an algorithm

    presented in [2] this amount can be reduced to16

    4

    2= (16!/((16 4)!(4!)))2 = 3312400. In

    the next section we give the necessary notations along with the algorithm.

    3.2 EFFICIENT METHOD OF DETERMINING SET S

    I AN D J

    Let R denote the set {0, r} Qp. Where r is the index of the unknown syndrome sr tobe found and p is the length of the QR code. For i R define the difference ofi from R to be:

    R i = {(q i) (mod p) | q R}

    A special sum of the two subsets I and J is defined to be the multi-set, that is each

    element should be kept as

    I J = {(i + j) (mod p) | i I, j J}

    . The * is used to indicate the set is a multi-set [2]. The following algorithm is used to find

    the subsets I,J of(+ 1) elements needed to determine the primary unknown syndrome sr as

    follows:

    Algorithm 1:

    Step 1: Choose a subset I = {i1, i2, . . . , i+1}Step 2: Check the number of elements in the intersection

    (R i1) (R i2) (R i+1)Step 3: Choose a subset J with (+ 1) elements from the intersection in Step 2.

    Step 4: Check the number ofr / Qp in the multi-set I J. If the multi-set contains exactlyone r, then stop; I and J are the desired sets. Otherwise, return to step 3.

  • 7/27/2019 Padilla Cynthia

    25/45

  • 7/27/2019 Padilla Cynthia

    26/45

    17

    S(I, J) =

    s0 s2 s4 s6 s8

    s1 s3 s5 s7 s9

    s2 s4 s6 s8 s10

    s8 s10 s12 s14 s16

    s10 s12 s14 s16 s18

    Let f denote the determinant ofS(I, J). This yields a different polynomial in s3. Let

    F denote the greatest common divisor of the polynomials f and f. Since s3 is a root of both

    f and f, it is also a root ofF = gcd(f, f). IfF is a polynomial of degree 1 then one is able

    to recover s3. We illustrate this using an error pattern of weight 4. Let e(x) = x3 + x2 + x + 1.

    In this case det(S(I, J)) = 26x6 + 24x5 + 21x4 + 29x3 + 28x2 + 10x + 16

    yielded a polynomial in s3, while

    det(S(I, J)) = 30x10+20x8+14x7+23x6+21x5+29x4+29x3+26x2+28x+24

    yielded a different polynomial in s3. The greatest common divisor of these two polynomialswas x + 25. Since s3 is a root of this polynomial, it follow that s3 =

    25.

    Consider the quadratic residue code of length 41. The smallest extension of

    F2 = GF(2) containing , a primitive fourty-first root of unity, is F220. Let

    Q41 = {1, 2, 4, 5, 8, 9, 10, 16, 18, 20, 21, 23, 25, 31, 32, 33, 36, 37, 39, 40}. To correct fiveerrors knowledge of a string of ten consecutive syndromes is required. One choice is s0, s1,

    s2, s3, s4, s5, s6, s7,s8,s9. Notice that s3, s6 and s7 are unknown since 3, 6 and 7 are not

    quadratic residues modulo 41. Using Algorithm 1 with R = {0, 3, 6, 7} Q41 one can find thedesired subsets whose corresponding matrix yields a polynomial in s3. After finding these

    subsets we can use them to define 6 6 S(I, J) matrices whose determinant yield apolynomial in s3. The goal is to get the greatest common divisor of degree as low as possible

    so that one can easily calculate s3. One choice was I1 = {1, 2, 4, 5, 8, 39} andJ1 = {0, 1, 2, 35, 38, 39}. Another choice was I2 = {1, 2, 4, 5, 6, 39} andJ2 = {0, 1, 3, 35, 38, 39}. Both pairs of subsets resulted in matrices whose determinantyielded a polynomial in s3; The greatest common divisor for those two polynomials is also a

    polynomial in s3. If the greatest common divisor of the two polynomials is not helpful in

    obtaining the unknown syndrome, one could add another element to R = {0, 3, 6, 7} Q41,say 14 since s14 = s

    32

    3 . Another possibility is to work with the dual code.When working with the dual code the quadratic residues and the non residues switch roles,

    that is, the non residues are now the known syndromes where as the quadtratic residues are

    now unknown. ConsideringN41 in order to correct up to five errors a string of ten consecutivesyndromes is a required. One choice would be s1, s2, . . . ,s10. Since 1, 2, 4 and 8 are quadradic

    residues modulo 41, their corresponding syndrome is unknown. Once we determine s1 we can

    also determine s2,s4, and s8 since s2 = s21, s4 = s

    41 and s8 = s

    42. In order to obtain the desired

  • 7/27/2019 Padilla Cynthia

    27/45

    18

    subsets that will help us in the calculation ofs1 we may follow the same procedure given in

    Algorithm 1. In this case R =N41 {0, 1, 4, 8}. The subsets we found wereI3 = {0, 2, 12, 26, 27, 28}, J3 = {0, 1, 2, 15, 17, 26}, I4 = {2, 3, 17, 19, 29, 30}, andJ4 = {0, 5, 24, 25, 26, 39}. Let f3 denote the determinant ofS(I3, J4), this yields a

    polynomial in s1. Let f4 denote the determinant ofS(I4, J4), this yielded a differentpolynomial in s1. The gcd(f3, f4) yields a polynomial in s1. In the chapters that follow we

    decode quadratic residue QR codes of length 31 and 41.

  • 7/27/2019 Padilla Cynthia

    28/45

    19

    CHAPTER 4

    DECODING THE (31,15,8) QUADRATIC

    RESIDUE CODE BEYOND ITS

    ERROR-CORRECTING CAPABILITY

    An efficient algebraic decoding algorithm for the binary (31, 16, 7) QR code was first

    presented in [9]. In this chapter we will present an algorithm for the (31, 15, 8) that will

    correct all error patterns of weight up to three and most correctable error patterns of weight

    four. There are 31465 error patterns of weight four out of which 11315 are correctable. The

    others change the sent codeword into a word that is equidistant from two codewords. Before

    stating the algorithm we will review the necessary background.

    4.1 PRELIMINARIES

    Let Q31 = {1,2,4,5,7,8,9,10,14,16,18,19,20,25,28} be the set of quadratic residues of31 andN31 the set of quadratic nonresidues of 31. The smallest extension ofF2 = GF(2)containing , a primitive thirty-first root of unity, is F25 = GF(2

    5). Let Z= {0} Q31 anddefine g(x) F2[x] as

    g(x) =

    iZ(x i

    ) = x16

    + x13

    + x10

    + x8

    + x4

    + x3

    + x + 1.

    The cyclic code generated by g(x) is the expurgated quadratic residue code of length

    31 [6]. Its minimum Hamming distance is equal to 8.

    Let c(x) =

    30

    i=0 cixi GF(2)[x] be the sent code polynomial. The received

    polynomial denoted by r(x) =

    30

    i=0 rixi, satisfies r(x) = c(x) + e(x) where

    e(x) =

    30

    i=0 eixi is the error pattern. Let denote the weight of the error pattern. Since the

    minimum distance of the code is 8 it follows that e(x) is guaranteed to be correctly

    determined when 3. The receiver has access to both g(x) and r(x) and seeks to determinethe most probable e(x).

    For any k Z, the syndrome sk is defined as sk = e(k). It follows that s2k = s2k, forall k Z. Also, ifk l (mod 31) then sk = sl for all k Z. For any k Z, g(k) = 0 andsince c(x) is a multiple ofg(x), it follows that the set of known syndromes is obtained by

    evaluating r(x) at the roots ofg(x). Thus, sk = r(k) for k Z. The other sl are the

  • 7/27/2019 Padilla Cynthia

    29/45

  • 7/27/2019 Padilla Cynthia

    30/45

    21

    Theorem 4.1. Letm0, Z with 1. With the above notation, the matrix

    sm0 sm0+1 sm0+1sm0+1 sm0+2 sm0+

    .

    .....

    .

    .....

    sm0+1 sm0+ sm0+22

    is nonsingular if = and singular if > .

    4.2 CALCULATION OF (x) FOR THE (31,15,8)QR COD E

    In this section we describe how to use Theorem 3.1 to decode the binary QR code of

    length 31 generated by g(x). We give an algorithm for finding (x), the error-location

    polynomial, from r(x). The decoder will determine the coefficients of(x), namely the i,

    from 4.1. In order to decode up to three errors knowledge of a sequence of six consecutive

    syndromes is required. One possibility is s5, s6, s7, s8, s9, s10. Recall that any syndrome sk

    where k Zcan be computed by the decoder as r(k). Since 6 / Q31, s6 is the the unknownsyndrome that needs to be determined.

    Recall that, s2 = s21, s4 = s

    41, s8 = s

    81, s16 = s

    161 , s10 = s

    25, s20 = s

    45, s9 = s

    85,

    s18 = s165 ,s14 = s

    27, s28 = s

    47, s25 = s

    87, s19 = s

    167 . Also keep in mind that s0 = v (mod 2)

    Hence, ifs0 = s1 = s5 = s7 = 0, the decoder will declare that = 0. The next resultwas verified for each one of the error patterns of weight up to four using Magma.

    Proposition 4.1. LetI = {0, 1, 2, 10} andJ = {0, 4, 8, 10}.Then

    S(I, J) =

    s0 s1 s2 s10

    s4 s5 s6 s14

    s8 s9 s10 s18

    s18 s19 s20 s28

    =

    s0 s1 s2 s25

    s22 s5 s6 s27

    s42 s85 s

    25 s

    165

    s165 s167 s45 s47

    Letf = det(S(I, J)). If < 3, then f is identically zero. If = 3 or = 4 then f is a

    linear polynomial in s6.

    The next proposition was verified for each one of the 31465 error patterns of weight 4

    using Magma.

  • 7/27/2019 Padilla Cynthia

    31/45

    22

    Proposition 4.2. LetI4 = {2, 4, 6, 8, 19}, J4 = {0, 1, 6, 12, 30}, I5 = {0, 2, 4, 6, 8},J5 = {0, 1, 2, 8, 10}. Then

    S(I4, J4) =

    s2 s3 s8 s14 s1

    s4 s5 s10 s16 s3

    s6 s7 s12 s18 s5

    s8 s9 s14 s20 s7

    s19 s20 s25 s0 s18

    andS(I5, J5) =

    s0 s1 s2 s8 s10

    s2 s3 s4 s10 s12

    s4 s5 s6 s12 s14

    s6 s7 s8 s14 s16

    s8 s9 s10 s16 s18

    All the entries in S(I4, J4) andS(I5, J5) are known except fors3, s6 ands12. However,

    s6 = s23 ands12 = s

    43. If is even, then s0 = 0 otherwise s0 = 1. It follows that

    fk = det(S(Ik, Jk)), k = 4, 5, are polynomials in a single variable, namely, s3.

    Considering correctable error patterns of wt4, gcd((f4, f5)) is a polynomial of degree

    1 for9145 patterns, degree 2 for2015 error patterns, and degree 3 for155 error patterns.

    Considering not correctable error patterns of wt 4, gcd((f4, f5)) is a polynomial of

    degree 1 for0 error patterns, degree 2 for8370 error patterns, degree 3 for7130 error

    patterns, degree 4 for3565 error patterns, and degree 5 for1085 error patterns.

    The above propositions and theorems yield the following procedure for determining

    (x):

    1. Ifsk = 0 for all k {0, 1, 5, 7} then declare that = 0 and exit. Otherwise, go to Step2.

    2. Iff 0 then go to step 3. Otherwise go to Step 4 or 5 according to whether s0 = 0 ors0 = 1. Ifs0 = 1 then solve f = 0 for s6 and go to Step 4. Ifs0 = 0, go to Step 5.

    3. Solve the following linear system for the elementary symmetric functions:

    sk =k1

    j=k2

    sjkj for k = 9, 10.

    If the linear system is nonsingular, declare that = 2 and exit. If the linear system issingular then = 1 and 1 = s1.

  • 7/27/2019 Padilla Cynthia

    32/45

    23

    4. Determine the coefficients of the error-location polynomial (x) by solving thefollowing linear system for the elementary symmetric functions:

    sk =k1

    j=k3

    sjkj for k = 8, 9, 10.

    Providing the linear system is nonsingular declare the = 3 and exit.

    5. If we get to this point, then 4. Ifs0 = 0, assume = 4. Solve for s3 as a root ofgcd(f4, f5) and solve the following linear system for the elementary symmetricfunctions:

    sk =k1

    j=k4

    sjkj for k = 5, 6, 7, 8.

    4.3 EXAMPLE USING DECODING ALGORITHM

    FO R DECODING (31,15,8) QR COD E

    In this section we provide some examples of the application of our algorithm. We start

    with the case when no errors have occurred. Next we show examples when error patterns of

    weight one, two, three and four have occurred.

    Example 4.1. Suppose c(x) = 0 andr(x) = x2 is received.

    The receiver has knowledge ofg(x) andr(x) and will determine e(x).

    Step 1 Compute s0 which will tell us whether the number of errors is even or odd. Since s0 = 1it follows that the number of errors is odd; Go to step 2 of the algorithm.

    Step 2 Compute f = det(S(I, J)) in Proposition 4.1.

    S(I, J) =

    s0 s1 s2 s10s4 s5 s6 s14s8 s9 s10 s18s18 s19 s20 s28

    =

    s0 s1 s2 s25

    s22 s5 s6 s27

    s42 s85 s

    25 s

    165

    s165 s167 s

    45 s

    47

    =

    1 8 16 5

    2 10 18 7

    4 12 20 9

    20 28 5 25

    f = 0 so < 3 errors occured. Since we already established that the number oferrors is odd we may conclude that = 1 and1 = s1 =

    2.

  • 7/27/2019 Padilla Cynthia

    33/45

    24

    Example 4.2. Suppose c(x) = 0 is transmitted andr(x) = x4 + x14 + x15 + x20 is received.

    The receiver has access to r(x) andg(x) and will determine e(x).

    step 1) We have s0 = 0 which means an even number of errors have occured. Since

    s1 = 24 = 0 at least two errors have occured. Go to step 2.step 2) Compute f = det(S(I, J)) in proposition 4.1.

    S(I, J) =

    s0 s4 s8 s18s1 s5 s9 s19s2 s6 s10 s20s10 s14 s18 s28

    =

    s0 s22 s

    42 s

    165

    s1 s5 s58 s

    167

    s2 s6 s25 s

    45

    s52 s27 s

    165 s

    47

    =

    0 3 6 30

    24 29 15 25

    17 x 27 23

    27 7 30 14

    f = 17x + 27 0. By proposition 4.1 the number of errors 4. Since s0 = 0, go tostep 5.

    step 5) Calculate gcd(f4, f5).

    S(I4, J4) =

    s2 s3 s8 s14 s1s4 s5 s10 s16 s6s6 s7 s12 s18 s5s8 s9 s14 s20 s7s19 s20 s25 s0 s18

    =

    16 x 6 7 24

    3 29 27 12 xx2 19 x4 30 29

    6 15 7 23 19

    25 23 28 0 30

    f4 = 17x6 + 23x5 + 25x4 + x3 + 13x2 + 19x + 10and

    S(I5, J5) =

    s0 s1 s2 s8 s10

    s1 s3 s5 s7 s9s2 s4 s6 s8 s10s8 s10 s12 s14 s16s10 s12 s14 s16 s18

    =

    0 24 17 6 27

    17

    x 3

    27

    x4

    3 29 x2 x4 7

    x2 19 6 7 12

    6 15 27 12 30

    f5 = 12x10 + 15x8 + 7x7 + 27x6 + 22x5 + 13x4 + 16x3 + 13x2 + x + 30 F = gcd(f3, f4) = x + 14 s3 = 14 s6 = s23 = 28Since we have knowledge of8 consecutive syndromes we can now solve the linearsystem

    sk =k1

    j=k4

    sjkj for k = 5, 6, 7, 8.

    Expanding the equations we get:

    s5 = s14 + s23 + s32 + s41s6 = s24 + s33 + s42 + s51s7 = s34 + s43 + s52 + s61s8 = s44 + s53 + s62 + s71

  • 7/27/2019 Padilla Cynthia

    34/45

    25

    4 = 24, 3 = 6, 2 = 24 and1 = 22.

    x4 + 1x3 + 2x

    2 + 3x + 4 = x4 + 22x3 + 24x2 + 6x + 24 (4.3)

    The roots of(x) are x1 = 4, x2 =

    14,x3 = 15, andx4 =

    20. The exponents

    correspond to the position of errors in the error location polynomial,

    e(x) = x4 + x14 + x15 + x20

    c(x) = r(x) + e(x) = x4 + x14 + x15 + x20 + x4 + x14 + x15 + x20 = 0

  • 7/27/2019 Padilla Cynthia

    35/45

    26

    CHAPTER 5

    DECODING THE (41, 20, 10) QUADRATIC

    RESIDUE CODE BEYOND ITS

    ERROR-CORRECTING CAPABILITY

    In this chapter we present an algebraic decoding algorithm for the binary (41, 20, 10)

    expurgated QR code that will correct all error patterns of weight up to four, and most

    correctable error patterns of weight five. There are 749398 error patterns of weight five, out of

    which 439930 are correctable. The algorithm wil be able to correct 439725 of the correctable

    error patterns of weight five.

    5.1 PRELIMINARIES

    LetN41 = {3, 6, 7, 11, 12, 13, 14, 15, 17, 19, 22, 24, 26, 27, 28, 30, 34, 35, 38} be the setof quadratic nonresidues of 41 and Q41 the set of quadratic residues of 41. The smallestextension ofF2 = GF(2) containing , a primitive fourty-first root of unity, is F220. Let Z={0} N41 and define g(x) F2[x] as

    g(x) =iZ

    (xi) = x21+x19+x18+x16+x15+x14+x12+x9+x7+x6+x5+x3+x2+1 (5.1)

    Recall c(x) is a codeword if and only ifc(x) =

    40

    i=0 cixi is a multiple ofg(x). The

    received polynomial r(x) =

    30

    i=0 rixi then r(x) satisfies r(x) = c(x) + e(x) where

    e(x) =

    40

    i=0 eixi is the error pattern. As before let denote the Hamming weight ofe(x).

    Since the minimum Hamming distance of the cyclic code generated by g(x) of length 41 is

    10, it follows that e(x) can be directly determined when 4. The receiver has knowledge ofr(x) and g(x) but does not know e(x). However, the receiver may determine the most likely

    error pattern. For any k Z, the syndrome sk is defined as sk = e(k). It follows thats2k = s

    2k, for all k Z. We also have that for all k, l Z, sk = sl whenever k l (mod 41).

    We also have that for any k Z, g(k

    ) = 0 and hence sk = r(k

    ). The set of knownsyndromes is obtained by evaluating r(x) at the roots ofg(x), namely, sl with l

    (mod 41) Z. The other sl are the unknown syndromes. Note that s0 = 0 or 1 according towhether is even or odd.

    The set of indices j for which ej = 0 is L = {i1, . . . , i}. We have0 i1 < i2 . . . < i 40. The elements ofL are called the error locations, and the

  • 7/27/2019 Padilla Cynthia

    36/45

    27

    zj = ij GF(220) are the error-location numbers. These are the roots of the error-location

    polynomial

    (x) =

    j=1

    (x zj) = x +1j=0

    jxj (5.2)

    The i are the elementary symmetric functions that are related to the syndromes viaNewtons identities [7]:

    sk +

    j=1

    jskj = 0 for k Z. (5.3)

    Recall that the equations in 5.3 can be solved efficiently when one has knowledge of

    2 consecutive known syndromes. Since this is typically not the case when decoding QRcodes we will overcome this difficulty by calculating one or more unknown syndromes with

    the the aid of the following theorem.

    Recall from Theorem 3.1 that if I = {i1, i2, . . . , i+1} and J = {j1, j2, . . . , j+1} aretwo subsets of{0, . . . , 40}, which define two (+ 1) matrices and one diagonalmatrix given, respectively, by S(I, J) = XIX

    TJ . Then the (+ 1) (+ 1) matrix is equal to

    S(I, J) =

    si1+j1 si1+j2 si1+j+1si2+j1 si2+j2 si2+j+1

    ......

    ......

    si+1+j1 si+1+j2 si+1+j+1

    Furthermore, det(S(I, J)) = 0.

    5.2 CALCULATION OF THE ERROR-L OCATION

    POLYNOMIAL

    In this section the use of Theorem 3.1 for decoding the binary QR code of length 41

    generated by g(x) is illustrated. The final result is an algorithm for finding (x), the

    error-location polynomial, from r(x). The decoder will determine the coefficients of the error

    location polynomial, (x), from Newtons Identities. To decode up to four errors, knowledgeof a sequence of eight consecutive syndromes is required. One choice is s0,s1, s2, s3,s4,s5, s6,

    s7. Since sk where k Zcan be computed as r(k) and 0,3,6 and 7 are elements ofZitfollows that s0,s3, s6, s7 can be easily computed. The setsQ41 andN41 are the onlycyclotomic cosets mod 41, which means all the syndromes whose index is in Q41 can beexpressed as power of either s1 and all syndromes whose index is inN41 can be expressed as apower ofs3. Our task is to determine s1. Once this is done we can use it to determine the

  • 7/27/2019 Padilla Cynthia

    37/45

  • 7/27/2019 Padilla Cynthia

    38/45

    29

    Note that gcd(f3, f4) is always a polynomial in s1. Then:

    1. Ife(x) is a correctable error pattern of weight five, gcd(f3, f4) is a polynomial of

    degree one in 439725 cases and a polynomial of degree four in 205 cases.

    2. Ife(x) is a non-correctable error pattern of weight five, gcd(f3, f4) is a polynomial

    of degree two in 295364 cases, degree three in 11070 cases, degree five in 2050 cases, and

    degree six in 984 cases.

    Corollary 5.1. An error pattern e(x) of weight five is correctable if and only if the degree of

    gcd(f3, f4) as a polynomial in s1 is equal to one or four.

    The above corollary and propositions yield the following procedure for determining

    (x), which is guaranteed to work whenever

    5:

    1. Ifs0 = s3 = 0, then declare that = 0 and exit.

    2. Ifs212 = s11s13 = 0, then declare that = 1, 1 = s12/s11, and exit.

    3. If

    s11 s12 s13s12 s13 s14s13 s14 s15

    = 0, then solve the following linear system for the elementary

    symmetric functions:

    sk =k1

    j=k2

    sjkj for k = 13, 14, (5.4)

    declare that = 2, and exit.

    4. Iff1 0, then go to step 5 else calculate s1 as a root off2, determine the coefficients ofthe error-location polynomial (x) by solving the following linear system for theelementary symmetric functions:

    sk =k1

    j=k2

    sjkj for k = 14, 15, 16, (5.5)

    declare that = 3, and exit.

    5. Set d = deg(gcd(f3, f4)). ifd / {1, 4}, declare that the error pattern is not correctableand exit. Ifd = 4, declare failure and exit. Otherwise, go to 6 ifs0 = 0 or go to 7 if

  • 7/27/2019 Padilla Cynthia

    39/45

    30

    s0 = 1.

    6. s1 is calculated as the root off1. Determine the coefficients of the error-locationpolynomial (x) by solving the following linear system for the elementary symmetricfunctions:

    sk =k1

    j=k2

    sjkj for k = 15, 16, 17, 18, (5.6)

    declare that = 4 and exit.

    7. s1 is calculated as the root ofgcd(f3, f4). Determine the coefficients of theerror-location polynomial (x) by solving the following linear system for theelementary symmetric functions:

    sk =k1

    j=k2

    sjkj for k = 16, 17, 18, 19, 20, (5.7)

    declare that = 5 and exit.

    Remark: In case one of the linear systems listed above is singular or (x) has a root

    such that 41 = 1, the decoder will conclude that an error pattern of weight greater than fivehas occurred. In the unlikely event that deg (gcd(f3, f4)) = 4, the error pattern is correctable.

    In this case, s1 is one of the four roots of gcd(f3, f4).

    5.3 EXAMPLES

    Example 5.1. Suppose thatc(x) = 0 is transmitted andr(x) = x + x15 + x29 is received. Let

    be primitive element ofGF(220) and let = 25575 be a primitive forty-first root of unity.

    The receiver has knowledge ofr(x) andg(x) and will determine e(x).

    Step 1) Since s0 = r(0) = 1 the decoder concludes that an odd number of errors have

    occured. Go to step 2.

    Step 2) We have s3 = r(3

    ) = 566323

    . Since s12 = s4

    3 then we know s2

    12 = 168142

    . We alsohave s11s13 =

    832750. Since s212 = s11s13, the decoder concludes that either three ormore errors have occured. Go to step 4.

    Step 4) Compute f1 = det(S(I1, J1)) in proposition 5.1

  • 7/27/2019 Padilla Cynthia

    40/45

    31

    S(I1, J1) =

    s0 s14 s24 s26 s35s3 s17 s27 s29 s38s28 s1 s11 s13 s22s30 s3 s13 s15 s24s34 s7 s17 s19 s28

    =

    1 339025 346900 333100 726100

    567650 807250 83275 403625 363050

    678050 x 666200 166550 283825

    615050 567650 166550 307525 346900

    565925 693800 807250 181525 678050

    f1 0. The decoder assumes that three errors occurred and s1 is determined as theroot off2 = det(S(I2, J2)) in 5.2.

    S(I2, J2) =

    s0

    s3

    s28

    s30

    s14 s17 s1 s3s24 s27 s11 s13s26 s27 s11 s13

    =

    1 339025 346900 333100

    567650 807250 83275 403625

    678050 x 666200 166550

    615050 567650 166550 307525

    f2 = x + 649100.

    Then s16 = s161 =

    948425 and the elementary symmetric functions satisfy the linear

    system

    s14 = s113 + s122 + s131s15 = s123 + s132 + s141s16 = s133 + s142 + s151

    Solving the linear system yields 1 = 649100, 2 =

    1032725, and3 = 102300. The

    roots of(x) = x3 + 1x2 + 2x + 3 are

    x1 = 25575 = , x2 =

    383625 = 9, x3 = 741625 = 29.

    The exponents of correspond to the exact error locations, as expected.

    Example 5.2. With andas in Example 1, suppose c(x) = 0 is transmitted and

    r(x) = x4 + x9 + x11 + x25 + x37 is received.

  • 7/27/2019 Padilla Cynthia

    41/45

  • 7/27/2019 Padilla Cynthia

    42/45

    33

    CHAPTER 6

    CONCLUSIONS

    QR codes are good codes that are hard to decode. Decoding these codes is hard

    because a string of consecutive syndromes is usually not available. However in many

    instances, one can find the required unknown syndromes to correct a number of errors. In this

    work we provided decoding algorithms beyond the error correction capabilities of the QR

    codes of lengths 31 and 41. In each case it was necessary to first find the missing syndromes.

    6.1 CHALLENGES

    The biggest challenge was in selecting the desired subsets I and J that satisfied

    Theorem 3.1. When dealing with the QR code of length 41 to decode up to 5 errors there are41

    6

    2possibilities. One attempt at finding the proper subsets was by using the command that

    gave all of the subsets of size six of the set {0, 1, , 40} and checking the multi-setproduced by different sets. The Magma command provides the subsets in no particular order

    so keeping track of the subsets that did not work was difficult. Several multi-sets using these

    subsets were checked and none of them gave information about the missing syndrome s3. Due

    to the large number of subsets in {0, 1, , 40} of size six, this method seemed hopeless.Another approach was to list all of the numbers in each subset of{0, 1, , 40} in ascendingorder. The first pair of subsets checked were

    {0, 1, 2, 3, 4, 5} {0, 1, 2, 3, 4, 6} ={0, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 8, 6, 7, 8, 9, 10, 11}. When that didntwork then the last digit of the second set was increased by one and so fourth. This way of

    organizing the subsets seemed easier and made it possible to eliminate many subsets without

    having to verify all six elements of each set. For example, by verifying that

    {0, 1, 2} {j1, j2, j3} for all ji {0, 1, , 40} resulted in a multi-set not of the desired formmade it possible to eliminate all subsets of size six which contain {0, 1, 2}. Several subsetswere eliminated with this method, however there was still a large selection to choose from. At

    this point it made sense to consider a multi-set I J of the desired form and see whatpartitions ofI and J would make this multi-set possible. To do this, all possible elements of

    the set I were listed. These were all elements of{0, 1, , 40}. Once I is determined, thepossibilities for J are minimized and depend on I. All numbers ranging from 0 40 wereadded to each element of{0, 1, , 40}. All numbers ranging from 0 to 40 that resulted as anumber that was allowed to be an element ofI J when added to the number 1 were placedin a set. Similarly, all numbers ranging from 0 to 40 that resulted as a number that was

  • 7/27/2019 Padilla Cynthia

    43/45

    34

    allowed to be an element ofI J when added to the number 2 were placed in a different set.This process was repeated for all numbers up 40.The sets formed represent the possibilities

    for the elements ofJ assuming I has been determined. Once the set I has been determined, in

    order to find the proper J it is sufficient to find the intersection of these new sets which

    represent the possible elements of J ifI has been determined. Since the sets I and J are ofsize six the intersection of these sets must be at least six. If it is exactly six then it is J and if it

    is greater than six than J is a subset of size six of this intersection. It turns out that this

    procedure is just Algorithm 1 given in [2] with a slight modification.

    The difference is that in Algorithm 1, R = Q41 {0, 3} while in this caseR = Q41 {0, 3, 6, 7}. At this point it was very easy to find subsets which gave a multi-set ofthe desired form, that is, elements ofR. Several of these sets were found, now it was just a

    matter of finding which would help us determine s3. These subsets were useful to decode the

    QR code of length 41 with generator polynomial g(x) =

    i{0}Q41(x i).

    We decoded the QR code of length 41 with generator polynomial

    g(x) =

    i{0}N41(x i). In this case the Quadratic residues were the unknown syndromes

    and the quadratic non-residues were the known syndromes. Since 1 is a quadratic residue

    modulo 41 we had to determine s1 and powers ofs1. To do this it was necessary to find a

    multi-set with elements inN41 {0, 1, 2, 4}, which helped us satisfy Theorem 3.1. Thesubsets, I and J that gave the desired multi-set were found using Algorithm 1 with

    R =N41 {0, 1, 2, 4}. Finding the proper set J assuming I was determined was done bychecking the intersection of the sets formed assuming I was determined. Checking these

    intersections was done by a brute force and a lot of time could have been saved with the aid of

    a computer program. If this method was done for the QR code of length 47 it would be

    inefficient since there are47

    7

    2choices if one wished to correct 6 errors.

    6.2 FUTURE WOR K

    The QR code of length 47 has the ability to correct up to 5 errors. In order to correct

    up to 6 errors knowledge of12 consecutive syndromes is required. One choice is s1, s2, s3, s4,

    s5, s6, s7, s8, s9, s10, s11, s12. Let Q47 denote the set of quadratic residues of47. SinceQ47 = {1, 2, 3, 4, 6, 7, 8, 9, 12, 14, 16, 17, 18, 21, 24, 25, 27, 28, 32, 34, 36, 37, 42}, it followsthat s5 and s10 are unknown syndromes. Since s10 = s

    25, only s5 needs to be determined. To

    do this we may use theorem 3.1 to find s5. In order to use this theorem, a proper selection of

    the subsets I, J {1, , 46} is required. To find these subsets Algorithm 1 may be usedwith R = Q47 {0, 5}. If theorem 3.1 is not satisfied, the next thing to attempt would be

  • 7/27/2019 Padilla Cynthia

    44/45

    35

    R = Q47 {0, 5, 10} followed by R = Q47 {0, 5, 10, 20}, since s20 = s45.

    The QR code of length 41 has the ability to correct all error patterns of weight up to

    four. However, some error patterns of weight five can also be corrected. It would be

    interesting to see the actual improvement of correcting five errors versus four errors. One canperform the actual simulations by plotting signal to noise ratio versus bit error probability

    curves when five errors are corrected as well as when four errors are corrected. Once the two

    curves have been plotted, one can determine whether there is a significant gain by correcting

    five errors.

  • 7/27/2019 Padilla Cynthia

    45/45

    36

    BIBLIOGRAPHY

    [1] E. R. Berlekamp. Algebraic coding theory. McGraw-Hill Book Co., New York, 1968.[2] Y. H. Chen, T. K. Truong, Y. Chang, C. D. Lee, and S. H. Chen. Algebraic decoding of

    quadratic residue codes using berlekamp-massey algorithm. Information Science and

    Engineering, 23:127145, 2007.

    [3] M. Elia. Algebraic decoding of the (23, 12, 7) Golay code. IEEE Trans. Inform. Theory,33(1):150151, 1987.

    [4] M. Grassl. Bounds on the minimum distance of linear codes and quantum codes.

    http://www.codetables.de. accessed November 2010.

    [5] R. He, I. S. Reed, Trieu-Kien Truong, and Xuemin Chen. Decoding the (47, 24, 11)

    quadratic residue code. IEEE Trans. Inform. Theory, 47(3):11811186, 2001.[6] D. G. Hoffman, D. A. Leonard, C. C. Lindner, K. T. Phelps, C. A. Rodger, and J. R.

    Wall. Coding Theory, volume 150 ofMonographs and Textbooks in Pure and Applied

    Mathematics. Marcel Dekker Inc., New York, 1991. The essentials.

    [7] F. J. MacWilliams and N. J. A. Sloane. The theory of error-correcting codes. I.

    North-Holland Publishing Co., Amsterdam, 1977. North-Holland Mathematical Library,

    Vol. 16.

    [8] R. E. Prange and R. H. Pratt. Applications of a high-energy Coulomb wave function.

    Phys. Rev., 108(2):139143, 1957.

    [9] I. S. Reed, Xiaowei Yin, and Treiu Kien Truong. Algebraic decoding of the (32, 16, 8)quadratic residue code. IEEE Trans. Inform. Theory, 36(4):876880, 1990.

    [10] C. E. Shannon. A mathematical theory of communication. Bell System Tech. J.,

    27:379423, 623656, 1948.