Presentation is loading. Please wait.

Presentation is loading. Please wait.

Codes Codes are used for the following purposes: - to detect errors - to correct errors after detection Error Control Coding © Erhan A. Ince Types: -Linear.

Similar presentations


Presentation on theme: "Codes Codes are used for the following purposes: - to detect errors - to correct errors after detection Error Control Coding © Erhan A. Ince Types: -Linear."— Presentation transcript:

1 Codes Codes are used for the following purposes: - to detect errors - to correct errors after detection Error Control Coding © Erhan A. Ince Types: -Linear Block Codes -Cyclic Codes -Convolutional Codes -BCH Codes -Reed Solomone (RS) codes

2 Block Error Control Codes A block error control code C consists of a set of M code words { c 0,c 1,c 2,……,c M-1 ). Each code word is of the form c = (c 0,c 1,…….,c n-1 ). If the values are taken from the Galois field GF(q) then the code is said to be q-ary Error Control Coding © Erhan A. Ince

3 Uncoded Data Stream Encoding Process 1.Breaking up the data stream into blocks 2.Mapping these blocks onto code words in C Error Control Coding © Erhan A. Ince Block Encoder Coded Data Stream k-symbol block n-symbol block

4 Encoding process… If M = q k then the encoder breaks the data stream into k- symbol blocks. If M is not in the above form the encoder must work on messages of varying length. Message Blocks Code Words (000) (00000000000) (001) (10100011101) (010) (11010001110) (011) (100) (101) (1100) (1101) (11100) (11101) (11110) (10001110110) (11111) (01000111011) Error Control Coding © Erhan A. Ince Ex: Binary Hadmard Code A 12 Consists of 12 code words of length 11. The information Blocks must be of varying length

5 Error Control Coding © Erhan A. Ince Since # of valid code words < # of possible n-symbol blocks redundancy = r = n – log q M There are (q n -M) n-symbol patterns which are not associated with data blocks and thus are not valid code words. The code C is said to contain redundancy. If M = q k, then r simplifies to the difference r = ( n - k )

6 Rate of a Block Code If M represents the number of code words each of length n in a code C  The rate of C is :  For M =q k then Error Control Coding © Erhan A. Ince

7 If the received word is found to be invalid, then receiver assumes that channel has caused multiple symbol errors. The determination of whether errors are present is ERROR DETECTION An error pattern is undetectable if it causes the received word to be a valid code other than the one transmitted. Given a transmitted code word c there are (M-1) code words other than c hence (M-1) undetectable error patterns. Error Control Coding © Erhan A. Ince c =(c 0,c 1,…..c n-1 ) Transmitted Codeword e =(e 0,e 1,…..e n-1 ) Error pattern r =(r 0,r 1,…..r n-1 ) Received Codeword Comm Channel

8 The decoder may react in a number of ways Error Control Coding © Erhan A. Ince Request a retransmission of the word (ARQ) (automatic repeat request) Tag the word as being incorrect and pass it along the datasink(muting ) Attempt to correct the errors in the received word Final option is referred to as : FORWARD ERROR CORRECTION (FEC)

9 Code Weight The weight of a code word or error pattern is the number of nonzero coordinates in the code word or error pattern. Weight of a codeword is generally shown as w(c) Example: w(1,0,0,1,1,0,1,1,1,1) = 7 w(  3,  29,0,0,1,  6,0) = 4 Error Control Coding © Erhan A. Ince

10 Distance between codes Assume we have a pair of n-symbol blocks: v = (v 0,v 1,……, v n-1 ) w=(w 0,w 1,……,w n-1 ) We can discuss the distance, d( v, w ), between these two blocks in a number of ways: If we talk about Euclidean distance Euclidean distance is used extensively in the analysis of convolutional and trellis codes Error Control Coding © Erhan A. Ince

11 Distance of codes … With block codes we talk more of the time about Hamming Distance. This is the number of coordinates in which the two blocks differ: Error Control Coding © Erhan A. Ince

12 Minimum Distance The minimum distance of a block code C is the minimum Hamming distance between all distinct pairs of code words in C. This minimum distance is denoted as d min. A transmitted codeword is guaranteed to differ in at least d min coordinates from any other code word. For an error pattern to be undetectable it must change the symbol values in the transmitted code word in at least d min coordinates.  A code with minimum distance d min can detect all error patterns of weight less than or equal to (d min –1) Error Control Coding © Erhan A. Ince

13 In FEC systems goal is to minimize the probability of decoder error given a received word r. The maximum a posteriori decoder identifies the code word c i that maximize : p(c=c i | r) p(c| r) is the probability that code word c is transmitted on receipt of code word r. The maximum likelihood decoder (ML) identifies the code word c i that maximizes: p(r| c=c i ). p(c|r) Two expressions can be related by Baye’s rule Error Control Coding © Erhan A. Ince

14 The conditional probability p(r|c) is equal to the probability of occurrence of the error pattern e= (r - c) given that c has been transmitted since lower-weight error patterns are more likely to occur than the higher weight ones  The codeword c i that maximizes p(r|c i ) is the codeword that minimize the d(r,c i )=w(r-c) The maximum likelihood transmitted codeword is thus the code word that is closest in Hamming distance to the received word r. Error Control Coding © Erhan A. Ince

