Abstract

The algebraic decoding of binary quadratic residue codes can be performed using the Peterson or the Berlekamp-Massey algorithm once certain unknown syndromes are determined or eliminated. The technique of determining unknown syndromes is applied to the nonbinary case to decode the expurgated ternary quadratic residue code of length 23.

1. Introduction

Quadratic residue (QR) codes are cyclic, nominally half-rate codes, that are powerful with respect to their error-correction capabilities. Decoding QR codes is in general a difficult task, but great progress has been made in the binary case since the work of Elia [1] and He et al. [2]. Decoding algorithms for certain nonbinary QR codes were proposed by Higgs and Humphreys in [3] and [4]. In [5], decoding of QR codes is performed by embedding them in codes over cyclotomic number fields.

This paper shows that one technique used to decode binary QR codes can be applied successfully to decode nonbinary QR codes. The main idea is to determine certain unknown syndromes in order to restore linearity to Newton's identities. Once this is done, either the Peterson or the Berlekamp-Massey algorithm can be used to solve the identities. The method of determining unknown syndromes was first presented by He et al. in [2] to decode the binary QR code of length 47 and subsequently to decode several other binary QR codes; see [6] and references therein.

Section 2 reviews the necessary background and the latter method, with the objective of establishing notation. In Section 3, the method is illustrated on the decoding of the expurgated ternary QR code of length 23. The focus is solely on the calculation of the error-location polynomial. Error values can be found from the evaluator polynomial [7, p. 246] once the error locations are determined.

2. Background and Terminology

Let 𝒬={1,2,3,4,6,8,9,12,13,16,18} be the set of quadratic residues of 23 and 𝒩 the set of quadratic nonresidues of 23. The smallest extension of 𝔽3=GF(3) containing 𝛼, a primitive twenty-third root of unity, is 𝔽311=GF(311). Denote the set {0}𝒬 by 𝒵 and define 𝑔(𝑥)𝔽3[𝑥] as𝑔(𝑥)=𝑖𝒵𝑥𝛼𝑖=𝑥12+𝑥9+𝑥7+𝑥6+2𝑥5+𝑥4+2𝑥3+2𝑥+1.(1)The cyclic code generated by 𝑔(𝑥) is the expurgated ternary QR of length 23; see [7]. Its minimum Hamming distance is equal to 9, which can be verified by direct inspection.

Let 𝑐(𝑥)=22𝑖=0𝑐𝑖𝑥𝑖𝔽3[𝑥] be the sent code polynomial, that is, a multiple of 𝑔(𝑥). The received polynomial, denoted by 𝑟(𝑥)=22𝑖=0𝑟𝑖𝑥𝑖, satisfies 𝑟(𝑥)=𝑐(𝑥)+𝑒(𝑥) where 𝑒(𝑥)=22𝑖=0𝑒𝑖𝑥𝑖𝔽3[𝑥] is the error pattern. Let 𝜈 denote the Hamming weight of 𝑒(𝑥). Observe that 𝑒(𝑥) can be correctly determined provided 𝜈4. Only 𝑔(𝑥) and 𝑟(𝑥) are known to the receiver, which seeks to determine the most probable 𝑒(𝑥). For any 𝑘, the syndrome 𝑠𝑘 is defined as 𝑠𝑘=𝑒(𝛼𝑘). It follows that 𝑠3𝑘=𝑠3𝑘, for all 𝑘. Observe that for all 𝑘,, 𝑠𝑘=𝑠 whenever 𝑘(mod23). For any 𝑘𝒵,𝑔(𝛼𝑘)=0, whence 𝑠𝑘=𝑟(𝛼𝑘). For this reason, the 𝑠 with mod23𝒵 are called known syndromes. The other 𝑠 are called unknown syndromes.

