Chapter 6 Reed-Solomon Codes 6. Finite Field Algebra 6. Reed-Solomon Codes 6.3 Syndrome Based Decoding 6.4 Curve-Fitting Based Decoding
6. Finite Field Algebra Nonbinary codes: message and codeword symbols are represented in a finite field of size q, and q>. Advantage of presenting a code in a nonbinary image. A binary codeword sequence in {,} b b b b 3 b 4 b 5 b 6 b 7 b 8 b 9 b b b b 3 b 4 b 5 b 6 b 7 b 8 b 9 b A nonbinary codeword sequence in {,,, 3, 4, 5, 6, 7} c c c c 3 c 4 c 5 c 6 : where the channel error occurs 8 bit errors are treated as 3 symbol errors in a nonbinary image
6. Finite Field Algebra Finite field (Galois field) F q : a set of q elements that perform + - / without leaving the set. Let p denote a prime, e.g.,, 3, 5, 7,,, it is required q = p or q = p θ (θ is a positive integer greater than ). If q = p θ, F q is an extension field of F p. Example 6.: + and in F q. F = {, } + all in modulo- F 5 = {,,, 3, 4 } + 3 4 3 4 3 4 3 4 3 3 4 4 4 3 3 4 3 4 4 3 3 3 4 4 4 3 all in modulo-5
6. Finite Field Algebra - and / can be performed as + and with additive inverse and multiplicative inverse, respectively. Additive inverse of a a': a' + a = and a' = -a Multiplicative inverse of a a': a' a = and a' = / a - operation: Let h, a F q. h - a = h + (-a) = h + a'. E.g., in F 5, - 3 = + (-3) = + = 3; / operation: Let h, a F q. h / a = h a'. E.g., in F 5, / 3 = ( / 3) = = 4.
6. Finite Field Algebra Nonzero elements of F q can be represented using a primitive element σ such that F q ={,, σ, σ,, σ q- }. Primitive element σ of F q : σ F q and unity can be produced by at least σσ σ=, or σ q- =. all in modulo-q q E.g., in F 5, 4 = and 3 4 =. Here, and 3 are the primitive elements of F 5. Example 6.: In F 5, If is chosen as the primitive element, then F 5 = {,,, 3, 4 } = {, 4,, 3, }= {,,, 3, } If 3 is chosen as the primitive element, then F 5 = {,,, 3, 4 } = {, 3 4, 3 3, 3, 3 } = {,, 3 3, 3, 3 }
6. Finite Field Algebra If F q is an extension field of F p such as q = p θ, elements of F q can also be represented by θ-dimensional vectors in F p. Primitive polynomial p(x) of F q (q = p θ ): an irreducible polynomial of degree θ that p divides x θ but not other polynomials x Φ - with Φ < p θ -. E.g., in F 8, the primitive polynomial p(x) = x 3 + x + divides x 7 -, but not x 6 -, x 5 -, x 4 -, x 3 -. If a primitive element σ is a root of p(x) such that p(σ) =, elements of F q can be represented in the form of w θ- σ θ- + w θ- σ θ- +... + w σ + w σ where w, w,...,w θ-, w θ- F p, or alteratively in ( w θ-, w θ-,, w, w )
6. Finite Field Algebra Example 6.3: If p(x) = x 3 + x + is the primitive polynomial of F 8, and its primitive element σ satisfies σ 3 + σ + =, then F 8 w σ + w σ + w σ w w w σ σ σ σ σ 3 σ + σ 4 σ + σ σ 5 σ + σ + σ 6 σ +
6. Finite Field Algebra Representing F q = {,, σ,, σ q- }, / + - operations become : σ i σ j = σ (i + j) % (q - ) E.g., in F 8, σ 4 σ 5 = σ (4 + 5) % 7 = σ / : σ i / σ j = σ (i - j) % (q - ) E.g., in F 8, σ 4 / σ 5 = σ (4-5) % 7 = σ 6 + : if σ i = w θ- σ θ- + w θ- σ θ- + + w σ (& - ) σ j = w' θ- σ θ- + w' θ- σ θ- + + w' σ σ i + σ j = (w θ- + w' θ- )σ θ- + (w θ- + w' θ- )σ θ- + + (w + w' )σ E.g., in F 8, σ 4 + σ 5 = σ + σ + σ + σ + =
6. Reed-Solomon Codes An RS code [] defined over F q is characterized by its codeword length n = q -, dimension k < n and the minimum Hamming distance d. It is often denoted as an (n, k) (or (n, k, d) ) RS code. It is a maximum distance separable (MDS) code such that d = n - k + It is a linear block code and also cyclic. The widely used RS codes include the (55, 39) and the (55, 3) codes both of which are defined in F 56. [] I. Reed and G. Solomon, Polynomial codes over certain finite fields, J. Soc. Indust. Appl. Math, vol. 8, pp. 3-34, 96.
6. Reed-Solomon Codes Notations i F q [x], a univariate polynomial ring over F q, i.e., f( x) = fx i and fi Fq. i j F q [x, y], a bivariate polynomial ring over F q, i.e., f ( x, y) = fijx y and fij Fq. F q, - dimensional vector over F q. Encoding of an (n, k) RS code. Message vector u = ( u, u, u,, uk ) F Message polynomial k q i Ν i, j Ν Codeword cc = uu αα, uu αα, uu αα,, uu αα nn FF qq nn αα, αα, αα,, αα nn FF qq \. They are often called code locators.
6. Reed-Solomon Codes Encoding of an (n, k) RS code in a linear block code fashion c = u G αα αα αα nn = uu, uu,, uu αα αα αα nn kk kk kk kk αα αα αα nn Example 6.4: For a (7, 3) RS code that is defined in F, if the message is uu = uu, uu, uu = σσ 4,, σσ 5 8, the message polynomial will be uu xx = σσ 4 + xx + σσ 5 xx. Let αα, αα,, αα 6 =, σσ,, σσ 6, the codeword can be generated by 3 4 5 6 6 4 3 6 3 c = ( u(), u( σ), u( σ ), u( σ ), u( σ ), u( σ ), u( σ )) = (, σ, σ, σ, σ, σ,) c u ( σ 4,, σ 5 ) σ σ σ 3 σ 4 σ 5 σ 6 6 4 3 6 3 = G = = (, σ, σ, σ, σ, σ,) 4 6 3 5 σ σ σ σ σ σ
6. Reed-Solomon Codes MDS property of RS codes d = n - k + Singleton bound for an (n, k) linear block code, d n - k + u(x) has at most k - roots. Hence, c has at most k - zeros and dham = ( c,) n k+ Parity-check matrix of an (n, k) RS code HH = αα αα αα nn αα αα αα nn nn kk nn kk αα αα nn kk αα nn c T T H = u G H = an n - k all zero vector
6. Reed-Solomon Codes Insight of G H T αα αα αα nn αα αα αα nn kk kk αα αα kk αα nn αα αα nn kk αα αα αα nn kk αα αα nn αα nn nn kk αα nn Let ii =,,, kk, jj =,,, nn, vv =,,, nn kk. Entries of G can be denoted as [ G ] i,j = ( αα jj ) i Entries of H T can be denoted as [ H T ] j,v = αα jj vv+ Entries of G H T is nn GG HH TT ii,vv = αα jj ii ααjj vv+ jj= nn nn = αα jj ii+vv+ = ααjj jj= jj= ii+vv+ =
6. Reed-Solomon Codes Let αα, αα,, αα nn = σσ, σσ,, σσ nn, HH TT can be perceived as ( σ ) ( σ ) ( σ ) n ( σ ) ( σ n k ) ( σ ) n k ( σ ) ( σ ) n ( n σ ) Perceiving codeword c = ( c as in, c,, cn ) n c( x) = c + cx+ + c x n T c H = implies n k c( σ ) = c( σ ) = = c( σ ) = n k σ, σ,, σ are roots of RS codeword polynomial c(x).
6. Reed-Solomon Codes An alternatively encoding k Message polynomial u( x) = u + ux + + uk x n Codeword polynomial c( x) = c + cx + + cn x cx ( ) = ux ( ) gx ( ) and deg(g(x)) = n - k n k Since σ, σ,, σ are roots of c(x) gx ( ) = ( x σ )( x σ ) ( x σ n k ) The generator polynomial of an (n, k) RS code Systematic encoding n k n k cx ( ) x = ux ( ) + ( x ux ( ))mod gx ( ) Example 6.5: For a (7, 3) RS code, its generator polynomial is 3 4 4 3 3 3 gx ( ) = ( x σ )( x σ )( x σ )( x σ ) = x+ σ x+ x+ σx+ σ 4 5 Given message vector u = ( u, the codeword can be generated by cc xx = uu xx gg xx = + σσ, u, u) = ( σ,, σ ) xx + σσ 4 xx + σσ 6 xx 3 + σσxx 4 + σσ 3 xx 5 + σσ 5 xx 6. For systematic encoding,, 5 4 4 5 and the codeword is c = ( σ, σ,,, σ,, σ )
6.3 Syndrome Based Decoding The channel: r ( x) = c( x) + e( x) n c( x) = c codeword polynomial + cx + + cn x n e( x) = e + ex + + en x error polynomial n r( x) = r + rx + + rn x received word polynomial t Let n - k = t, σ, σ,, σ are roots of c(x) t syndromes can be determined as S = r( σ ), S = r( σ ),, S = r( σ t ) t If S = S = = St =, r(x) is a valid codeword. Otherwise, e( x), error-correction is needed.
6.3 Syndrome Based Decoding If ee xx, we assume there are errors with e. ee xx = ee jj xx jj + ee jj xx jj + + ee jj xx jj j, e j,, e j. Let v =,,,t n n n jv jv jv j v v = jσ + jσ = jσ = j ( σ ) τ j= j= j= τ = S c e e e τ jτ For simplicity, let X, we can list the t syndromes by τ = σ S = e X + e X + + e X j j j S = e X + e X + + e X j j j S = e X + e X + + e X t t t t j j j In the above non-linear equation group, XX, XX,, XX tell the error locations and ee jj, ee jj,, ee jj tell the error magnitudes. There are unknowns. It will be solvable if tt. The number of correctable errors is n k. { } Since X j, e F j q \, an exhaustive search solution will have a complexity of On ( ). τ τ
6.3 Syndrome Based Decoding In order to decode an RS code with a polynomial-time complexity, the decoding is decomposed into determining the error locations and error magnitudes, i.e., X, X,, X and ej, ej,, ej, respectively. Error locator polynomial Λ ( x) = τ = ( Xx) τ =Λ x +Λ x + +Λ x+λ ( Λ = ) j j j X = σ, X = σ,, X = σ are roots of the polynomial such that Λ ( X ) =Λ ( X ) = =Λ ( X ) =. Determine Λ( x) by finding out Λ, Λ,, and Λ, and its roots tell the error locations.
6.3 Syndrome Based Decoding How to determine Λ, Λ,, and Λ? Since ( X ) X Λ τ =Λ τ +Λ Xτ + +Λ Xτ +Λ = v e X Λ ( X ) =, for v =,,, t τ = j τ τ τ = e Λ X + e Λ X + + e Λ X + e Λ X v v + v v j j j j + e Λ X + e Λ X + + e Λ X + e Λ X v v + v v j j j j + e Λ X + e Λ X + + e Λ X + e Λ X v v + v v j j j j =Λ S +Λ S + +Λ S +Λ S v v + v v Λ +Λ + +Λ +Λ = Sv Sv + Sv Sv Error locator polynomial can be determined using the syndromes.
6.3 Syndrome Based Decoding List all v = : v = : v = 3: v = : v = + : v = + : v = t: Λ S +Λ S + +Λ S +Λ S = v v + v v Λ S +Λ S = Λ S+Λ S+Λ S= Λ S +Λ S +Λ S +Λ S = 3 3 Λ S +Λ S + +Λ S +Λ S = Λ +Λ + +Λ +Λ = S S S S+ S S3 S+ S+ Λ +Λ + +Λ +Λ = Λ +Λ + +Λ +Λ = St St + St St S S S Λ S+ S S3 S + S Λ + = S S S Λ S t t + t t S v = Λ τ = τ S v τ Remark : S is not one of the n - k syndromes.
6.3 Syndrome Based Decoding 3 Solving the linear system in finding Λ( x) has a complexity of O( ). It can be facilitated by the Berlekamp-Massey algorithm [] whose complexity is O( ). The Berlekamp-Massey algorithm can be implemented using the Linear Feedback Shift Register. Its pseudo program is the follows. The Berlekamp-Massey Algorithm Input: Syndromes S, S,, St ; Output: Λ( x) ; Initialization: r =, =, z =, Λ ( x) =, T( x) = x; : Determine = Λ ; is i= r + i : If = 3: T( x) = xt( x) ; 4: r = r+ ; 5: If r < t 6: Go to ; 7: Else 8: Terminate the algorithm; 9: Else : Update Λ ( x) =Λ( x) T( x) ; : If r z : Λ ( x) =Λ ( x) ; 3: Else 4: = r z; z = r ; T( x) =Λ( x)/ ; = ; Λ ( x) =Λ ( x) ; 5: T( x) = xt( x) ; 6: r = r+ ; 7: If r < t 8: Go to ; 9: Else : Terminate the algorithm; [] J. L. Massey, Shift register synthesis and BCH decoding, IEEE Trans. Inf. Theory, vol. 5(), pp. -7, 969.
6.3 Syndrome Based Decoding Example 6.6: Given the (7, 3) RS codeword generated in Example 6.5, after the channel, the received word is 5 4 3 4 5 r = ( σ, σ, σ, σ, σ, σ, σ ). With the received word, we can calculate syndromes as 6 3 6 4 S = r( σ) = σ, S = r( σ ) = σ, S3 = r( σ ) = σ, S4 = r( σ ) = σ. Running the above Berlekamp-Massey algorithm,we obtain r 3 4 z ( x) Λ T( x) x x x 6 σ x x 6 σ x σx σ x σ x 3 σ x σ x σ x x 6 5 6 5 3 3 5 Therefore, the error locator polynomial is Λ ( x) = σ x x. In, σ and σ are its roots. Therefore, and are corrupted. r r 5 σ σ σ 5 σ F 8
6.3 Syndrome Based Decoding Determine the error magnitudes ej, e, so that the erroneous symbols can be j,, e j corrected by cj = rj ej, cj = rj ej,, cj = rj ej v The syndromes Sv = ej X j j j τ τ, v =,,, t. Knowing X = σ, X = σ,, X = σ τ = from the error location polynomial Λ( x), the above syndrome definition implies X X X e j S e j S X X X = t t t X S X X e j t Error magnitudes can be determined from the above set of linear equations.
6.3 Syndrome Based Decoding The linear equation set can be efficiently solved using Forney's algorithm. Syndrome polynomial t t Sx ( ) = S+ Sx + + Stx = Sx v Error evaluation polynomial (The key equation) Formal derivative of Ω ( x) = Sx ( ) Λ( x)modx v Ω Xτ Error magnitude j can be determined by e j =. τ Λ ' X v= Λ ( x) =Λ x +Λ x + +Λ x+λ Λ '( x) = Λ x + ( ) Λ x + +Λ Λ +Λ + +Λ Λ +Λ + +Λ t ( ) e τ ( τ )
6.3 Syndrome Based Decoding Example 6.7: Continue from Example 6.6, 3 6 6 3 The syndrome polynomial is Sx ( ) = S+ Sx + Sx 3 + Sx 4 = σ + σ x+ σ x + σ x. 3 The error locator polynomial is Λ ( x) = σ x x. 4 4 The error evaluation polynomial is Ω ( x) = Sx ( ) Λ ( x)modx = σ x+ σ. 3 Formal derivative of Λ( x) is Λ '( x) = σ. Error magnitudes are e e ( σ ) ( σ ) Ω 3 = = σ Λ ' 5 ( σ ) ( σ ) Ω 6 = = σ Λ ' 5 5,. As a result, c = r e =, c5 = r5 e5 = σ.
6.3 Syndrome Based Decoding BM decoding performances over AWGN channel with BPSK. Uncoded RS(7, 93) RS(7, 3) RS(63, 47) RS(55, 39) RS(5, 9)