Part 2. Channel Coding

p. 1 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU What’s Channel Coding?

¾ Channel coding: – To add redundancy in the information sequence so that the sequence can be recovered at the receiver even in the presence of noise and interference. – Transmission reliability is improved. –Examples: – Block Å memoryless – Repetition code, , Maximum-length code, BCH code, Reed-Solomon code – Cyclic redundancy check (CRC) code – Å with memory – – LDPC code

p. 2 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Error Control Techniques

¾ Forward error-control (FEC) – Using the redundancy in the transmitted code word for both the detection and correction of errors incurred during the transmission. – Simplex connection ¾ Automatic-repeat request (ARQ) − Using the redundancy merely for error detection. − The receiver sends a feedback to the transmitter, saying that if any error is detected in the received packet or not (Not-Acknowledgement (NACK) and Acknowledgement (ACK), respectively). − The transmitter retransmits the previously sent packet if it receives NACK. − Full-duplex connection ¾ Hybrid ARQ (ARQ+FEC) − Full-duplex connection − Error detection and correction

p. 3 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU FEC Historical Pedigree (1)

1950 1960 1970

Shannon’s Paper 1948 Early practical Hamming Early practical implementations defines basic implementations of RS for tape binary codes Gallager’s Thesis and disk drives On LDPCs BCH codes Berlekamp and Massey Proposed Viterbi’s Paper rediscover Euclid’s On Decoding polynomial technique Convolutional Codes and enable practical Reed and Solomon algebraic decoding define ECC Forney suggests Technique concatenated codes p. 4 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU FEC Historical Pedigree (2)

1980 1990 2000

Ungerboeck’s TCM Paper - 1982 LDPC beats RS codes appear LDPC beats Turbo Codes in CD players Turbo Codes For DVB-S2 Berrou’s Turbo Code First integrated Standard - 2003 First integrated Paper - 1993 Viterbi decoders Renewed interest (late 1980s) Turbo Codes in LDPCs due to TC Adopted into Research Standards TCM Heavily (DVB-RCS, 3GPP, etc.) Adopted into Standards p. 5 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Part 2.1 Block codes

p. 6 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Some Definitions (1)

¾ Field ƒ Let F be a set of elements on which two operations addition and multiplication are defined. ƒ F is said to be a field if and only if 1. F forms a commutative group under addition operation. ∀ab, ∈⇒+=+∈ F a b b a F 2. F contains an element called zero that satisfies a+0=a 3. F forms a commutative group under multiplication operation. ∀ab, ∈⇒⋅=⋅∈ F a b b a F 4. F contains an element called the identity satisfying a(1)=a 5. The operations “+” and “.” are distributive: abc⋅()()()+=⋅+⋅ ab ac

p. 7 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Some Definitions (2)

¾Galois field: GF(q) ƒ A with q elements ƒ Example: when q is a prime, GF(q) has the elements {0, 1, …, q-1}. The addition and multiplication operations are defined modulo q. Binary field: GF(2), {0, 1}

Addition Multiplication 0 ⊕ 0 = 0 0⋅0 = 0 0 ⊕1 =1 0⋅1 = 0 1⊕ 0 =1 1⋅0 = 0 1⊕1 = 0 1⋅1 =1

p. 8 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Galois Field

¾GF(5) is a set of elements {0, 1, 2, 3, 4}

+ 01234 i 01234 001234 0 00000 112340 101234 223401 202413 334012 303142 440123 404321

p. 9 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Some Definitions (3)

¾ Vector space ƒ Let V be a set of vectors and F a field of elements (called scalars). V forms a vector space over F if: 1. Vector addition commutative: ∀u, v∈⇒+=+∈VV u v v u

2. Scalar multiplication: ∀aF∈∀∈⇒⋅=∈, vV a vuV 3. Distributive: (ab+ )⋅=⋅+⋅vvv a b and a ⋅ ( uvuv + ) =⋅+⋅ a a