15 A decoder error occurs when the received word is closer to an incorrect code word than to the correct code word. By definition incorrect code words are at least d min away from the transmitted code word Therefore decoder errors are possible only if the weight of the error pattern induced by the channel is greater than or equal to d min /2  A code with minimum distance d min can correct all error patterns of weight less than or equal to (d min –1) /2 Error Control Coding © Erhan A. Ince

16 Error Control Coding © Erhan A. Ince  Consider a block code U  consisting of n-tuples {V 1,V 2,……V n-1 }of symbols from FG(q). U is a q-ary linear code if and only if U forms a vector subspace over GF(q) FG(q) is a Galois Field DEFINITION

17 Linear Block Codes - are a class of parity check codes that can be characterized by the (n,k) notation - The encoder transforms a block of k message digits into a longer block code of n codeword digits (a code vector) - If the alphabet consists of two elements (0 and 1) the code is a binary code - k-bit messages form 2 k distinct message sequences referred to as the k-tuples. - the n-bit blocks can form as many as 2 n distinct sequences known as n-tuples. Error Control Coding © Erhan A. Ince

18  The encoding process assigns to each of the 2 k message k-tuples one of the 2 n n-tuples.  The mapping is accomplished by a look-up table. For linear codes the mapping transformation is of course linear VECTOR SPACES The set of all binary n-tuples, V n, is called a vector space over the binary field of two elements (0 and 1). A binary field has two operations, addition and multiplication such that the results of all operations are in the same set of two elements. The arithmetic operations of addition and multiplication are defined by the conventions of the algebraic field. Error Control Coding © Erhan A. Ince

19  In a binary field the rules are: Error Control Coding © Erhan A. Ince 0 1 0101 1 0 0 1 0101 0 0 1 VECTOR SUBSPACES A subset S of the vector space V n is called the subspace if the following two conditions are satisfied: 1.The all-zero vector is in S 2.The sum of any two vectors in S is also in S (known as closure property)

20 Error Control Coding © Erhan A. Ince 2 k n-tuples Constitude subspace of code words 2 n n-tuples Entire space V n

21 Linear Code  If V i and V j are two code words in an (n,k) binary block code the code is said to be linear only if (V i  V j ) is also a code vector.  Vectors outside the subspace can not be created by the addition of legitimate code vectors (members of the subspace) Example : vector space V 4 is populated by the following 2 4 4-tuples 00000001001000110100010101100111 10001001101010111100110111101111 Error Control Coding © Erhan A. Ince

22 Example ofa subset of V 4 is : 0000010110101111 00001010 01011111 01010101 A set of 2 k n-tuples is called a linear block code if and only if it is a subspace of the vector space V n of all n-tuples. Error Control Coding © Erhan A. Ince

23 Example: Assume that we have a (6,3) code  There are 2 k = 2 3 = 8 message vectors  there are 2 n = 2 6 = 64 6-tuples in the V 6 vector space message vectorcode vector 000 000000 100 110100 010 011010 110 101110 001 101001 101 011101 011 110011 111 000111 It is easy to check that the eight code vectors form a subspace of V 6 (all-zeros vector is present and the sum of any two code words yields an other one which is a member of the subspace. Error Control Coding © Erhan A. Ince

24 Generator Matrix  If for an (n,k) code k is large a table look-up implementation is not feasible. i.e for (127,92) code there are 2 92 or approximately 5x20 27 code vectors. Table-lookup brings the need for a large amount of memory  Fortunately it is possible to only generate code vectors as they are required.  Since a set of code vectors that form a linear block code is a k-dimensional subspace of the n-dimensional binary vector space (k<n), it is always possible to find a set of n-tuples, fewer than 2 k, that can generate all the 2 k vectors in the subspace. The generating set of vectors is said to span the subspace. Error Control Coding © Erhan A. Ince

25  Smallest linearly independent set that spans the subspace is called a basis of the subspace.  number of vectors in this basis set is the dimension of the subspace.  Any basis set of the k linearly independent n-tuples V 1, V 2, ….., V k can be used to generate the required linear block code vectors since each code word is a linear combination of V 1, V 2, ….., V k That is each of the set of 2 k code vectors U can be described as: U = m 1 V 1 + m 2 V 2 + ………+ m k V k where mi = ( 0 or 1) and i= 1,……,k Error Control Coding © Erhan A. Ince

26 Generator matrix….  In general we can define a generator matrix as a (k  n) array: The message m is shown as a row vector with (1  k) dimensions : The generation of the code vector U is denoted as: U =mG Error Control Coding © Erhan A. Ince

27 Ex: Assume a generator matrix as below: Where V 1,V 2 and V 3 are the three linearly independent vectors ( a subset of the eight code vectors ) that can generate all code vectors. Assuming message vector is ( 1 1 0) we can use G to generate the code vector for this message: = 1 1 0 1 0 0 + 0 1 1 0 1 0 + 0 0 0 0 0 0 = 1 0 1 1 1 0 ( code vector for message 110) * Linear combination of the rows of G Error Control Coding © Erhan A. Ince


Download ppt "Codes Codes are used for the following purposes: - to detect errors - to correct errors after detection Error Control Coding © Erhan A. Ince Types: -Linear."

Similar presentations


Ads by Google