L.R.Welch THE ORIGINAL VIEW OF REED-SOLOMON CODES THE ORIGINAL VIEW [ Polynomial Codes over Certain Finite Fields, I.S.Reed and G. Solomon, Journal of SIAM, June 1960] Parameters: Let GF(2n ) be the eld with 2n elements. The number of message symbols encoded into a codeword is M . The number of code symbols transmitted is N = 2n. Message symbols are elements of GF(2n ). Code symbols are elements of GF(2n ). 1 The original view of Reed and Solomon is that the codeword symbols are the VALUES of a polynomial whose COEFFICIENTS are the message symbols. 2 MATHEMATICALLY: Let (x1 ; x2 ; ; xN ) be an enumeration of the elements of the eld. Let (m1 ; m2; ; mM ) be a message where mi 2 GF (2n). Dene a polynomial by P (Z ) = m + m Z + m Z + + mM Z M , 1 2 3 2 1 Then the codeword is (P (x1 ); P (x2 ); : : : ; P (xN )) The enumeration used by Reed and Solomon was as follows. Let be a primitive element in GF(2n). Then the enumeration is (x1 ; x2 ; ; xN ) = (0; ; 2; ; N ,2; 1) 3 Suppose the received word is (R(x1 ); R(x2 ); : : : ; R(xN )) At the receiver, N equations can be formed, some of which are wrong if there are transmission errors. R(0) = m R( ) = m + m + m + + mM M , R( ) = m + m + m + + mM M , 1 2 1 2 3 1 2 3 2 2 2 .. R(1) = m1 + m2 + m3 + + mM 1 2 ( Any M of these equations have full rank and can be solved. By trying many sets of M equations, the correct answer will appear more often than any wrong answer provided the number of errors is less than (2n , M + 1)=2. Choosing M equations and solving those equations is equivalent to Lagrange interpolation. 4 1) THE CLASSICAL VIEW Reed Solomon Codes are a sub type of BCH Codes I don't know who rst made this observation but it leads to a practical decoding algorithm developed by Wes Peterson. Parameters: Let GF(2n ) be the eld with 2n elements. Let be a primitive element in GF(2n ). The number of message symbols encoded into a codeword is M . The number of code symbols transmitted is N = 2n , 1. Let G(Z ) be the polynomial whose roots are (; 2; ; N ,M ) Message symbols are elements of GF(2n ). The BCH view is that the symbols of a codeword are the COEFFICIENTS of a polynomial in Z which is divisible by G. 5 MATHEMATICALLY: Let G(Z ) = NY ,M i=1 (Z , i) Let (m1 ; m2; ; mM ) be a message where mi 2 GF (2n). Dene a polynomial by P (Z ) = m + m Z + m Z + + mM Z M , 1 2 2 3 and dene C (Z ) = P (Z )G(Z ) NX , = ciZ i 1 i=0 Then the codeword is (c0 ; c1; ; cN ,1) 6 1 Alternatively, dividing Z N ,M P (Z ) by G(Z ) to get Z N ,M P (Z ) = Q(Z )G(Z ) + R(Z ) Then C (Z ) = Z N ,M P (Z ) , R(Z ) is divisible by G(Z ) and its coecients form a systematic codeword. 7 DECODING AS PRESENTED IN THE REED-SOLOMON PAPER Reed and Solomon described the following decoding procedure. Receive (r1 ; r2 ; ; rN ) Select M indices in all possible ways (Lagrange Interpolation)For each selection, nd P (Z ) with deg(P ) = M , 1 P (xi) = ri at these indices. The coecients of P form a potential message. As all possible selections are made, the message which gives a codeword closest to the received word occurs more often than any other. 8 An alternative is to form a codeword corresponding to each potential message and stop when the result disagrees with the received message in at most (N , M )=2 places. If none is found, failure to decode occurs. These procedures are very inecient. We will return to this later. 9 CLASSICAL DECODING [W.W. Peterson, IRE IT-6 Sept 1960] Receive (r1 ; r2 ; ; rN ) and form R(Z ) = N X riZ i,1 i=1 = C (Z ) + E (Z ) C ( i) = 0 for 1 i N , M Si = R( i) = E ( i) for 1 i N , M Peterson observed that the Si satisfy a linear recursion. e X qiSk+i for 1 k N , M , e i=0 where Q(Z ) = Pei=0 qiZ i has the error locations as 0= its roots. This gives a simple system of linear equations to nd the error locations. Another system solves for the error values. 10 Later Berlekamp found a faster algorithm for nding the recursion satised by the Si. 11 Let us return to the Reed & Solomon's Original View and see if there is another decoding method. We begin in the same way Reed and Solomon did by selecting a set of M indices, S , and nding P (Z ) for which degree of P is at most M , 1 and P (xi) = ri for i 2 S The tool is Lagrange interpolation. We ask what is the eect of errors at the selected indices. 12 LAGRANGE INTERPOLATION For each i 2 S we need a polynomial, i(Z ), of degree M , 1 which has the value 1 at xi and the value 0 at xj for j 2 S; j 6= i With these, the solution for P is P (Z ) = X rii(Z ) i2S If ri includes an error ei then eii(Z ) is added to the correct P (Z ). 13 SYNDROMES Let T (Z ) be the message polynomial and ek be the error at position k Then rk = T (xk ) + ek Given an index selection, S, the Lagrange Interpolation polynomial evaluated at xk will be P (xk ) = = X rii(xk ) iX 2S T (xi)i(xk ) + X eii(xk ) i2S i2S 14 Subtracting the interpolated values from the received values: rk , P (xk ) = T (xk ) , X T (xi)i(xk ) Xi2S +ek , eii(xk ) i2S Since T has degree at most M , 1, T (xk ) = X T (xi)i(xk ) i2S and we have k = rk , P (xk ) = ek , X eii(xk ) i2S for k 2 S c which is a new family of syndromes. Given k for k 2 S c and assuming the number of errors is within the R-S bound, we would like to solve for the ej 's. 15 INTERPOLATION POLYNOMIALS Given S , the 's are constructed as follows: Let G(Z ) = Y (Z j 2S , xj ) and let G0 (Z ) be its formal derivative. Then i(Z ) = (Z ,Gx(Z)G) 0(x ) i i It is clear that i(xj ) = 0 for i; j 2 S and j =6 i. That i(xi) = 1 follows from the rule of L'Hospital which is valid for ratios of polynomials over any eld. 16 The syndromes can now be expressed as: k = ek , X ei (x ,Gx(x)kG) 0(x ) i2S k i i or k = ek , X ei 1 G(xk ) G(xk ) i2S G0(xi) (xk , xi) This looks simpler if we dene k = G(xk ) k ek = G(exk ) for k 2 S c k and ei = G0e(xi ) i then e X k = ek , (x ,i x ) i2S k i 17 Not all of the e's are non-zero. Let E be the set of indices for which ei 6= 0 Dene QS (Z ) = Y (Z , xi) i2E \S and QC (Z ) = Y (Z , xi) i2E \S c The roots of QS (Z ) are those xi for which i 2 S and ei 6= 0 While the roots of QC (Z ) are those xi for which i 2 S c and ei 6= 0 The summation expression in the syndrome equations can now be put over a common denominator to give k = ek , QA((xxk )) S k where the degree of QS is the number of errors at selected indices and the degree of A is less 18 For k 2 S c, either ek = 0 or QC (xk ) = 0 so the product is 0 for k 2 S c . Multiplying the previous syndrome expression by Q(xk ) QS (xk )QC (xk ) gives Q(xk )k = QC (xk )A(xk ) P (xk ) Q(xk )k = P (xk ) This expression has, as unknowns, the coecients of Q and P and provides a system of linear equations for their solution. At rst glance this looks the same has the Classical case but is not. The classical equations are statements about the relationship between COEFFICIENTS of polynomials while the above expression is a relation about the VALUES of polynomials. 19 A FAST ALGORITHM FOR SOLVING THE WELCH-BERLEKAMP EQUATIONS This algorithm was developed jointly by Elwyn Berlekamp Tze Hua Liu Po Tong Lloyd Welch The Key WB Equations are Q(xk )k = P (xk ) for k 2 S c (1) These equations will be used sequentially in some order depending on auxillary information such as symbol reliability We will assume that the xk 's are renumbered so that the equations are Q(xk )k = P (xk ) for k = 1; ; N , M 20 We introduce an auxillary pair of polynomials, W (Z ); V (Z ) and recursively compute an integer and four polynomials as follows Jk ; Qk (Z ); Pk (Z ); Wk (Z ); Vk (Z ) The pair (Qk ; Pk ) will constitute a \minimal" solution to the rst k equations and the pair (Wk ; Vk ) will also solve the rst k equations but, in a certain sense, will not be minimal. 21 Initialization: J0 = 0; Q0(Z ) = 1; P0(Z ) = 0; W0(Z ) = 1; V0(Z ) = 1 Since k = 0, there are no equations to verify. 22 When we have generated Qk ; Pk ; Wk ; Vk we will have two solutions to the rst k equations. (Qk ; Pk ) and (Wk ; Vk ) However the pair (Wk ; Vk ) will be "less suitable" than (Qk ; Pk ) in a certain sense. But the pair will be useful in constructing (Qk+1 ; Pk+1) 23 STEP k At the beginning of step k we have Jk,1 and Qk,1(Z ); Pk,1(Z ); Wk,1(Z ); Vk,1(Z ) We form dk = Qk,1(xk )k , Pk,1(xk ) IF dk = 0 Jk Qk(Z ) Pk (Z ) Wk(Z ) Vk (Z ) = Jk,1 + 1 = Qk,1(Z ) = Pk,1(Z ) = (Z , xk )Wk,1 (Z ) = (Z , xk )Vk,1 (Z ) In this case (Qk,1; Pk,1) already satisfy the k'th equation and multiplication by (Z , xk ) forces the pair Wk (Z ); Vk (Z ) to satisfy the k'th equation. 24 IF dk 6= 0 We form another quantity, ck = d,k 1 (Wk,1(xk )k , Vk,1(xk )) and set Qk(Z ) Pk (Z ) Wk(Z ) Vk (Z ) = = = = (Z , xk )Qk,1 (Z ) (Z , xk )Pk,1 (Z ) Wk,1 , ck Qk,1(Z ) Vk,1 , ck Pk,1(Z ) It is readily veried that the two pair of polynomials satisfy the rst k equations. HOWEVER, we are not done with this case. IF Jk,1 = 0 then swap the two pair. Qk(Z ) $ Wk (Z ) Pk (Z ) $ Vk (Z ) and set Jk = 0 OTHERWISE set Jk = Jk,1 , 1 and do not swap pairs. 25 A MATRIX DESCRIPTION The four polynomials can be written as components of a matrix. 0 B@ Qk (Z ) Wk (Z ) 1 Pk (Z ) CA Vk (Z ) In this form the k'th step can be written 26 IF dk = 0 0 B@ Qk (Z ) Wk(Z ) Pk (Z ) Vk (Z ) 1 0 CA = B@ 1 0 10 0 CA B@ Qk,1(Z ) (Z , xk ) Wk,1(Z ) Pk, (Z ) Vk, (Z ) 1 CA Pk, (Z ) Vk, (Z ) 1 CA Pk, (Z ) Vk, (Z ) 1 CA 1 1 IF dk 6= 0 and Jk,1 6= 0 0 B@ Qk (Z ) Wk(Z ) Pk (Z ) Vk (Z ) 1 0 CA = B@ (Z , xk ) ck 10 0 CA B@ Qk,1(Z ) 1 Wk,1(Z ) 1 1 IF dk 6= 0 and Jk,1 = 0 0 B@ Qk (Z ) Wk(Z ) Pk (Z ) Vk (Z ) 1 0 CA = B@ 10 ,ck 1 CA B@ Qk,1(Z ) (Z , xk ) 1 Wk,1(Z ) 27 1 1 The fact that each pair, (Qk (Z ); Pk (Z )) and (Wk (Z ); Vk (Z )) satisfy the rst k equations can be expressed as 0 B@ Qk (xi) Wk (xi) 10 1 0 1 Pk (xi) CA B@ i CA = B@ 0 CA Vk (xi) ,1 0 28 for i k WHAT ABOUT MINIMALITY? This is the dicult part of the theorem and I will just outline the proof with a few comments. I will pattern this proof after that in Tze Hwa Liu's dissertation ( 1984) 29 First we are going to replace the decision criterion using Jk by something more intuitive. ( It is equivalent) Dene the length of an ordered pair of polynomials by L(Q(Z ); P (Z )) = max(deg(Q),1+deg(P )) and dene Lk = min L(Q(Z ); P (Z )) where the minimum is taken over all pairs of polynomials satisfying the rst k equations. 30 THEOREM: The algorithm described above gives a sequence of pairs, (Qk (Z ); Pk (Z )) for which Lk = L(Qk (Z ); Pk (Z )) That is: (Qk (Z ); Pk (Z )) is minimal. I will just list the lemmas, with a comment about some of them. Lemma 1 Lk is monotone increasing. Lemma 2 If 2Lk k then there is a unique minimum pair satisfying the rst k equations. 31 Lemma 3 If 2Lk k and dk+1 6= 0 when computed for a minimal pair at level k then Lk+1 = Lk + 1 *** Lemma 4 Qk (Z ) Wk (Z ) Pk (Z ) Vk (Z ) k Y = (Z , xi) i=1 (determinant of product is product of determinants) 32 Lemmas 5,6 L(Qk (Z ); Pk (Z )) + L(Wk (Z ); Vk (Z )) = k + 1 THE SWAP PAIRS DECISION The swap pairs decision based on the value of Jk is really the comparison of L(Qk (Z ); Pk (Z )) and L(Wk (Z ); Vk (Z )) and picking L(Qk (Z ); Pk (Z )) to be the smaller. 33 We restate the theorem: THEOREM: The algorithm described above gives a sequence of pairs, (Qk (Z ); Pk (Z )) for which Lk = L(Qk (Z ); Pk (Z )) That is: (Qk (Z ); Pk (Z )) is minimal. 34