4. Associative: ∀ab,,∈∀∈⇒⋅⋅=⋅⋅ Fvvv V () a b a () b 5. ∀vV∈⋅=, 1 vv 6. Zero vector: 0VvV∈ ,∀∈ ⇒ v0v + = 7. ∀vV∈∈+=, there exists an element wV, such that v w0

p. 10 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Some Definitions (4)

¾ Vector space (cont’d): ƒ Example

− The set of binary n-tuples, denoted by Vn

V4 = {(0000),(0001),(0010),(0011),(0100),(0101),(0110),(0111), (1000),(1001),(1010),(1011),(1100),(1101),(1110),(1111)} ¾ Vector subspace:

− A subset S of the vector space V n is called a subspace if: − The all-zero vector is in S. − The sum of any two vectors in S is also in S. − The scalar multiplication of the vectors in S is also in S.

− Example: {(0000),(0101),(1010),(1111)} is a subspace of V4 . p. 11 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Some Definitions (5)

¾ Spanning set

• A collection of vectors G = {vv12,,,…, vn } the linear combinations of which include all vectors in a vector space V, is said to be a spanning set for V or to span V. •Example:

{(1000),(0110),(1100),(0011),(1001)} spans V4 . ¾ Basis: • A spanning set for V that has minimal cardinality is called a basis for V. • Cardinality of a set is the number of vectors in the set.

•Example: {(1000),(0100),(0010),(0001)} is a basis for V4 .

V4 = {(0000),(0001),(0010),(0011),(0100),(0101),(0110),(0111), (1000),(1001),(1010),(1011),(1100),(1101),(1110),(1111)} p. 12 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Block Codes (1)

¾ (n, k) block code: ƒ The information stream is partitioned into blocks of k elements. ƒ Each block is mapped to a larger block of n elements, called code word. Æ memoryless ƒ The elements of a code/information block word are selected from an alphabet of q symbols. − Binary code : q=2; the alphabet = {0, 1} − Non-binary code: q>2

Channel Data block encoder Code word k elements n elements

n-k Redundant elements k R = Code rate c n p. 13 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Block Codes (2)

(n, k) binary block code

n bits : k bits : 2n possible codes k 2 information blocks mapping V V n k C 2k code words

Basis of C Example: (n=6,k=3) k code words code rate=3/6, 3 redundant elements (constructing a 3-bit blocks are mapped to 6-bit codewords. generator matrix) (100) Æ (110100); (010) Æ (011010)

p. 14 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Block Codes (3)

¾ Linear block codes:

ƒ Suppose ci and cj are two code words in an (n,k) block code and a1 and a2 be any two elements selected from the alphabet. Then the code is linear if and only if a1 ci +a2 cj is also a code word. ƒ A must contain the all-zero code word ƒ Easy implementation and analysis ¾ Non-linear block codes: ƒ Example: (4, 2) code (00)→ ( 1000) ()(10→ 0100 ) ()( ) 01→ 0010 ()( ) 11→ 0 0 01 p. 15 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Linear Block Codes (1)

¾ Important parameters (1)

ƒ of a code word ci , denoted by wi=w(ci), is the number of non-zero elements in ci .

ƒ between two code words ci and cj, is the number of elements in which they differ.

ddij= ()(c,c i j=⊕ w c i c j )

ƒ Minimum distance is ddmin ==min (cij ,c ) minw (ci ) i≠ j i≠1

p. 16 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Linear Block Codes (2)

¾ Important parameters (2) ƒ Error detection capability is given by ed= min −1 ƒ Error correcting-capability t of a code, which is defined as the maximum number of guaranteed correctable errors per codeword, is

⎢ ⎥ td=−⎣( min 12) ⎦

Copied from Proakis’s Digital Communications p. 17 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Linear Block Codes (3)

¾ Encoding in (n,k) linear block code:

The generator matrix cmG= Generally, the rows of G, { g i } ,

