Block Codes Redundancy Code Rate Transmission Errors
Total Page:16
File Type:pdf, Size:1020Kb
S-72.3410 Linear Codes (1) 1 S-72.3410 Linear Codes (1) 3 ' $ ' $ Block Codes Code Rate block code AcodeC that consists of words of the form (c0;c1;:::;cn−1), where n is the number of coordinates (and is The redundancy is frequently expressed in terms of the code rate. said to be the length of the code). The code rate R of a code C of size M and length n is q-ary code A code whose coordinate values are taken from a set logq M (alphabet) of size q (unless otherwise stated, GF(q)). R = : n encoding Breaking the data stream into blocks, and mapping these blocks onto codewords in C. Again, if M = qk, R = k=n. The encoding process is depicted in [Wic, Fig. 4-1]. & % & % c Patric Osterg˚¨ ard c Patric Osterg˚¨ ard S-72.3410 Linear Codes (1) 2 S-72.3410 Linear Codes (1) 4 ' $ ' $ Transmission Errors Redundancy The corruption of a codeword by channel noise, modeled as an If the data blocks of a q-ary code are of length k, then there are additive process, is shown in [Wic, Fig. 4-2]. M = qk possible data vectors. (But all data blocks are not error detection Determination (by the error control decoder) necessarily of the same length.) whether errors are present in a received word. There are qn possible words of length n,outofwhichqn − M are undetectable error An error pattern that causes the received not valid codewords. The redundancy r of a code is word to be a valid word other than the transmitted word. error correction Determine which of the valid codewords is most r = n − logq M; likely to have been sent. k which simplifies to r = n − k if M = q . decoder error In error correction, selecting a codeword other than that which was transmitted. & % & % c Patric Osterg˚¨ ard c Patric Osterg˚¨ ard S-72.3410 Linear Codes (1) 5 S-72.3410 Linear Codes (1) 7 ' $ ' $ Error Control Weight and Distance (2) The decoder may react to a detected error with one of the following The Hamming distance between two words, three responses: v =(v0;v1;:::;vn−1)andw =(w0;w1;:::;wn−1), is the number of automatic repeat request (ARQ) Request a retransmission of coordinates in which they differ, that is, the word. For applications where data reliability is of great importance. dH (v; w)=|{i | vi =6 wi; 0 ≤ i ≤ n − 1}|; muting Tag the word as being incorrect and pass it along. For applications in which delay constraints do not allow for where the subscript H is often omitted. Note that w(c)=d(0; c), − retransmission (for example, voice communication). where 0 is the all-zero vector, and d(v; w)=w(v w). forward error correction (FEC) (Attempt to) correct the The minimum distance of a block code C is the minimum errors in the received word. Hamming distance between all pairs of distinct codewords in C. & % & % c Patric Osterg˚¨ ard c Patric Osterg˚¨ ard S-72.3410 Linear Codes (1) 6 S-72.3410 Linear Codes (1) 8 ' $ ' $ Weight and Distance (1) Minimum Distance and Error Detection The (Hamming) weight of a word c, denoted by w(c)(or Let dmin denote the minimum distance of the code in use. For an wH (c)), is the number of nonzero coordinates in c. error pattern to be undetectable, it must change the values in at Example. w((0,α3; 1,α)) = 3, w(0001) = 1. least dmin coordinates. B A code with minimum distance d can detect all error The Euclidean distance between v =(v0;v1;:::;vn−1)and min patternsofweightlessthand . w =(w0;w1;:::;wn−1)is min ≥ p Obviously, a large number of error patterns of weight w dmin can 2 2 2 dE(v; w)= (v0 − w0) +(v1 − w1) + ···+(vn−1 − wn−1) : also be detected. & % & % c Patric Osterg˚¨ ard c Patric Osterg˚¨ ard S-72.3410 Linear Codes (1) 9 S-72.3410 Linear Codes (1) 11 ' $ ' $ Forward Error Correction Decoder Types The goal in FEC systems is to minimize the probability of decoder error given a received word r. If we know exactly the behavior of A complete error-correcting decoder is a decoder that, given a the communication system and channel, we can derive the received word r, selects a codeword c that minimizes d(r; c). probability p(c | r)thatc is transmitted upon receipt of r. Given a received word r,at-error-correcting bounded-distance maximum a posteriori decoder (MAP decoder) Identifies the decoder selects the (unique) codeword c that minimizes d(r; c)iff codeword ci that maximizes p(c = ci | r). d(r; c) ≤ t. Otherwise, a decoder failure is declared. maximum likelihood decoder (ML decoder) Identifies the Question. What is the difference between decoder errors and codeword ci that maximizes p(r | c = ci). decoder failures in a bounded-distance decoder? p c p r|c Bayes's rule p(c | r)= C ( ) ( ) : pR(r) & % & % c Patric Osterg˚¨ ard c Patric Osterg˚¨ ard S-72.3410 Linear Codes (1) 10 S-72.3410 Linear Codes (1) 12 ' $ ' $ Minimum Distance and Error Correction Example: A Binary Repetition Code The two decoders are identical when pC (c)isconstant,thatis, when all codewords occur with the same probability. The The binary repetition code of length 4 is {0000; 1111}. maximum likelihood decoder is assumed in the sequel. Received Selected Received Selected The probability p(r | c) equals the probability of the error pattern 0000 0000 1000 0000 e = r − c. Small-weight error patterns are more likely to occur 0001 0000 1001 0000 or 1111∗ than high-weight ones ⇒ we want to find a codeword that 0010 0000 1010 0000 or 1111∗ ∗ minimizes w(e)=w(r − c). 0011 0000 or 1111 1011 1111 0100 0000 1100 0000 or 1111∗ 0101 0000 or 1111∗ 1101 1111 B A code with minimum distance dmin can correct all error 0110 0000 or 1111∗ 1110 1111 patternsofweightlessthanorequaltob(d − 1)=2c. min 0111 1111 1111 1111 It is sometimes possible to to correct errors with ∗Bounded-distance decoder declares decoder failure. w>b(dmin − 1)=2c. & % & % c Patric Osterg˚¨ ard c Patric Osterg˚¨ ard S-72.3410 Linear Codes (1) 13 S-72.3410 Linear Codes (1) 15 ' $ ' $ Error-Correcting Codes and a Packing Problem The Gilbert Bound A central problem related to the construction of error-correcting Theorem 4-2. There exists a t-error-correcting q-ary code of codes can be formulated in several ways: length n of size qn M ≥ : 1. With a given length n and minimum distance d,anda Vq(n; 2t) given field GF(q), what is the maximum number Aq(n; d) of codewords in such a code? Proof: Repeatedly pick any word c from the space, and after each ≤ 2. What is the minimum redundancy for a t-error-correcting such operation, delete all words w that satisfy d(c; w) 2t from q-ary code of length n ? further consideration. Then the final code will have minimum 3. What is the maximum number of spheres of radius t that distance at least 2t + 1 and will be t-error-correcting. The theorem canbepackedinann-dimensional vector space over GF(q) follows from the fact that at most Vq(n; 2t) words are deleted from ? further consideration in each step. & % & % c Patric Osterg˚¨ ard c Patric Osterg˚¨ ard S-72.3410 Linear Codes (1) 14 S-72.3410 Linear Codes (1) 16 ' $ ' $ The Hamming Bound Comparing Bounds The number of words in a sphere of radius t in an n-dimensional vector space over GF(q)is 0 1 Theorems 4-1 and 4-2 say that for the redundancy r of a code, Xt @ n A i Vq(n; t)= (q − 1) : i=0 i logq Vq(n; t) ≤ r ≤ logq Vq(n; 2t): Theorem 4-1. The size of a t-error-correcting q-ary code of length These bounds for binary 1-error-correcting codes are compared in n is [Wic, Fig. 4-3]. qn M ≤ : Vq(n; t) & % & % c Patric Osterg˚¨ ard c Patric Osterg˚¨ ard S-72.3410 Linear Codes (1) 17 S-72.3410 Linear Codes (1) 19 ' $ ' $ Definitions Perfect Codes With bit error probability p and n bits, there are on average np errors ⇒ ifthecodelengthn is allowed to increase, the minimum A block code is perfect if it satisfies the Hamming bound with distance dmin must increase accordingly. Let identity. d Theorem 4-4. Any nontrivial perfect code over GF(q)musthave δ = min ; n the same length and cardinality as a Hamming, Golay, or repetition logq Aq(n; bδnc) code. a(δ) = lim sup ; n→∞ n Note: The sphere packing problem and the error control problem are not entirely equivalent. where a(δ) is the maximum possible code rate that a code can have if it is to maintain a minimum distance/length ratio δ as its length increases without bound. & % & % c Patric Osterg˚¨ ard c Patric Osterg˚¨ ard S-72.3410 Linear Codes (1) 18 S-72.3410 Linear Codes (1) 20 ' $ ' $ List of Perfect Codes Some Bounds 1. (q; n; k = n; t =0); (q; n; k =0;t= n): trivial codes. The entropy function: 2. (q =2;n odd;k =1;t=(n − 1)=2): odd-length binary Hq(x)=x logq(q − 1) − x logq x − (1 − x)logq(1 − x)for repetition codes (trivial codes). 0 <x≤ (q − 1)=q. 3. (q; n =(qm − 1)=(q − 1);k = n − m; t =1)withm>0and q a prime power: Hamming codes and and nonlinear codes The Gilbert-Varshamov (lower) bound: If 0 ≤ δ ≤ (q − 1)=q,then with the same parameters.