§6 Linear Codes § 6.1 Classification of error control system § 6.2 Channel coding conception § 6.3 The generator and parity-check matrices § 6.5 Hamming codes § 6.4 Syndrome decoding §6.1.1 Error control system §6.1.2 classification of error correcting codes
§6.1.1 Error control system FEC HEC IRQ ARQ Automatic Repeat Request Forward Error Correction Hybrid Error Correction Information Repeat Request
§6.1.1 Error control system 1. ARQ (Automatic Repeat Request) Error detecting codeword verdict
§6.1.1 Error control system 1. ARQ (Automatic Repeat Request) ACK1 2 х NAK2 2 2 ACK2 3
§6.1.1 Error control system х NAK х ARQ (Automatic Repeat Request)
§6.1.1 Error control system х NAK1 6 7 х NAK х ARQ (Automatic Repeat Request)
Error correcting codeword §6.1.1 Error control system 2. FEC (Forward Error Correction)
codeword 3. HEC (Hybrid Error Correction) §6.1.1 Error control system verdict
messages 4. IRQ (Information Repeat Request) §6.1.1 Error control system
1. Classification Error correct Non-linear codes Linear codes Block codes Convolution -al codes Cyclic codes Non-Cyclic codes Correct random errors Correct burst errors Correct hybrid errors §6.1.2 classification of error correcting codes
linear codes and nonlinear codes 1. Classification §6.1.2 classification of error correcting codes
( 00 ) ( 10 ) ( 01 ) ( 11 ) messages ( 001 )( 010 )( 100 )( 111 ) forbidden words ( 000 ) codewords ( 110 )( 101 )( 011 ) (3,2) block codes Example block codes and convolutional codes §6.1.2 classification of error correcting codes
in out (2,1,3)convolutional codes Example block codes and convolutional codes The encoder for (3,2,2)convolutional codes §6.1.2 classification of error correcting codes
systematic codes and nonsystematic codes 1. Classification §6.1.2 classification of error correcting codes
Exercise:
2. Error detecting codes parity check codes horizontal parity check codes Example : m= C = C’ = ( transmitting by column ) phalanx check codes §6.1.2 classification of error correcting codes
2. Error detecting codes parity check codes horizontal parity check codes phalanx check codes group counting codes §6.1.2 classification of error correcting codes
2. Error detecting codes constant rate codes §6.1.2 classification of error correcting codes
Review KeyWords: ARQ FECHECIRQ Linear block codes Convolutional codes systematic codes Error detecting codes
Homework 1.List all (3:4) constant weight codewords. 2. If phalanx check code has error pattern as follows, can it detect these errors?
§6 Linear Codes § 6.1 Classification of error control system § 6.2 Channel coding conception § 6.3 The generator and parity-check matrices § 6.5 Hamming codes § 6.4 Syndrome decoding § 6.2 Channel coding conception
1. General method for channel coding Channel encoder M=(m k-1, …,m 0 ) Redundant bits Rules (n>k)(n>k) C=(c n-1, …,c 0 ) § 6.2 Channel coding conception
2. Decoding methods C0C1┋Ci┋C2k-1C0C1┋Ci┋C2k-1 C0C1Ci┋Cj┋C2k-1C0C1Ci┋Cj┋C2k-1 C 2 k ┋ C i ’ ┋ C 2 n -1 Permitted codewords Forbidden vectors Permitted codewords Transmitter Receiver Transmission mode map
Decoding rules table: 2. Decoding methods § 6.2 Channel coding conception
Example Decoding methods ( 4 , 2 ) decoding table § 6.2 Channel coding conception
( 6 , 3 ) decoding table § 6.2 Channel coding conception 2. Decoding methods message code word one bit error two bits error
1) Code rate 3. Parameters of coding ( n , k ) codes: § 6.2 Channel coding conception Example ( 23 , 12 ) BCH code: DVB-S2 ( , ) LDPC code:
Definition: The number of nonzero components in a codeword c. 2) Hamming weight § 6.2 Channel coding conception 3. Parameters of coding
3) Hamming distance Definition: The number of bit positions which are different between two codewords c and c’. § 6.2 Channel coding conception 3. Parameters of coding
4) Minimum hamming weight Definition: The minimum value of nonzero hamming weight in a code C (4,2) code: w min =2 § 6.2 Channel coding conception 3. Parameters of coding
5) Minimum hamming distance Definition: The minimum value of hamming distance in a code C (4,2)code: d min (C) = 2 § 6.2 Channel coding conception 3. Parameters of coding
Theorem 6.1: A code C={c 1, c 2, …, c M } is capable of detecting all error patterns of weight e iff d min (C) e + 1. § 6.2 Channel coding conception 3. Parameters of coding
Theorem 6.2: A code C={c 1, c 2, …, c M } is capable of correcting all error patterns of weight t iff d min (C) 2t + 1. (p147 theorem 7.2 in textbook) § 6.2 Channel coding conception 3. Parameters of coding
Review KeyWords: The method for coding rate Hamming weight, Capability of code (encoding and decoding) Minimum hamming weight Hamming distance, Minimum hamming distance (for detecting errors or for correcting errors )
Homework 1.P163: T7.22 ; 2. Let code C={ (000000), (001110), (010101), (011011), (100011), (101101), (110110), (111000)}. (1) calculate its minimum distance. (2) if it is used as error-detecting code, how many errors can it detect? (3) if it is used as error-correcting code, how many errors can it correct?
Homework 3. Let C be an (n,k) code with minimum distance d min, and let t≤e be nonnegative integers. Show that if d min ≥ e+t+1, the C is t-error-correcting, e-error-detecting. (that is to say the errors within t can be corrected and meanwhile the e (t≤e ) errors can be detected.)
§6 Linear Codes § 6.1 Classification of error control system § 6.2 Channel coding conception § 6.3 The generator and parity-check matrices § 6.5 Hamming codes § 6.4 Syndrome encoding §6.3.1 Definition of linear block codes §6.3.2 The generator matrix §6.3.3 The parity-check matrix
§6.3.1 Definition of linear block codes 1. Vector space Let K be a field, a vector space over K is a set V with a special element 0(the zero vector) and with a vector addition denoted ‘+’ with the expected properties. 0 + v = v + 0 for all v V (property of 0) v + w = w + v for all v,w V (commutativity) (u +v) + w = u + (v + w) for all u,v,w V (associativity) a(v +w) = av + aw for all v,w V, a K (distributivity) (a + b)v = av + bv for all v V, ab K (distributivity) a(bv) = (ab)v for all v V, ab K (associativity) 1*v = v for all v V (property of 1)
1. Vector space A linear combination of vectors v 1, …, v n in a vector space V with coefficients a 1,…, a n in the scalars K is the vector The vectors v 1,…,v n are linearly dependent if there is a set of coefficients a 1,…,a n not all zero such that the corresponding linear combination is the zero vector: Conversely, vectors v 1,…,v n are linearly independent if implies that all the coefficients a i are 0. §6.3.1 Definition of linear block codes
1. Vector space Proposition: Given a basis e 1,…,e n for a vector space V, there is exactly one expression for an arbitrary vector v V as a linear combination of e 1, …, e n. Definition: The dimension of a vector space to be the number of elements in a basis for it. §6.3.1 Definition of linear block codes
2. Linear block codes Example §6.3.1 Definition of linear block codes
2. Linear block codes Example C: D: §6.3.1 Definition of linear block codes
2. Linear block codes Definition: An (n, k) linear code over F q is a k-dimensional subspace of the n-dimensional vector space V n,k (F q )={(x 1,…,x n ): x i F q }; n is called the length of the code, k the dimension. The code’s rate is the ratio k/n. Encoder (p140 definition in textbook) §6.3.1 Definition of linear block codes
Example Linear block codes Information sequence codewords (7,3) linear code §6.3.1 Definition of linear block codes
§6.3.2 The generator matrix 1. The generator matrix
§6.3.2 The generator matrix 1. The generator matrix Definition: Let C be an (n,k) linear code over F q. A matrix G whose row-space equals C is called a generator matrix for C. Conversely, if G is a matrix with entries from F q, its row-space is called the code generated by G. Example A (5,1) linear code C 1 with generator matrix. G 1 = [ ]. (p140 definition in textbook)
§6.3.2 The generator matrix 1. The generator matrix Example A (5,3) linear code C 2 with generator matrix.
§6.3.2 The generator matrix 1. The generator matrix Example (continued)
§6.3.2 The generator matrix 1. The generator matrix For systematic codes:
2. The encoder circuit of linear block codes §6.3.2 The generator matrix c6c6 c5c5 c4c4 c3c3 c2c2 c1c1 c0c0 m2m2 m1m1 m0m0
§6.3.3 The parity-check matrix 1. The parity-check matrix
§6.3.3 The parity-check matrix 1. The parity-check matrix
§6.3.3 The parity-check matrix 1. The parity-check matrix Definition: Let C be an (n,k) linear code over F q. A matrix H with the property that Hx T = 0 iff x C is called a parity-check matrix for C. (p142 definition in textbook)
2. Relationship of G and H §6.3.3 The parity-check matrix (7,3) linear code Example (continued)
2. Relationship of G and H §6.3.3 The parity-check matrix For systematic linear codes: G = [I k | P] H = [P T | I n-k ]
3. Shortened codes and dual codes §6.3.3 The parity-check matrix 1) Shortened codes C 0 =( ) C 4 =( ) C 1 =( ) C 5 =( ) C 2 =( ) C 6 =( ) C 3 =( ) C 7 =( ) ( 7 , 3 ) linear block code : (6,2) shortened code : C 0 =( ) C 1 =( ) C 2 =( ) C 3 =( ) Example 6.3.5
3. Shortened codes and dual codes §6.3.3 The parity-check matrix 1) Shortened codes
3. Shortened codes and dual codes §6.3.3 The parity-check matrix 2) Dual codes Example (continued ) (7,4)
Overview KeyWords: Linear block code The generator matrix The parity-check matrix Shortened codes and dual codes
Homework 1. p159: T7.2 (a),(b) 2. A (7,4)linear code has generator matrix as follows: (a)Plot the encoder circuit. (b)Find its parity-check matrix H.
§6 Linear Codes § 6.1 Classification of error control system § 6.2 Channel coding conception § 6.3 The generator and parity-check matrices § 6.5 Hamming codes § 6.4 Syndrome decoding §6.4.1 Standard array decoding §6.4.2 Syndrome decoding
§6.4.1 Standard array decoding 1. The standard array Set of codewords x(0)x(0) x(1)x(1) x(2)x(2) x ( 2 k -1 ) (00…0) … Subset … m0m0 m1m1 m2m2 m 2 k -1 Forbidden vectors E1E1 E1+x(1)E1+x(1) E1+x(2)E1+x(2) E 1 +x ( 2 k -1 ) … E2E2 E2+x(1)E2+x(1) E2+x(2)E2+x(2) E 2 +x ( 2 k -1 ) … E 2 n-k -1 E 2 n-k -1 +x ( 1 ) E 2 n-k -1 +x ( 2 ) … E 2 n-k -1 +x ( 2 k -1 )
§6.4.1 Standard array decoding 1. The standard array Example 6.4.1:(4,2)linear code Forbidden codewords
§6.4.1 Standard array decoding 2. The characters of standard array The sum vector of two vectors in the same row is a codeword in the set of C. There are not the same n-dimensional vectors in the same row. Each n-dimensional vector exists only in one row. Theorem 6.4 Each (n,k) linear code is capable of correcting all of 2 n-k error patterns. (Prove it by yourself)
§6.4.1 Standard array decoding Example 6.4.2
§6.4.2 Syndrome decoding 1. Syndrome vector R=x+E xH T =0 S=RH T =(s n-k-1 …s 1 s 0 ) =EH T
§6.4.2 Syndrome decoding 1. Syndrome vector Theorem k codewords in each coset have the same syndrome, and different coset with different syndrome. Example ( continued ) (Prove it by yourself)
§6.4.1 Standard array decoding Example ( continued )
§6.4.2 Syndrome decoding 2. Syndrome decoding Example 6.4.3: ( 4 , 2 ) linear code syndrome decoding Step1 : Computing the syndrome S=RH T Step2 : getting E by S 令 E = ( e 3 e 2 e 1 e 0 ) , Step3 :
S0S0 R=(r 3 r 2 r 1 r 0 ) c0c0 c1c1 c2c2 c3c3 r0r0 r1r1 r2r2 r3r3 S1S1 e0e0 e2e2 e3e3 Output in series x=R+E ^ §6.4.2 Syndrome decoding 2. Syndrome decoding
r0r0 r1r1 r n-1 s0s0 s1s1 s r-1 e0e0 e1e1 e n-1 c0c0 c1c1 c n-1 A general decoding circuit of (n,k) linear codes S=RH t S=EHtS=EHt ^ x=R+Ex=R+E Received vectors storage Compute syndrome circuit Error pattern generator n-step shift-register output §6.4.2 Syndrome decoding
Overview KeyWords: Syndrome decoding Standard array decoding
Homework 1. p159: T7.2 (c),(e) 2. p159: T p159: T Give the standard array of (7,4) linear code with a parity matrix as follows:
§6 Linear Codes § 6.1 Classification of error control system § 6.2 Channel coding conception § 6.3 The generator and parity-check matrices § 6.5 Hamming codes § 6.4 Syndrome decoding
1. Relationship between H and S §6.5 Hamming codes Example 6.5.1: (7,3)linear code E = (e 6 e 5 e 4 e 3 e 2 e 1 e 0 ) S=RH T = EH T
1. Relationship between H and S §6.5 Hamming codes
1. Relationship between H and S S is the linear combination of columns of H according to nonzero codebits in E. §6.5 Hamming codes
1. Relationship between H and S (p147 Theorem 7.3 in textbook) §6.5 Hamming codes Theorem 6.6 If all possible linear combinations of ≤ t columns of H are distinct, then d min (C) ≥ 2t + 1, And so C can correct all error patterns of weight ≤ t. (p148 Corollary in textbook) Corollary If C is an (n,k) linear code with parity- check matrix H, d min (C) = the smallest number of columns of H that are linearly dependent. Hence if every subset of 2t or fewer columns of H is linearly independent, the code is capable of correcting all error patterns of weight ≤ t. Corollary : For a linear block code C(n, k) completely determined by its parity check matrix H, the minimum weight or minimum distance of this code is equal to the minimum number of columns of that matrix which when added together result in the all-zero vector. Corollary : Let a linear block code C have a parity check matrix H. The minimum distance d min of C is equal to the smallest positive number of columns of H which are linearly dependent. That is, all combinations of d min - 1 columns are linearly independent, so there is some set of d min columns which are linearly dependent.
2. Some bounds on error correcting codes Theorem 6.7 The minimum distance for an (n, k) linear code is bounded by d min (C)≤n-k+1. Theorem 6.8 Let C is an (n,k) linear code, A t-random error correcting code C must have redundancy r(=n-k) satisfying: §6.5 Hamming codes
3. Hamming codes Definition: Let H be an m ╳ (2 m -1) binary matrix such that the columns of H are the 2 m -1 nonzero vectors from V m (F 2 ) in some order. Then the n=2 m -1, k=2 m -1-m linear code over F 2 whose parity-check matrix is H is called a (binary) Hamming code of length 2 m -1. (p149 Definition in textbook) §6.5 Hamming codes Length: n = 2 m − 1 Number of information bits: k = 2 m − m − 1 Number of parity check bits: n − k = m Error-correction capability: t = 1, (d min = 3)
Example : n=7 ( 7 , 4 ) hamming codes 1+2→11+2→1 1+3→21+3→2 1+2+3→11+2+3→1 §6.5 Hamming codes
Encoding circuit §6.5 Hamming codes 3. Hamming codes
Decoding circuit §6.5 Hamming codes 3. Hamming codes
Overview KeyWords: Hamming codes The singleton bound The Hamming bound H, S, d min, t
Homework 1. p161: T p163: T7.23