⎡⎤g1 are linearly independent. ⎢⎥g They form a basis for the (n, (,cc ,…… , c )=⋅ ( mm , , , m )⎢⎥2 12nk 1 2 ⎢⎥ k) codes. ⎢⎥ ⎣⎦gk

(,cc12 ,…… , cnkk )= m 1⋅+gg 1 m 2 ⋅++ 2 m ⋅ g

p. 18 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Linear Block Code (6, 3)

Hamming Message vector Codeword weight Generator matrix: 000 000000 0 Basis of the codewords 100 110100 3 ⎡⎤g 1 ⎡ 110100⎤ Gg==⎢⎥⎢ 011010⎥ 010 011010 3 ⎢⎥2 ⎢ ⎥ ⎣⎦⎢⎥g 3 ⎣⎢ 101001⎦⎥ 110 101110 4 001 101001 3 cmG= 101 011101 4 011 110011 4 111 000111 3

dmin = 3 p. 19 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Linear Block Codes (4)

¾ Systematic linear block code (n,k) − For a systematic code, the first (or last) k elements in the codeword are information bits.

GIP= [ k ]

Ik =×kk identity matrix

Pk =×knk( − ) matrix

c ==(cc , ,..., c ) ( mm , ,..., m , p , p ,..., p ) 12nknk 1 2 1 2 − message bits parity check bits

p. 20 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Systematic Linear Block Code

Message codeword 0000 0000 000 (7,4) systematic code 0001 0001 011 0010 0010 110 0011 0011 101 1000101 ⎡⎤0100 0100 111 ⎢⎥010 0111 G = ⎢⎥0101 0101 100 ⎢⎥0010110 ⎢⎥0110 0110 001 ⎣⎦0001011 0111 0111 010 1000 1000 100 1001 1001 110 1010 1010 010 1011 1011 000 1100 1100 011 1101 1101 001 1110 1110 100 1111 1111 111 p. 21 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Linear Block Codes (5)

¾ For any linear code we can find a matrix H ( n − k ) × n , whose rows are orthogonal to rows of G : GHT = 0

¾ H is called the parity check matrix and its rows are linearly independent. ¾ The relation between any non-zero code word c and the parity check matrix is : cHTT= mGH= 0

¾ Any linear code c with generator matrix as H, is called the dual code of the linear code c with generator matrix as G. They are orthogonal. ccTTTT= mG() mH== mGH m 0 p. 22 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Systematic linear block code : GIP==−; H[][ PITT PI] []knknk−−= binary codes

⎡1000111⎤ ⎡110110 0⎤ ⎢0100101⎥ ⎢ ⎥ G = ⎢ ⎥ H = 1011010 ⎢0010011⎥ ⎢ ⎥ ⎢ ⎥ ⎢1110 0 01⎥ ⎣0 0 01110⎦ ⎣ ⎦ ⎡⎤111 ⎢⎥101 ⎡⎤1000111⎢⎥ ⎢⎥⎢⎥011 0100101⎢⎥ GHT ==⎢⎥110 0 ⎢⎥0010011⎢⎥ ⎢⎥⎢⎥100 ⎣⎦0001110⎢⎥ ⎢⎥010 ⎢⎥ ⎣⎦001 p. 23 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Decoding over AWGN Channel

¾ Maximum likelihood decoding: In the decoding of a n-bit block code, the distances between the received code word and the 2k possible transmitted code words are computed. The code word that is closest in distance to the received code word is selected as the decoder output. − Optimum in the sense that it results in a minimum probability of a code word error − Soft decision decoding Å Euclidean distance − Hard decision decoding Å Hamming distance ¾ Also known as minimum-distance decoding p. 24 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Decoding over AWGN Channel (2)

¾ Soft decision decoding using Euclidean distance − Example: (n,k) binary block codeÆ computing 2k metrics (high complexity)

