590 likes | 1.43k Views
Reed-Solomon Codes. Rong-Jaye Chen. Reed-Solomon Codes. [1] Codes over GF(2 r ) [2] Reed-Solomon codes [3] Decoding Reed-Solomon codes [4] Transform approach to Reed-Solomon codes (Omitted) [5] Berlekamp-Massey algorithm [6] Erasures (Omitted). Reed-Solomon Codes.
E N D
Reed-Solomon Codes Rong-Jaye Chen
Reed-Solomon Codes • [1] Codes over GF(2r) • [2] Reed-Solomon codes • [3] Decoding Reed-Solomon codes • [4] Transform approach to Reed-Solomon codes (Omitted) • [5] Berlekamp-Massey algorithm • [6] Erasures (Omitted)
Reed-Solomon Codes • [1] Codes over GF(2r) • 1. GF(2r)[x] • Polynomials with coefficients from GF(2r) • K[x], K= GF(2)={0,1}, polynomials with binary coefficients • 2. Recall BCH code of length n=2r-1 • c(x)C iff 1, 2,3,4 are all roots of c(x), c(x)K[x] • 1, 2,4 share same minimal polynomial m1(x) and 3 has minimal polynomial m3(x) so the generator polynomial is gK(x)=m1(x)m3(x)
Reed-Solomon Codes • 3. Generalization of BCH codes • Choosing c(x)GF(2r)[x] • c(x)C iff g(x)=(x+)(x+2)(x+3)(x+4) divides c(x) • 4. Subfield subcode • CK is a BCH code • C over GF(2r) is an example of Reed-Solomon code • CK is said to be a subfield subcode of C: • CKC • All words in CK have all their digits in the subfield K of GF(2r) CK=C Kn • Both CK and C are cyclic
Reed-Solomon Codes • 5. If g(x) generates a linear cyclic code of length 2r-1 over GF(2r), the generator of the binary subfield subcode is the polynomial gK(x) • Let 1, 2,…, t be distinct non-zero elements of GF(2r). Then g(x)=(1+x) (2+x)…(t+x) generates a linear cyclic code of length 2r-1 over GF(2r) (Theorem 6.1.1) • Example: • Let F= GF(24) constructed using 1+x+x4. g(x)=(+x) (2+x)= 3+5x+x2 generates a linear cyclic code over F of length 15. The codeword corresponding to g(x) is of course 351000000000000
Reed-Solomon Codes • 6. Cyclic codes over GF(2r) • Let C be a linear cyclic code of length n over GF(2r). Every codeword c(x) can be written uniquely as m(x)g(x) for some m(x) in GF(2r)[x] of degree less than n-deg(g(x)). Also, g(x) divides f(x) iff f(x) is a codeword, and g(x) divides 1+xn (Theorem 6.1.3)
Reed-Solomon Codes • Let g(x) have degree n-k. If g(x) generates a linear cyclic code C over GF(2r) of length n=2r-1 then is a generating matrix for C. • |C|=2rk . There are 2rk polynomials m(x), since each of the k coefficients in m(x) can be any one of the 2r field elements
Reed-Solomon Codes • Example: Construct GF(23) using 1+x+x3 with as the primitive element. Let g(x)=(+x)(2+x)=3+4x+x2. Then g(x) generates a linear cyclic code C over GF(23) of length n=7 then C has 85 codewords. The codeword corresponding to m(x)=1+x+3x41003=m, for example, is m(x)g(x) mG= 304613
Reed-Solomon Codes • [2] Reed-Solomon codes • 1. Lemma 6.2.1 • Let 1, 2,…,t be non-zero elements of GF(2r). Then
Reed-Solomon Codes • Example 6.2.2 Using lemma 6.2.1 and GF(24) constructed using 1+x+x4, we find that: =(7+2)(10+2)(10+7) = 12 4 6 = 7
Reed-Solomon Codes • 2. Theorem 6.2.4 • Let g(x)=(m+1+x)(m+2+x)…(m+-1+x) be the generator of a linear cyclic code C over GF(2r) of length n=2r-1, where is a primitive element in GF(2r) and m is some integer. Then d(C) <Proof>any -1 rows in the parity check matrix H (see p.131) is linearly independent so d(C)
Reed-Solomon Codes • 3. Definition of RS(2r, ) • A binary Reed-Solomon code RS(2r, ) is a cyclic code over GF(2r) with generator g(x)=(m+1+x)(m+2+x)… (m+-1+x) for some integer m and some primitive element of GF(2r) • 4. Theorem 6.2.5 • If C is an RS(2r, ) then (a) n = 2r-1 (b) k = 2r- (c) d = (d) |C| = 2rk
Reed-Solomon Codes • 5. Binary representation of RS(2r, ) • Any RS(2r, ) code C, can be represented as a binary code simply by replacing each digit in each codeword by the binary word • Example: • Let C be the RS(4,2) with g(x)= +x and where GF(22) is constructed using 1+x+x2. From Theorem 6.2.5, C has n=3, k=2, d=2 and |C|=16, a generating matrix for C is
Reed-Solomon Codes The 16 messages u with their binary representation along with the corresponding codewords c = uG of C and their binary representations
Reed-Solomon Codes • 6. Shortened RS(2r, ) code C(s) • Example Let C be the RS(4,2) code of previous example. The shortened RS(4,2) code C(1) is formed by taking all codewords that have 0’s in the last s=1 position, namely: 000,10, 20 and 120 then deleting the last s positions. So C(1)={ 00, 1, 2, 12 }
Reed-Solomon Codes • The distance d(s) of C(s): d(C(s)) d(C) = d(s) n(s) – k(s) + 1 = 2r-1-s-(2r--s)+1 = d(s) = • Theorem 6.2.12 Let C be an RS(2r, ) code and let C(s) be the shortened RS(2r, ) code with parameters n(s),k(s),and d(s), then n(s) = 2r-1-s k(s) = 2r--s d(s) =
Reed-Solomon Codes • Example In example 6.1.5 we constructed an RS(23,3) code C with generator polynomial g(x)= 3+4x+x2. The shortened RS(23,3) code C(2) has generating matrix and has parameters n(2)=5, k(2)=3 and d(2)=3. G(2) is formed by deleting the last s=2 rows columns of the original matrix G
Reed-Solomon Codes • [3] Decoding Reed-Solomon codes • 1. Error locations and error magnitudes • The error locations of a received word are the coordinates i in which the error pattern is non-zero, referred by an error location numberI • The error magnitude of an error location i is the element of GF(2r) that occurs in coordinate i of the error pattern • Example 6.3.1: Using RS(8, 3) constructed in Example 6.1.5, if c= 3400000 is transmitted and w=3450000 is received then the most likely error pattern is c+w=e=0040000. So the error location number is 2 and the corresponding error magnitude is 4
Reed-Solomon Codes • 2. Decoding algorithm • Notation: g(x)=(m+1+x)(m+2+x)…(m+-1+x) t=(-1)/2 a1, …, ae = the error location numbers b1, …, be = the error magnitudes
Reed-Solomon Codes • Symdromes:s = wH Let w(x)=w0+w1x+ … + wn-1xn-1 c(x)=c0+c1x+ … + cn-1xn-1 e(x)=e0+e1x+ … + en-1xn-1
Reed-Solomon Codes • Syndrome: sm+1,…,sm+-1 sj=w(j) for m+1 j m+-1 w(j)=c(j)+e(j)=e(j)= (6.1) • Error locator polynomial: A(x), let A={a1,…,ae} A(x)=(a1-x) (a2-x) … (ae-x) (6.2) Define j to be the coefficient of xj in A(x) A(x)= 0+ 1x+ … + e-1xe-1+xe(6.3) (6.4) which may be written as (6.5)
Reed-Solomon Codes Substitute j=m+1,…,m+e in turn to obtain e linear equations (6.6) The exe matrix above be called M, which does have full rank
Reed-Solomon Codes Equations (6.1) can most easily be represented as follows: (6.7) Define the M’ be the extended matrix:
Reed-Solomon Codes • Algorithm 6.3.2 1. Calculate sj=w(j) for m+1 j m+2t 2. Setting e=t, find the rank of the extended matrix M’ 3. Let e be the rank of M’ and solve the linear system (6.6) for 0,…,e-1 4. Find the roots of A(x)=0+ 1x+…+ e-1xe-1+xe • These roots are the error location numbers a1,…,ae 5. Solve the linear system (6.7) for b1,…,be • There are the error magnitudes corresponding to a1,…,ae
Reed-Solomon Codes • Example 6.3.3 Let g(x)=(1+x)(+x)(2+x)(3+x)=6+5x+5x2+2x3+x4 be the generator of an RS(23,5) code (m=-1, t=2), where GF(23) is constructed using 1+x+x3. Suppose that the received word is w= 6 5 210 2 Using algorithm 6.3.2: 1. Since m=-1 and =5, we calculate the 4 syndromes s0=w(0)=6++5+2+1+0+2=1 s1=w(1)=6+2+7+5+4+0+8=3 s2=w(2)=6+3+9+8+8+0+14=3 s3=w(3)=6+4+11+11+12+0+20=1
Reed-Solomon Codes 2. Setting e=t=2, the extended matrix M’ is Row reducing M’ yields the matrix which has rank 2
Reed-Solomon Codes 3. Since M’ has full rank. e=2 and so we now solve the linear system However, as observed above, we have already row reduced M in Step 2, so we have to solve Then 41+ 2=0 so 1= 5, and 0+ 35 + 3 = 0 so 0= 1
Reed-Solomon Codes 4. We now know the error locator polynomial A(x) = 0+1x+x2=1+5x+x2. On substituting field elements into A(x), we find that A()=0 and A(6)=0. Therefore A(x)=1+5x+x2 =(+x)(6+x) So the error location numbers are a1= and a2= 6
Reed-Solomon Codes 5. Now we solve the following linear system: or Then 5b2=1 so b2=2, and b1+b2=1 so b1=6. Therefore the most likely error pattern is and the most likely codeword is c = w+e = 65 52100
Reed-Solomon Codes • Example 6.3.4 Let be the generator of an RS(24,7) code (so m=-1 and t=3),where GF(24) is constructed using (see Table 5.1) Suppose that the received word is
Reed-Solomon Codes 2. So M has rank 2 and therefore the most likely error pattern has weight e=2
Reed-Solomon Codes 3. With e=2, the linear system (6,7) becomes but in Step 2 we row reduced this matrix: Then 12 1+7=0 so 1=10, and 7 0+1+9=0 so 0=6.
Reed-Solomon Codes 4. A(x)=6+ 10x+x2=(2+x)(4+x). Therefore a1= 2 and a2=4 5. so Therefore b2= 12 and b1= 2. So the most likely error pattern is e=0020120…0 and the most likely codeword is c=w+e=142129100…0
Reed-Solomon Codes • [4] Transform approach to Reed-Solomon codes (Omitted) • [5] Berlekamp-Massey algorithm • 1. Notation • Reverse error locator polynomial R(x)=1+t-1x+t-2x2+…+0xt • Syndrome polynomial s(x)=1+sm+1x+sm+2x2+…+sm+2tx2t we can write R(x)s(x)=q(x)x2t+1+r(x) with deg(r(x)) t
Reed-Solomon Codes • Produce a sequence of polynomials Pi(x) and integer Di If Pi(x)s(x)=qi(x)xi+1+ri(x) with deg(ri(x)) i , then deg(Pi(x)) i - Di /2 and deg(ri(x)) i - (1+Di)/2 • Pi(x) is a combination of Pi-1(x) and some specific previous polynomial Pz(i-1)(x) • 2. Algorithm 6.5.1 • Calculate sj=w(j) for m+1 j m+2t • Define: q-1(x)=1+sm+1x+sm+2x2+…+sm+2tx2t q0(x)=sm+1+sm+2x+…+sm+2tx2t-1 p-1(x)=x2t+1 p0(x)=x2t Let D-1=-1 and D0=0 and let z0=-1
Reed-Solomon Codes • For 1 i 2t, recursively define qi(x), pi(x), Di, and zi as follows (a) If qi-1,0=0, then let qi(x)= qi-1(x)/x pi(x)= pi-1(x)/x Di= 2+Di-1 zi= zi-1 (b) If qi,0 0, then let
Reed-Solomon Codes which can be truncated to have degree at most 2t-1-i; and let If e t errors have occurred during transmission then p2t(x)= R(x) has degree e; the error locator polynomial is: which has e distinct roots
Reed-Solomon Codes • Example 6.5.2: Consider example-6.3.4 with the syndrome s0=7, s1=0, s2=9, s3=12, s4=9, s5=7. Working step by step through Algorithm 6.5.1, we obtain the following. We begin by setting q-1(x) = 1+7x+x2+9x3+12x4+9x5+7x6 q0(x) = 7+x+9x2+12x3+9x4+7x5 p-1(x) = x7 p0(x) = x6 D-1 = -1, D0= 0, z0= -1
Reed-Solomon Codes Let i=1. Since q0,0=70, we use step 3(b): (q0(x)+7q-1(x))/x =3+x+13x2+14x3+14x4+14x5 which is truncated to degree 2t-i-1=4 to give q1(x) =3+x+13x2+14x3+14x4 p1(x) =1+7x D1 = 2+min{D-1, D0}=0 and since D0D-1, zi=i-1=0 Before proceeding, we shall adopt a more concise format by representing the polynomials by their corresponding words. Then the information we have found so far is the following table:
Reed-Solomon Codes i qi - pi Di zi -1 0 7 0 9 12 9 7 - 0 -1 0 7 0 9 12 9 7 - 0 0 -1 1 3 0 13 14 14 - 0 7 1 0 Proceeding from i=2 to i=2t=6 we obtain the following table i qi - pi Di zi -1 0 7 0 9 12 9 7 - 0 -1 0 7 0 9 12 9 7 - 0 0 -1 1 3 0 13 14 14 - 0 7 1 0 2 12 7 6 12 - 0 8 2 1 3 0 10 9 - 0 12 1 3 2 4 0 0 - 0 10 6 4 3 5 0 - 0 10 6 6 3 6 - 0 10 6 8 3 So finally we obtain (x) by reading p2t(x)= p6(x)= backwards: (x) = 6 + 10x+ x2
Reed-Solomon Codes • Example 6.5.3: Let C be the RS(24,9) code with generator g(x)=(1+x)(+x)… (7+x) and GF(24) constructed using 1+x+x4. Suppose that w is the received word and the syndromes of w are: s0=12, s1=9, s2=6, s3=3, s4=5, s5=12,s6=6, s7=6 Using algorithm 6.5.1 and the notation describe in Example 6.5.2, we obtain the error locator polynomial as follows: i qi - pi Di zi -1 0 12 9 6 3 5 12 6 6 - 0 -1 0 12 9 6 3 5 12 6 6 - 0 0 -1 1 0 0 0 10 7 5 2 - 0 12 1 0 2 0 0 10 7 5 2 - 0 12 3 0 3 0 10 7 5 2 - 0 12 5 0 4 10 7 5 2 - 0 12 7 0 5 0 8 5 - 0 12 0 0 13 2 4 6 8 5 - 0 12 0 0 13 4 4 7 0 - 0 12 13 10 13 6 4 8 - 0 12 13 10 13 8 4 Therefore the error locator polynomial is: (x) = 13 + 10x+ 13x2+12x3+x4
Reed-Solomon Codes • 3. Error evaluator polynomial • Since r2t(x)=p2t(x)q-1(x) mod x2t+1 Either r(x)=r2t(x) or (x)=r2t(x)-p2t(x) called the error evaluator polynomial, used to calculate the error magnitudes bj, given the error locations aj • Example 6.5.2 • [6] Erasures (Omitted)