The set of indices 𝑗 for which 𝑒𝑗0 is 𝐿={𝑖1,,𝑖𝜈}. We have 0𝑖1<𝑖2<<𝑖𝜈22. The elements of 𝐿 are called the error locations, and the 𝑧𝑗=𝛼𝑖𝑗𝔽311 are the error-location numbers. These are the roots of the error-location polynomial:𝜎(𝑥)=𝑥𝜈+𝜈1𝑗=0𝜎𝜈𝑗𝑥𝑗=𝜈𝑗=1𝑥𝑧𝑗,(2)where the 𝜎𝑖 are the elementary symmetric functions that in turn are related to the syndromes via Newton's identities [7, pp. 244–245]:𝑠𝑘+𝜈𝑗=1𝜎𝑗𝑠𝑘𝑗=0for𝑘.(3)The equations in (3) can be solved efficiently when there are a sufficient number of consecutive known syndromes. However, when decoding QR codes, typically this is not the case. Such difficulty can be overcome by calculating one or more unknown syndromes with the aid of the following result from [2, p. 1182], applied to the nonbinary case [8] (recall that 𝑠𝑘=𝜈𝑗=1𝑒𝑖𝑗𝑧𝑘𝑗, for all 𝑘).

Theorem 1. Let 𝐼={𝑖1,𝑖2,,𝑖𝜈+1} and 𝐽={𝑗1,𝑗2,,𝑗𝜈+1} be two subsets of {0,,22}. They define two (𝜈+1)×𝜈 matrices and one 𝜈×𝜈 diagonal matrix given, respectively, by 𝑋𝐼=𝑧𝑖11𝑧𝑖12𝑧𝑖1𝜈𝑧𝑖21𝑧𝑖22𝑧𝑖2𝜈𝑧𝑖𝜈+11𝑧𝑖𝜈+12𝑧𝑖𝜈+1𝜈,𝑋𝐽=𝑧𝑗11𝑧𝑗12𝑧𝑗1𝜈𝑧𝑗21𝑧𝑗22𝑧𝑗2𝜈𝑧𝑗𝜈+11𝑧𝑗𝜈+12𝑧𝑗𝜈+1𝜈,𝑌𝐼=𝑒𝑖1000𝑒𝑖2000𝑒𝑖𝜈.(4)Then the (𝜈+1)×(𝜈+1) matrix defined by 𝑆(𝐼,𝐽)=𝑋𝐼𝑌𝐼𝑋𝑇𝐽 is equal to 𝑠𝑆(𝐼,𝐽)=𝑖1+𝑗1𝑠𝑖1+𝑗2𝑠𝑖1+𝑗𝜈+1𝑠𝑖2+𝑗1𝑠𝑖2+𝑗2𝑠𝑖2+𝑗𝜈+1𝑠𝑖𝜈+1+𝑗1𝑠𝑖𝜈+1+𝑗2𝑠𝑖𝜈+1+𝑗𝜈+1.(5)Furthermore, det𝑆(𝐼,𝐽)=0.

If 𝑆(𝐼,𝐽) has entries that are unknown syndromes, then Theorem 1 can be used to determine them from the equation det𝑆(𝐼,𝐽)=0.

3. Calculation of 𝜎(𝑥) for the Ternary (23,11,9) QR Code

In this section the use of Theorem 1 for decoding nonbinary QR codes is illustrated. The focus is on the ternary QR code of length 23 generated by 𝑔(𝑥). The final result is an algorithm for finding 𝜎(𝑥), the error-location polynomial, from 𝑟(𝑥). The decoder will determine the coefficients of 𝜎(𝑥), namely, the 𝜎𝑖, from (3). Knowledge of a sequence of consecutive syndromes is required. One choice is 𝑠22=𝑠1,𝑠0,𝑠1,𝑠2,𝑠3,𝑠4,𝑠5,𝑠6. Observe that any syndrome 𝑠𝑘 where 𝑘𝒵 can be readily computed by the decoder as 𝑟(𝛼𝑘). Since 5𝒵, 𝑠5 is the unknown syndrome to be determined during the decoding procedure described next. Since 5922(mod23), one has 𝑠1=𝑠22=𝑠95.