The transmitted code word Cmmm= [εcc12 c mnmj] , c =0 or 1,

the transmitted signal: (2cmj− 1) c ()0;1→− εεc → c

the received signals: r =←[]rr12 rn unquantize d

BPSK modulation+AWGN channel :rcjm=− (2j 1) cj + nj , = 1,2, ,n Euclidean distance: ε

nn22 ⎛⎞2 ∑∑()rcjijcjijc−−(2 1)εεε =⎜ r +() (2 c − 1) − 2 rjijc(2c − 1) ⎟ jj==11⎝ ⎠ Select the code word corresponding to minimal Euclidean distance, mathematically: n k maxCMii= max C (rc , )= max (2 c ijj− 1)r ,1,2,,2i = ii i∑ j=1

p. 25 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Decoding over AWGN Channel (3)

¾ Hard decision decoding using Hamming distance − Received signal is quantized/detected. − Select the code word with minimum Hamming distance to the received coded word − Low complexity − Syndrome decoding ¾ Comparison

Soft decision decoding: better performance with higher complexity

Probability of a decoding error for a binary (3, 1) code over AWGN channel

Copied from The Art of Error Correcting Coding, pp. 17. p. 26 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Syndrome Decoding

Message Generator Code Received Parity check eSrHˆ ←= T vector matrix vector vector matrix Creˆ = + ˆ m G C r=C+e HT

rCe= +

r = (r1,r2 ,....,rn ) received codeword or vector

e = (e1,e2 ,....,en ) error pattern or vector

„ Syndrome testing: – S is syndrome of r, corresponding to an error pattern e. SrHCeHeH==+=TTT() p. 27 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Syndrome Decoding (2)

¾ How to decode? 1. Calculate SrH= T

2. Find the error pattern , eeˆ = i corresponding to S , based on syndrome table. 3. Calculate Creˆ = + ˆ and the corresponding m ˆ .

