Introduction to Coding Theory
Total Page:16
File Type:pdf, Size:1020Kb
Introduction Why Coding Theory ? Introduction Info Info Noise ! Info »?# Sink to Source Heh ! Sink Heh ! Coding Theory Encoder Channel Decoder Samuel J. Lomonaco, Jr. Dept. of Comp. Sci. & Electrical Engineering Noisy Channels University of Maryland Baltimore County Baltimore, MD 21250 • Computer communication line Email: [email protected] WebPage: http://www.csee.umbc.edu/~lomonaco • Computer memory • Space channel • Telephone communication • Teacher/student channel Error Detecting Codes Applied to Memories Redundancy Input Encode Storage Detect Output 1 1 1 1 0 0 0 0 1 1 Error 1 Erasure 1 1 31=16+5 Code 1 0 ? 0 0 0 0 EVN THOUG LTTRS AR MSSNG 1 16 Info Bits 1 1 1 0 5 Red. Bits 0 0 0 0 0 0 0 FRM TH WRDS N THS SNTNCE 1 1 1 1 0 0 0 0 1 1 1 Double 1 IT CN B NDRSTD 0 0 0 0 1 Error 1 Error 1 Erasure 1 1 Detecting 1 0 ? 0 0 0 0 1 1 1 1 Error Control Coding 0 0 1 1 0 0 31% Redundancy 1 1 1 1 Error Correcting Codes Applied to Memories Input Encode Storage Correct Output Space Channel 1 1 1 1 0 0 0 0 Mariner Space Probe – Years B.C. ( ≤ 1964) 1 1 Error 1 1 • 1 31=16+5 Code 1 0 1 0 0 0 0 Eb/N0 Pe 16 Info Bits 1 1 1 1 -3 0 5 Red. Bits 0 0 0 6.8 db 10 0 0 0 0 -5 1 1 1 1 9.8 db 10 0 0 0 0 1 1 1 Single 1 0 0 0 0 Error 1 1 • Mariner Space Probe – Years A.C. 1 Error 1 • 1 Correcting 1 1 1 0 0 0 0 Eb/N0 Pe 1 1 1 1 0 0 -1.6 db Essentially Zero 1 1 0 0 31% Redundancy 1 1 1 1 1 db = $1,000,000 1 Types of Channels 2-Repeat Code 1 − p 0 0 Info. Words Code Words p p 0 00 1 11 1 1 − p 1 Binary Symmetric Channel (BSC) Detects all single errors If we use BEC with probability of transition p = 10-2, Erasure then the probability P of undetectable error is 1 − p then the probability PU of undetectable error is 00 ==24− p PpU 10 p ? Moreover, 1 1 #1InfoBits 1 − p Rate== R = Binary Erasure Channel (BEC) #2All Bits A Surprise in Communication Theory Shannon’s Theorem 1 −2 Repetition 10 Coding 10−4 Within a large class of coding schemes −6 there exist some schemes – nearly all, 10 Limit Given −8 10 by Shannon’s actually – that give arbitrarily low error − Theorem rates at any information rate up to a 10 10 critical rate C, called channel capacity. 10−12 Prob. Of Msg. Error Msg. Of Prob. Prob. Of Msg. Error Msg. Of Prob. 10−14 ε 1 1 1 1 1 1 Folk Theorem Channel Choose as 3 5 7 9 11 small as “All codes are good, except those we can think of.” Capacity small as Info Bits you like Msg Rate = C All Bits Hamming (8,4) 4 Code Info Words Code Words Types of Codes 0000 0000 0000 • Corrects all single errors 0001 1101 0001 0010 0111 0010 • A block code is a code that uses sequences • Detects all single, double, 0011 1010 0011 of n channel symbols, or n-tuples. and triple errors 0100 1011 0100 0101 0110 0101 Rate R = 1/2 • 0110 1100 0110 Only certain selected n-tuples, called 0111 0001 0111 We will now apply this code code blocks or code words are sent. 1000 1110 1000 code to the BEC with p=10-2 1001 0011 1001 <−≈−88844kk− 1010 1001 1010 Convolutional Codes: PUkC pp(1 )C4 pp (1 ) 1011 0100 1011 • ∑ Each output bit depends on all the previous k −−44 1100 0101 1100 ∴<()()22 − bits. PU 70 10 1 10 1101 1000 1101 1110 0010 1110 − ∴< ×7 1111 1111 1111 PU 6.72 10 2 Decoding Table for a Block Code Terminology Codewords 11000 00110 10011 01101 Code 11001 00111 10010 01100 11010 00100 10001 01111 00 11000 11100 00010 10111 01001 01 00110 10000 01110 11011 00101 10 10011 01000 10110 00011 11101 Received 11110 00000 01011 10101 11 01101 Words 01010 10100 11111 00001 Info Encoding Code Words Procedure Words Convolutional Codes Types of Error Correcting Codes Infinite Infinite Block Codes Input Output • Orthogonal Codes • Linear Codes aann+1210 aaa Convolver bbnn+1210 bbb • Cyclic Codes • BCH Codes Convolutional Codes • Threshold Decoding • Sequential Decoding Block Codes Definitions Def. A code is a set of binary vectors of the same fixed length Non-Linear Parameters of codes Linear n = length of code vectors Cyclic R = code rate = (# info bits)/n PU = Prob. of undetectable error BCH 3 Problem: PU depends on the channel Problem: PU depends on the channel (Cont.) Def. Let u and v be n bit vectors. Def. The Hamming weight H(u) of u is The Hamming distance H(u,v) between the number of 1’s in u. u and v is the number of bits at which they differ. For example, H ()0110= 2 For example, H ()0110, 1011= 3 Please also note that H ()10011, 00011= 1 Huv(), =+ Hu ( v ) Problem: PU depends on the channel (Cont.) A Recurring Theme Def. Let V be a code. Then the minimum distance d(V) is uv≠ Add More Algebra dV()= MinH() uv , | uv, ∈ V Observation: & Gain ≤−++−nd nd−− nn nn PCpUd(1 p ) Cp n (1 p ) • A trade of space for time, i.e., memory So channel independent Code Parameters are: for computation n = length of code vectors • Simplifications R = code rate = (# info bits)/n d = minimum distance Linear Codes Linear Codes GF ()20,1,,=+= { } i Galois field of two elts. + 0 1 i 0 1 Enter stage right 0 0 1 0 0 0 … Addition 1 1 0 1 0 1 nn=={() ∈∀} E GF(2) b12 , b ,… , bni : b GF (2) i We now adjoin addition “+” to the = n-dim vector space over GF(2) code space E n ,,+ i ()()(+=+++ ) bb12, ,…… , bnn b 1 ', b 2 ', , b ' b 1 b 1 ', b 2 b 2 ', … , b nn b ' ()()=∈ a b12,,, b…… bnn ab 1 , ab 2 ,, ab , a GF (2) 4 Linear Codes A Simplification Def. A linear code V is a subspace of E, i.e., V is linear iff uv, ∈ V⇒ u+∈ v V Min. Dist. = Min. Non-Zero Wt. Parameters of linear codes: NOTE: R=k/n uv, ∈ V n = length of code vectors dV()= MinHuv (,): ≠ k = dim(V) = log2(#V) = # Info. Bits uv d = d(V) = minimum distance uV∈ = Min H(): u u ≠ 0 V is said to be a linear (n,k) d code Length Dim Min. Dist. Error Model An example of the Error Model Error Error Vector Vector ε = 000010 ε Sent Received Vector Vector Sent Received Vector Vector v =001110 rv=+ε v rv=+ε =001100 000010 = ε + 001110 = v 001100 = r An Example: The Hamming (7,4) 3 Code The Hamming (7,4) 3 Code (Cont.) Infoword Codeword ()(bbbb,,, bbbbbbb ,,,,,, ) 1011000 3210 6543210 Infoword Codeword bbbb=++ 1110100 6023=++ ()bbbb,,,= ( bbbbbbb ,,,,,, ) where bbbb5012 3210 6543210 bbbb=++ 0110010 4123 Infoword Codeword Infoword Codeword 1110001 0000 000 0000 1000 110 1000 0001 101 0001 A 1001 011 1001 0010 111 0010 1010 001 1010 Generator Matrix G 0011 010 0011 Linear 1011 100 1011 74 0100 011 0100 Code 1100 101 1100 VvEuEstuGv=∈{ :.. ∃∈ =} 0101 110 0101 1101 000 1101 0110 100 0110 1110 010 1110 0111 001 0111 1111 111 1111 The rows of G span the linear code V. 5 The Hamming (7,4) 3 Code (Cont.) Linear Codes T Codeword 1001101 • The rows of the generator matrix G span ()bbbbbbb,,,,,, 0100111=() 0,0,0 the code V. 6543210 0011110 The columns of the parity check matrix H • The columns of the parity⊥ check matrix H span the dual code V . Parity Check Matrix HT VvEvH=∈{ 7 :0T =} ⊥ The rows of HT span the linear code V . Linear Codes Linear Codes Def. Let V be a linear code in En. Then Observation: vV∈⇔ vHT =0 the dual code V⊥ of V is Hence, ()veHvHeHeH+=+=TTTT VvEvuuV⊥ =∈{ n :0,i =∀∈} where Def. Let r be a received vector. Then vui = vu T ∑ ii rHi i is called the syndrome of r . The syndrome depends only on the error pattern e. Maximum Likelihood Decoding Maximum Likelihood Decoding Coset Leaders Decoding Error Patterns Code Table Most Probable Error Pattern for Given Syndrome 000000 001110 010101 100011 011011 101101 110110 11100 000001 001111 010100 100010 011010 101100 110111 111001 Error Syndrome 000010 001100 010111 100001 011001 101111 110100 111010 000000 000 000100 001010 010001 100111 011111 101001 110010 111100 000001 001 001000 000110 011101 101011 010011 100101 111110 110000 Error/Syndrome 000010 010 010000 011110 000101 110011 001011 111101 100110 101000 Table 000100 100 100000 101110 110101 000011 111011 001101 010110 011000 001000 110 001001 000111 011100 101010 010010 100100 111111 110001 010000 101 100000 011 Standard Array for a Linear (6,3) 3 Code 001001 111 6 A Recurring Theme Cyclic Codes Add More Algebra Enter stage right & Gain … Multiplication • • A trade of space for time, i.e., memory We now adjoin Multiplication “ ” for computation to the code space • Simplifications Cyclic Codes: Preliminaries Cyclic Codes: Preliminaries Each n-bit binary number can be considered to be a polynomial with coefficients over GF(2) . 23 1011 1 ++x x + 1101 ++1 x +x3 10101011=+++++++ 1iiiiiiiix01234567 0xxxxxxx 1 0 1 0 1 1 0110 00++xx2 + =++++1 x2467xxx Addition Cyclic Codes: Preliminaries Cyclic Codes: Preliminaries 101 2 1 + x Problem: Multiplication of code vectors × 011 ×+xx2 (thought of as polynomials) may increase 101 code vector length.