Let 𝐼1={1,2,5,9,21},𝐽1={3,4,7,11,22},𝐼2={0,4,8,19,20}, and 𝐽2={4,5,8,12,16}. Form the matrices 𝑆(𝐼1,𝐽1) and 𝑆(𝐼2,𝐽2) as in (5),𝑆𝐼1,𝐽1=𝑠4𝑠5𝑠8𝑠12𝑠0𝑠5𝑠6𝑠9𝑠13𝑠1𝑠8𝑠9𝑠12𝑠16𝑠4𝑠12𝑠13𝑠16𝑠20𝑠8𝑠1𝑠2𝑠5𝑠9𝑠20,𝑆𝐼2,𝐽2=𝑠4𝑠5𝑠8𝑠12𝑠16𝑠8𝑠9𝑠12𝑠16𝑠20𝑠12𝑠13𝑠16𝑠20𝑠1𝑠0𝑠1𝑠4𝑠8𝑠12𝑠1𝑠2𝑠5𝑠9𝑠13.(6)All the entries in 𝑆(𝐼1,𝐽1) and 𝑆(𝐼2,𝐽2) are known except for 𝑠5 and 𝑠20. However, 𝑠20=𝑠527. Therefore, 𝑓1=det𝑆(𝐼1,𝐽1) and 𝑓2=det𝑆(𝐼1,𝐽1) are polynomials in a single variable, namely, 𝑠5. The next proposition was verified for each one of the 156906 error patterns of weights 1,2,3, and 4, using Magma [9].Proposition 1. For 𝜈=1,2,3,4, gcd(𝑓1,𝑓2) is a first-degree polynomial in 𝑠5.

The above yields the following procedure for determining 𝜎(𝑥).

Step 1. If 𝑠0=𝑠1=0, then declare that 𝜈=0 and exit. Otherwise, proceed to Step 2.

Step 2. Let 𝑓=gcd(𝑓1,𝑓2). If deg𝑓=1, solve 𝑓=0 for 𝑠5 and proceed to Step 3. Otherwise, declare that 𝜈>4 and exit.

Step 3. Determine the coefficients of the error-location polynomial 𝜎(𝑥) by solving the following linear system for the elementary symmetric functions:𝑠𝑘=𝑘1𝑗=𝑘4𝑠𝑗𝜎𝑘𝑗for𝑘=3,4,5,6.(7)If the linear system is nonsingular and 𝜎(𝑥) has four roots 𝑥1,,𝑥4𝔽311 which satisfy 𝑥𝑖23=1 for 𝑖=1,,4, then declare 𝜈=4 and exit. Otherwise, proceed to Step 4.

Step 4. Solve the following linear system for the elementary symmetric functions:𝑠𝑘=𝑘1𝑗=𝑘3𝑠𝑗𝜎𝑘𝑗for𝑘=4,5,6.(8)If the linear system is nonsingular and 𝜎(𝑥) has three roots 𝑥1,𝑥2,𝑥3𝔽311 which satisfy 𝑥𝑖23=1 for 𝑖=1,2,3, then declare 𝜈=3 and exit. Otherwise, proceed to Step 5.

Step 5. Solve the following linear system for the elementary symmetric functions:𝑠𝑘=𝑘1𝑗=𝑘2𝑠𝑗𝜎𝑘𝑗for𝑘=5,6.(9)If the linear system is nonsingular and 𝜎(𝑥) has two roots 𝑥1,𝑥2𝔽311 which satisfy 𝑥𝑖23=1 for 𝑖=1,2, then declare 𝜈=2 and exit. Otherwise, proceed to Step 6.

Step 6. If we get to this point, then either 𝜈=1 or 𝜈>4. The coefficient 𝜎1 of 𝜎(𝑥) is calculated as 𝜎1=𝑠6/𝑠5. If 𝜎1𝔽311 is such that 𝜎123=1, then 𝜈=1. Otherwise, declare that 𝜈>4. Exit.