–Note that Creˆ = +=ˆˆˆ() Ce)eC(ee + += + + • If e ˆ = e , error is corrected. • If eˆ ≠ e , undetectable decoding error occurs.

Achieve minimum Hamming distance find eˆ with minimum weight p. 28 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU How to Generate Syndrome Table?

¾ Standard array k 1. List all the 2 possible code words in the first row, with C1=0 at the first column n-k 2. For row i=2,3,…,2 , find a vector in V n with minimum weight which is not already listed in the array.

3. Call this pattern e i and form the ith row as the corresponding coset

zero codeword CC C 12 2k

eeC222⊕⊕ eC 2k 2 coset

eenk−− nk⊕⊕ C e nk − C k coset leaders 222 2 2

¾ The syndromes corresponding to the coset leaders form the T syndrome table: SeHii= p. 29 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example: Standard Array for (6, 3) Code codewords

000000 110100 011010 101110 101001 011101 110011 000111 000001 110101 011011 101111 101000 011100 110010 000110 000010 110111 011000 101100 101011 011111 110001 000101 000100 110011 011100 101010 101101 011010 110111 000110 001000 111100 010000 100100 coset with the same syndrome 100000 010100 010001 100101 010110

2n-k coset leaders : minimum weight Æ minimum Hamming distance

⎡⎤110100 ⎡100101⎤ ⎢⎥⎢ ⎥ G 011010 H 010110 dtmin = 31⇒= = ⎢⎥= ⎢ ⎥ ⎣⎦⎢⎥101001 ⎣⎢001011⎦⎥ p. 30 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Error Detection and Correction

¾ (6, 3) linear block code : Syndrome decoding

SeH= T Error pattern Syndrome ii C = (101110) is transmitted. 000000 000 one error r = (001110) is received. correctable 000001 101 The syndrome of r is computed: 000010 011 TT 000100 110 SrH==(001110) H = (100) 001000 001 Error pattern corresponding to this syndrome is 010000 010 eˆ = (100000) 100000 100 The received vector is corrected as 010001 111 Creˆ =+=+=ˆ (001110) (100000) (101110)

eˆ : minimum weigth ⎡110100⎤ ⎡100101⎤ ⇓ G = ⎢011010⎥ H = ⎢010110⎥ ⎢ ⎥ ⎢ ⎥ minimum distance between Crˆ and ⎣⎢101001⎦⎥ ⎣⎢001011⎦⎥ p. 31 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Error Detection and Correction (2)

¾ (6, 3) linear block code : Syndrome decoding

SeH= T Error pattern Syndrome ii C = (101110) is transmitted. 000000 000 two errors r = (001100) is received. uncorrectable 000001 101 The syndrome of r is computed: 000010 011 TT 000100 110 SrH==(001100) H = (111) 001000 001 Error pattern corresponding to this syndrome is 010000 010 eˆ = (010001) 100000 100 The decoded vector is 010001 111 Creˆ =+=ˆ (001100)+= (010001) (011101)

⎡110100⎤ ⎡100101⎤ G ⎢011010⎥ H ⎢010110⎥ = ⎢ ⎥ = ⎢ ⎥ ⎣⎢101001⎦⎥ ⎣⎢001011⎦⎥ p. 32 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Special Linear Block Codes

¾ Hamming codes

„ Hamming codes are a subclass of linear block codes and belong to the category of perfect codes. „ Hamming codes are expressed as a function of a single integer m ≥ 2 .

Code length: n =− 2m 1 Number of information bits: km= 2m −− 1 Number of parity bits: n-k= m Error correction capability: t= 1

Minimum distance: dmin =3

„ The columns of the parity-check matrix, H, consist of all non-zero binary m-tuples. p. 33 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Hamming Code (1)

¾ Systematic Hamming code (7, 4) m=3, n=23-1=7, k=23-m-1=4 ⎡⎤110110 0 HPI==⎢⎥1011010 [T ] ⎢⎥33× ⎣⎦⎢⎥1110 0 01

⎡⎤10 0 0111 ⎢⎥0100101 GIP==⎢⎥[] ⎢⎥0010011 44× ⎢⎥ ⎣⎦0 0 01110

p. 34 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Hamming Code (2)

¾ Systematic Hamming code (7, 4)

⎡1000111⎤ ⎢0100101⎥ G = ⎢ ⎥ ⎢0010011⎥ ⎢ ⎥ ⎣0001110⎦

dmin =3

p. 35 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Hamming Code (3)

Coding gain: For a given bit-error probability, the reduction in

Eb/N0 that can be realized Pb through the use of coding:

⎛⎞EEbb ⎛⎞ 8PSK G [dB]=− ⎜⎟[dB] ⎜⎟ [dB] NN ⎝⎠00uc ⎝⎠

QPSK

Eb / N 0 [dB]

p. 36 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Cyclic Block Codes

¾ Cyclic block codes are a subclass of linear block codes. BCH and Reed-Solomon are cyclic codes. ¾ A linear (n,k) code is called a cyclic block code if all cyclic shifts of a codeword are also codewords.

“i” cyclic shift of C C = (ccc012 , , ,..., cn− 1 ) ()i C = (ccni−−+− , ni110121 ,..., ccccc n , , , ,..., ni −− )

ƒ Example: C = (1101) CCCC(1)=====(1110) (2) (0111) (3) (1011) (4) (1101) C

Cyclic property enables efficient implementations of encoding and decoding p. 37 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Cyclic Block Codes (2)

¾ Cyclic block codes in polynomial form

21n− C(X )=+ccXcX01 + 2 ++ ... cXn− 1 degree ( n- 1)

¾ Relationship between a codeword and its cyclic shifts:

21nn− XXC( )=+ cXcX01 + ..., cXnn−− 2 + cX 1 =++ccXcXcXcXc21 ++... nn− + + nnnn−10 1−−− 2 1 1 (1) n C ()XcXn−1 (+ 1) (1) n =++C ()XcXn−1 ( 1)

CC(1) ()XXX= () modulo ( Xn + 1) By extension CC()ii()XXX= () modulo ( X n+ 1)

p. 38 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Cyclic Block Codes (3)

¾ Basic properties Let C be a binary (n,k) 1. There is a polynomial g ( X ) with degree rnk = − . g ( X ) is called the generator polynomial.

r g(X )=+ggX01 ++ ... gXr

2. Every code polynomial C () X in C, can be expressed uniquely as

Message Cmg()X = ()()XX Encoding polynomial

21k − m(X )=+mmXmX01 + 2 ++ ... mXk − 1 degree ( k- 1)

3. The generator polynomial g ( X ) is a factor of X n +1 p. 39 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Cyclic Block Codes (4)

¾ Basic properties (cont’d) 4. The row i , i = 1 ,..., k , of the generator matrix is formed by the coefficients of the " i − 1 " cyclic shift of the generator polynomial.

⎡g g g 0 ⎤ ⎡ g(X ) ⎤ 0 1 r ⎢ g g g ⎥ ⎢ Xg(X ) ⎥ ⎢ 0 1 r ⎥ G = ⎢ ⎥ = ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ g0 g1 gr X k −1g(X ) ⎢ ⎥ ⎣ ⎦ ⎢ ⎥ ⎣ 0 g0 g1 gr ⎦

5. The orthogonality of G and H in polynomial form is expressed as gh ()() XXX = n + 1 . This means h ( X ) is also a factor of X n +1 . h () X denotes the parity polynomial that has degree of k.

nn ⎡⎤⎡⎤⎣⎦⎣⎦Ch(XX ) ( ) modulo ( X+ 1)=+= mgh ( XXX ) ( ) ( ) modulo ( X 1) 0 p. 40 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Cyclic Block Code (1)

¾ (n=7, k=4) cyclic code

X 7323+=1(1)(1 +XXXXX + + )(1 + + )

g(XXX )=+ (123 + ) → (1011) h()(1)(1XXXXXXX=+ ++3234 )1 =+ + +

⎡⎤⎡g()X 1011000 ⎤Generator matrix ⎢⎥⎢XXg() 0101100 ⎥ G ==⎢⎥⎢ ⎥ ⎢⎥⎢ 0010110 ⎥ ⎢⎥⎢k −1 ⎥ ⎣⎦⎣XXg() 0001011 ⎦

p. 41 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Cyclic Block Code (2)

¾ (n=7, k=4) cyclic code (Cont’d)

mmmm0123 ccccccc 0123456

230 0 0 0 0000000 m(X) =+mmXmXmX01 + 2 + 3 1000 1011000 Cyclic 0100 0101100 property 1 1 0 0 1110100 0 0 1 0 0010110 g()(1X =+XX23 + ) 1010 1001110 0110 0111010 1110 1100010 ⎡⎤1011000 0 0 0 1 0001011 ⎢⎥0101100 G = ⎢⎥1001 1010011 ⎢⎥0010110 ⎢⎥0 1 0 1 0100111 ⎣⎦0001011 1 1 0 1 1111111 0 0 1 1 0011101 1 0 1 1 1000101 0111 0110001 1111 1101001

p. 42 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Cyclic Block Codes (5)

¾ (n, k) systematic cyclic code generation Multiply the message polynomial m ( X ) by X n − k

Divide the result of Step 1 by the generator polynomial g ( X ) to obtain the reminderp(X )

pmg()XX= nk− () X mod () X XXXXXnk− mqgp()=+ ()() ()

Add p ( X ) to X n − k m ( X ) to form Shifting the the codeword C()X message signal Cmpqg()XX=+=nk− () X () X ()() XX p. 43 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Systematic Cyclic Block Code (1)

¾ For the systematic (7,4) cyclic code with generator polynomial g()1X =+XX + 3

9 Find the codeword for the message m = (1011)

nknk==−=7, 4, 3 mm=⇒=++(1011) (XXX ) 1 23 X nk− mm()XX==++=++3323356 () XX (1 XX ) XXX Divide XXnk− mg( ) by (: X) XXX356++=+++(1 XXX 23 ) (1 +++ XX 3 ) 1 quotient qg(X)generator (X) remainder p(X ) Form the codeword polynomial: Cp()XXXXXXX=+ ()3356 m () =+++ 1 C = (1 0 0 1 0 1 1) parity bits message bits p. 44 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Systematic Cyclic Block Code (2)

¾ For the systematic (7,4) cyclic code with generator polynomial g()1X =+XX + 3 9 Find the generator and parity check matrices, G and H, respectively.

2 3 g(X ) =1+1⋅ X + 0⋅ X +1⋅ X ⇒ (g0 , g1, g2 , g3 ) = (1101) ⎡1 1 0 1 0 0 0⎤ Not in systematic form. ⎢ ⎥ 0 1 1 0 1 0 0 We do the following: G = ⎢ ⎥ ⎢0 0 1 1 0 1 0⎥ row(1) + row(3) → row(3) ⎢ ⎥ ⎣0 0 0 1 1 0 1⎦ row(1) + row(2) + row(4) → row(4)

⎡1 1 0 1 0 0 0⎤ ⎡1 0 0 1 0 1 1⎤ ⎢0 1 1 0 1 0 0⎥ G = ⎢ ⎥ H = ⎢0 1 0 1 1 1 0⎥ ⎢1 1 1 0 0 1 0⎥ ⎢ ⎥ ⎢ ⎥ ⎣⎢0 0 1 0 1 1 1⎦⎥ ⎣1 0 1 0 0 0 1⎦ T I3×3 P P I4×4 p. 45 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Systematic Cyclic Block Code (3)

¾ For the systematic (7,4) cyclic code with generator polynomial g()1X =+XX + 3

mmmm0123 ccccccc 0123456 Cyclic 0 0 0 0 0000000 Message property 1000 1101000 bits 0 1 0 0 0110100 1 1 0 0 1011100 0010 1110010 1010 0011010 0 1 1 0 1000110 1 1 1 0 0101110 0 0 0 1 1010001 1001 0111001 dmin =3 0101 1100101 1101 0001101 0 0 1 1 0100011 1 0 1 1 1001011 0111 0010111 1111 1111111 p. 46 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Cyclic Block Codes (6)

¾ Syndrome decoding in polynomial form ƒ Received codeword in polynomial form is given by

rCe()XXX= ()+ () Received Error codeword =+mg()()X XX e () pattern ƒ The syndrome is the reminder obtained by dividing the received polynomial by the generator polynomial.

r(X ) = q(X )g(X ) + S(X ) Syndrome

ƒ With syndrome and error patterns, error is estimated. The corrected codeword in polynomial form is obtained as Creˆ ()XXX=+ ()ˆ ()

p. 47 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU Example of Error Detection and Correction

¾ Syndrome decoding : cyclic code (7, 4) g()1XXX=+ + 3

CC=⇔=++(1010001) (XXX ) 1 26 rr=⇔=+++ (1011001) is received. (XXXX ) 1 236 r()1X=+ X236 + X + X = ( XX + 3 )(1 + XX + 3 ) +(1)+ X The syndrome of rrg is computed as the remainder of () (XX ) ( ) : SS(XX )=+ (1 ) ⇔= (110) Error pattern corresponding to this syndrome is eeˆˆ=⇔=(0001000) (XX ) 3 The corrected codeword in polynomial is estimated as Creˆ ()XXX=+=++++=++ ()ˆ ()1 XXXXXX2363 1 26 Creˆ =+=ˆ (1011001)+(0001000)= (1010001) p. 48 ELEC 7073 Digital Communications III, Dept. of E.E.E., HKU