Communications II Lecture 9: Error Correction Coding. Professor Kin K. Leung EEE and Computing Departments Imperial College London Copyright reserved

Similar documents
Cyclic Redundancy Check Codes

Physical Layer and Coding

Chapter 7. Error Control Coding. 7.1 Historical background. Mikael Olofsson 2005

Lecture 12. Block Diagram

Information redundancy

MATH 433 Applied Algebra Lecture 21: Linear codes (continued). Classification of groups.

EE 229B ERROR CONTROL CODING Spring 2005

MATH3302 Coding Theory Problem Set The following ISBN was received with a smudge. What is the missing digit? x9139 9

16.36 Communication Systems Engineering

3. Coding theory 3.1. Basic concepts

MT5821 Advanced Combinatorics

Hamming Codes 11/17/04

Channel Coding and Interleaving

Cyclic codes: overview

Linear Codes and Syndrome Decoding

Error Correction Review

MATH3302. Coding and Cryptography. Coding Theory

Chapter 3 Linear Block Codes

Optimum Soft Decision Decoding of Linear Block Codes


9 THEORY OF CODES. 9.0 Introduction. 9.1 Noise

Fault Tolerance & Reliability CDA Chapter 2 Cyclic Polynomial Codes

Solutions to problems from Chapter 3

x n k m(x) ) Codewords can be characterized by (and errors detected by): c(x) mod g(x) = 0 c(x)h(x) = 0 mod (x n 1)

A Brief Encounter with Linear Codes

Ma/CS 6b Class 25: Error Correcting Codes 2

MATH32031: Coding Theory Part 15: Summary

exercise in the previous class (1)

MATH Examination for the Module MATH-3152 (May 2009) Coding Theory. Time allowed: 2 hours. S = q

ECE8771 Information Theory & Coding for Digital Communications Villanova University ECE Department Prof. Kevin M. Buckley Lecture Set 2 Block Codes

ELEC 519A Selected Topics in Digital Communications: Information Theory. Hamming Codes and Bounds on Codes

1.6: Solutions 17. Solution to exercise 1.6 (p.13).

Linear Cyclic Codes. Polynomial Word 1 + x + x x 4 + x 5 + x x + x

Objective: To become acquainted with the basic concepts of cyclic codes and some aspects of encoder implementations for them.

B. Cyclic Codes. Primitive polynomials are the generator polynomials of cyclic codes.

Can You Hear Me Now?

Error Detection, Correction and Erasure Codes for Implementation in a Cluster File-system

1. How many errors may be detected (not necessarily corrected) if a code has a Hamming Distance of 6?

And for polynomials with coefficients in F 2 = Z/2 Euclidean algorithm for gcd s Concept of equality mod M(x) Extended Euclid for inverses mod M(x)

MATH 433 Applied Algebra Lecture 22: Review for Exam 2.

MATH 291T CODING THEORY

U Logo Use Guidelines

MATH 291T CODING THEORY

Error Detection & Correction

4F5: Advanced Communications and Coding

2. Polynomials. 19 points. 3/3/3/3/3/4 Clearly indicate your correctly formatted answer: this is what is to be graded. No need to justify!

Modular numbers and Error Correcting Codes. Introduction. Modular Arithmetic.

Outline. EECS Components and Design Techniques for Digital Systems. Lec 18 Error Coding. In the real world. Our beautiful digital world.

Assume that the follow string of bits constitutes one of the segments we which to transmit.

Fully-parallel linear error block coding and decoding a Boolean approach

Solutions of Exam Coding Theory (2MMC30), 23 June (1.a) Consider the 4 4 matrices as words in F 16

Cryptography Lecture 3. Pseudorandom generators LFSRs

G Solution (10 points) Using elementary row operations, we transform the original generator matrix as follows.

Error Detection and Correction: Hamming Code; Reed-Muller Code

Error Correcting Codes Prof. Dr. P. Vijay Kumar Department of Electrical Communication Engineering Indian Institute of Science, Bangalore

Lecture Introduction. 2 Linear codes. CS CTT Current Topics in Theoretical CS Oct 4, 2012

ELEC 405/ELEC 511 Error Control Coding. Hamming Codes and Bounds on Codes

Berlekamp-Massey decoding of RS code

ECEN 604: Channel Coding for Communications

Roll No. :... Invigilator's Signature :.. CS/B.TECH(ECE)/SEM-7/EC-703/ CODING & INFORMATION THEORY. Time Allotted : 3 Hours Full Marks : 70

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Discussion 6A Solution

Lecture B04 : Linear codes and singleton bound

Lecture 4: Linear Codes. Copyright G. Caire 88

channel of communication noise Each codeword has length 2, and all digits are either 0 or 1. Such codes are called Binary Codes.

The BCH Bound. Background. Parity Check Matrix for BCH Code. Minimum Distance of Cyclic Codes

Code design: Computer search

EECS150 - Digital Design Lecture 26 Error Correction Codes, Linear Feedback Shift Registers (LFSRs)

Lecture 3: Error Correcting Codes

ELEC 405/ELEC 511 Error Control Coding and Sequences. Hamming Codes and the Hamming Bound

Mathematics Department

Introduction to Wireless & Mobile Systems. Chapter 4. Channel Coding and Error Control Cengage Learning Engineering. All Rights Reserved.

An Introduction to (Network) Coding Theory

ELEC-E7240 Coding Methods L (5 cr)

Error Correction Methods

Outline. MSRI-UP 2009 Coding Theory Seminar, Week 2. The definition. Link to polynomials

Know the meaning of the basic concepts: ring, field, characteristic of a ring, the ring of polynomials R[x].

Chapter 6. BCH Codes

Error Correction and Trellis Coding

Error Correcting Codes Questions Pool

: Error Correcting Codes. October 2017 Lecture 1

Channel Coding I. Exercises SS 2017

Exercise 1. = P(y a 1)P(a 1 )

Coding Theory: Linear-Error Correcting Codes Anna Dovzhik Math 420: Advanced Linear Algebra Spring 2014

Notes 10: Public-key cryptography

Fault Tolerant Computing CS 530 Information redundancy: Coding theory. Yashwant K. Malaiya Colorado State University

Quasi-cyclic Low Density Parity Check codes with high girth

Math 512 Syllabus Spring 2017, LIU Post

Error-Correcting Codes

1 1 0, g Exercise 1. Generator polynomials of a convolutional code, given in binary form, are g

Chapter 5. Cyclic Codes

Algebraic Codes for Error Control

Channel Coding I. Exercises SS 2017

Information Redundancy: Coding

Theory of Computation

Lecture 14: Hamming and Hadamard Codes

Iterative Encoding of Low-Density Parity-Check Codes

(x 1 +x 2 )(x 1 x 2 )+(x 2 +x 3 )(x 2 x 3 )+(x 3 +x 1 )(x 3 x 1 ).

Generator Matrix. Theorem 6: If the generator polynomial g(x) of C has degree n-k then C is an [n,k]-cyclic code. If g(x) = a 0. a 1 a n k 1.

Orthogonal Arrays & Codes

An Introduction to (Network) Coding Theory

Transcription:

Communications II Lecture 9: Error Correction Coding Professor Kin K. Leung EEE and Computing Departments Imperial College London Copyright reserved

Outline Introduction Linear block codes Decoding Hamming codes Cyclic codes Reference: Chap. 16, Lathi 2

Taxonomy of Coding 3

Block vs. Convolutional Code Block codes Output of n bits depends only on the k input bits Convolutional codes each source bit influences n(l+1) output bits L is the memory length Like a linear filter k = 1, n = 2, L = 2 4

Noise and Errors Noise can corrupt the information that we wish to transmit. Generally corruption of a signal is a bad thing that should be avoided, if possible. Different systems will generally require different levels of protection against errors due to noise. Consequently, a number of different techniques have been developed to detect and correct different types and numbers of errors. 5

Error Probability We can measure the effect of noise in different ways. The most common is to specify an error probability, p. Consider the case of a symmetric binary channel with noise. All examples considered here will be for error probabilities that are symmetric, stationary and statistically independent. 6

Simple Error Checks If the error probability is small and the information is fairly fault tolerant, it is possible to use simple methods to detect if an error has occurred. Repetition Repeating each bit in the message A simple method for checking whether an error has occurred If the two symbols in an adjacent pair are different, it is likely that an error has occurred However, this is not very efficient (efficiency is halved) There is no way to tell if it is the first or second bit in a pair that has been corrupted. Repetition provides a means for error checking, but not for error correction. 7

Simple Error Checks (Cont d) Parity bit Use of a parity bit at the end of the message A parity bit is a single bit that corresponds to the sum of the other message bits (modulo 2) This allows any odd number of errors to be detected, but not even numbers As with repetition, this technique only allows error checking, not error correction It is more efficient than simple repetition. 8

Block Codes It is important to be able to repair (correct) errors An important class of codes that can detect and correct some errors are block codes The first error-correcting block codes were devised by Hamming around the same time as Shannon was working on the foundation of information theory (late 1940 s and early 1950 s) Hamming codes are a particular class of linear block code Block codes Encode a series of symbols from the source, a block, into a longer string: codeword or code block Errors can be detected as the received coded block will not be one of the recognized, valid coded blocks Error correction: To decode and associate a corrupted block to a valid coded block by its proximity (as measured by the Hamming distance ) 9

Binary Fields and Vectors We need to discuss some of the mathematics that will be needed. Fortunately, we have restricted things to binary sources, so the mathematics is relatively simple. The binary alphabet A={0,1} is properly referred to as a Galois field with two elements, denoted GF(2). Addition 0 + 0 = 0, 0 + 1 = 1 + 0 = 1, 1 + 1 = 0 Multiplication 0 1 = 0 0 = 1 0 = 0, 1 1 = 1 This is also referred to as Boolean arithmetic or modulo 2 arithmetic. A message is built up from a number of binary fields, and forms a binary vector, rather than a larger binary number. Hence, 101 5 101={1}{0}{1} 10

Example Calculate the following examples of binary field arithmetic: i. 01001 + 01110 ii. 10010 01110 iii. (1111+0011) 0011 11

Hamming Distance Hamming Weight The Hamming weight of a binary vector, a (written as w H (a)), is the number of non-zero elements that it contains. Hence, 001110011 has a Hamming weight of 5. 000000000 has a Hamming weight of 0. Hamming Distance The Hamming Distance between two binary vectors, a and b, is written d H (a,b), and is equal to the Hamming weight of their (Boolean) sum. d H (a,b)=w H (a+b) Hence, 01110011 and 10001011 have a Hamming distance of d H = w H (01110011+10001011) = w H (11111000) = 5 12

Linear Block Codes A binary linear block code that takes block of k bits of source data and encodes them using n bits, is referred to as a (n, k) binary linear block code. The ratio between the number of source bits and the number of bits used in the code, R=k/n, is referred to as the code rate. From Shannon s channel coding theorem, the code rate must be less than the channel capacity for a code to exist that will have an arbitrarily small chance of error (even if we do not know what that code might be). The most important feature of a linear block code The Boolean sum of any code word must be another code word. This means that the set of code words forms a vector space, within which mathematical operations can be defined and performed. 13

To construct a linear block code we define a matrix, the generator matrix G, that converts blocks of source symbols into longer blocks corresponding to code words. G is a k n matrix (k rows, n columns), that takes a source word or block, u (a binary vector of length k), to a code word, x (a binary vector of length n), x = u G For the code words to be unique, the rows of the generator matrix must be linearly independent. That is, it should not be possible to write any of the rows as linear combinations of any of the other rows. A useful result from linear algebra is that a k n matrix of linearly independent rows can always be written in the form, G =[I k k P k (n k ) ] where I k k is the k k identity matrix, and P k (n k) is a k (n k) matrix of parity bits, called the parity check generator. 14

Systematic Codes The first k bits will be the original source block. Such codes are called systematic codes. Every linear code is equivalent to a systematic code. The same set of codewords. How to obtain the systematic code? By elementary row operations on G. Exchange two rows Add one row to another Any matrix G can be transformed into the systematic form. The row space is not changed. 15

Example Given the generator matrix for a (7,4) linear block code, Calculate the code words for the following source blocks: i. 1010 ii. 1101 iii. 0010 iv. Calculate the Hamming distances between each pair of code words generated in parts (i) to (iii), and compare them to the Hamming distances for the original source blocks. 16

Error Detection To determine the number of errors a particular code can detect and correct, we look at the minimum Hamming distance between any two code words. From linearity the zero vector must be a code word. If we define the minimum distance between any two code words to be, d min =min{d H (a,b), a,b C} = min{d H (0,a+b), a,b C} = min{w H (c), c C, c 0} where C is the set of code words. The number of errors that can be detected is then (d min 1), since d min errors can turn an input code word into a different but valid code word. Less than d min errors will turn an input code word into a vector that is not a valid code word. 17

Error Correction The number t of errors that can be corrected is simply the number of errors that can be detected divided by two and rounded down to the nearest integer, since any output vector with less than this number of errors will nearer to the input code word. 18

Hamming & Gilbert Bounds Given block length k, how many parity bits do I need to add to correct t errors? Treating binary vectors as points on the corners of a n-dimensional hypercube (where (n-k) is the number of additional bits), we can say that the total volume contained is V tot =2 n. There are 2 k valid code vectors, and we associate each of these with an n-dimensional hypersphere of radius t, where none of the hyperspheres are allowed to intersect. Since all of these hyperspheres must lie within the n-dimensional hypercube, we know that where the volume of one hypersphere is, ( n, t) This leads to the Hamming Bound k 2 (, t) n 2 i A more complex argument can be used to set an upper bound on (n-k). This is called the Gilbert Bound r t n t n n! Ci 0 i!( n i)! i 0 r ( n k) log2( ( n, t)) ( n k) log2( ( n,2t)) 19

Parity Check Matrix Coding a block of source data is relatively simple: Multiply the source block vector by the generator matrix. To decode a block coded vector, it is more complicated. If the generator matrix is of the form G =[I k k P k (n k ) ] To check for errors, we define a new matrix, the parity check matrix, H. The parity check matrix is a (n-k) n matrix that is defined so that It will produce a zero vector when no error in the received code vector x, x H T = 0 where H T is the transpose of H. To satisfy this condition, it is sufficient to write the parity check matrix in the form H =[(P k (n-k) ) T I (n k ) (n k ) ] The minimum Hamming distance is equal to the smallest number of columns of H that are linearly dependent. 20

Syndromes If the received coded block y does contain errors, then the product of the received block with the transpose of the parity check matrix will not be zero, y H T 0 writing y=x+e which is the sum of the original coded block x and the error e, we find that y H T = e H T This value is referred to as the syndrome, s = y H T = e H T The syndrome is a function of the error only, and contains the information required to isolate the position (or positions) of the error (or errors). s is an (n-k) row vector, taking 2 (n-k) -1 possible values (the zero vector corresponding to no error). This means that it is necessary to calculate and store 2 (n-k) -1 syndromes as a look-up table to be able to pin-point the positions of the errors exactly. Problem: this is impractical for large values of (n k). 21

Example Given a generator matrix, i. Calculate the associated parity check matrix, H. ii. Determine the minimum Hamming distance. iii. Calculate a syndrome table for a single bit error. iv. If the code vectors 1000001 and 1001100 are received, determine the most likely source blocks. 22

Hamming Codes Hamming codes are a class of linear block codes that can correct a single error. They are perfect codes, in that they require a minimum number of additional parity bits. That is, they meet the lower limit set by the Hamming bound, r = log 2 (n+1) From this expression, it is easy to see that the smallest Hamming codes correspond to (n, k) = (7,4), (15,11), (31,26), The fact that they are perfect codes does not mean that they are necessarily the best codes to use, but they do have the additional advantage that they are easy to construct and are simple to use. For all Hamming codes, d min = 3. All (correctable) error vectors have unit Hamming weight, and the syndrome associated with an error in the i th column of the vector is the i th row of H T. Columns of H are binary representations of 1,, n. 23

For the (7,4) Hamming code, the corresponding syndrome table is: H T 0 1 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 0 0 0 1 When a coded vector is received, the syndrome is calculated and any single error identified, and corrected by exchanging the relevant bit with the other binary value However, problems can occur if there is more than one error. s eh T 24

When Decoding of Hamming Code Fails The implicit assumption is that there is a one-to-one correspondence between the errors and the syndromes. However, this is only actually the case when the number of possible errors is less than or equal to the number of correctable errors. When this is not the case, we must use a mechanism to decide which valid code word was transmitted. This requires an algorithm to determine the output, usually based on the most likely error (minimum Hamming distance). A Hamming code has a minimum Hamming distance of 3, so we would expect it to be able to detect 2 errors and correct one. We have already seen that it can correct one error, but what about detecting two errors? The most likely error will be a single bit error in the wrong part of the code word. The syndrome has indeed detected an error, but it has associated it wrongly to a single error, and is likely to correct it by fixing the wrongly identified bit. 25

Cyclic Codes Cyclic codes are a subclass of linear block codes. Whereas the principal property of the simple linear block code is that the sum of any two code words is also a code word (leading to the fact that the rows of the generator matrix are linearly independent), the cyclic codes have an additional property: a cyclic shift of any code word is also a code word. A cyclic shift of a binary vector is defined by taking a vector of length n, a = [a 0, a 1,, a n-1 ] and rearranging the elements, a = [a n-1, a 0, a 1,, a n-2 ] so that the ordering is preserved when the ends are identified. A code is cyclic if: (c 0, c 1,, c n-1 ) C (c n-1, c 0,, c n-2 ) C 26

Generator Matrices A cyclic code is still a linear block code, so all of the properties previously discussed hold for cyclic codes. They are constructed by defining a generator matrix, and an associated parity check matrix and are decoded using syndromes in exactly the same way as the other linear block codes that we have discussed. A generator matrix is defined in the same way as before, except that the rows are now cyclic shifts of one n-dimensional basis vector. 27

Polynomial Representation The main distinction between cyclic codes and other linear block codes is the cyclic property, and this leads to a very useful property of cyclic codes: they can be represented simply (mathematically and in hardware) by polynomial operations. We start by looking at the code word x generated by a source block u, x = u G = [x 0, x 1,, x n-1 ] With the generator matrix in the cyclic (non-systematic) form given in the previous slide, the elements of the code words are, x 0 = u 0 g 0 x 1 = u 0 g 1 + u 1 g 0 x n-1 = u k-1 g n-k These elements take the general form, x l k 1 i 0 u i g l i 28

Taking a binary vector x, it is possible to represent this as a polynomial in z, x = [ x 0, x 1,, x n 1 ] x (z) = x 0 z n 1 + x 1 z n 2 + + x n 1 where the position of the binary bit is replaced by a polynomial of some arbitrary variable z, and the coefficients are elements of a binary field (i.e. they only take the values 0 and 1). Representing the original code word and the n-dimensional basis vector for the cyclic code as polynomials, u =[u 0, u 1,, u k 1 ] u (z) =u 0 z k 1 + u 1 z k 2 + +u k 1 g = [g 0, g 1,, g n k,0,,0] g (z) =g 0 z n k + g 1 z n k 1 + + g n k We notice that the product of these two polynomials is exactly the same as the polynomial representation of the corresponding code vector. Nonsystematic Encoding: x(z) = u(z) g(z) This means that the problem of matrix multiplication can be reduced to a problem of polynomial multiplication. 29

The main advantage is that it simplifies the cyclic shift operation, and thereby simplifies the hardware implementation of the code considerably. Multiplication of the code word by z shifts all of the coefficients along by one, and replacing the term (x 0 z n ) by a term (x 0 z 0 ), gives a cyclic shift. A simpler way to achieve the same result is to multiply the polynomial by z, divide by z n -1, and take the remainder term, which can be written as (z x(z)) mod(z n 1) 30

Parity Check Polynomials One property important to cyclic codes is the ability to factorise polynomials. a(z) = b(z) c(z) Given a polynomial of the form a(z) = z n 1 = z n +1 (n > 1) it is always possible to find two polynomials, such that, z n +1 = g(z) h(z) Taking g(z) to be a generator polynomial, this condition is sufficient for a resultant code to be an (n,k) cyclic code, where: g(z) is a polynomial of degree n k = r. h(z) is a polynomial of degree k. The other factor, the polynomial h(z), turns out to be a parity check polynomial, playing the same role as the parity check matrix. If we have a valid code word, x(z), the product of the code word with h(z) is zero (modulo zn+1), and if we have a code word contained an error, (y(z)h(z))mod(z n +1) = [(x(z)+e(z))h(z)]mod(z n +1) = [e(z)h(z)]mod(z n +1) which is called the syndrome polynomial, s(z). 31

Non-Systematic Encoding/Decoding Encoding: x(z)=u(z)g(z); Parity check polynomial: h(z) =[z n +1] /g(z) Decoding: (y(z) is the received vector) Calculate the syndrome polynomial: s(z)=(y(z)h(z))mod(z n +1) Look up the syndrome table to get e(z) from s(z); x(z)=y(z)+e(z); u(z)=x(z)/g(z); 32

Hardware Implementations Binary polynomial multiplication: multiply-by-g(z) g(z)=g 0 +g 1 z+g 2 z 2 +g 3 z 3, g 0 =g 3 =1; Binary polynomial division: divide-by-g(z) g(z)=g 0 +g 1 z+g 2 z 2 +g 3 z 3, g 0 =g 3 =1; 33

Systematic Encoding As with the previous matrix representation of block codes, coding a source block is simply a case of multiplication by a generator. Decoding is a case of multiplication by a parity check operator, and calculation of a syndrome, followed by identification and correction of possible errors. The source block can be obtained in two ways, either division of the (corrected) code word by the generator polynomial, or by using a systematic form for the generator polynomial. G =[I k k P k (n k ) ] Systematic Encoding: x(z)=z n k u(z)+d (z) where d(z) is a remainder term, d (z)=[z n k u(z)]mod(g(z)) 34

Systematic Decoding Taking a valid code word polynomial to be in this form, and finding the remainder modulo g(z), we get zero (the zero syndrome polynomial), [x(z)]mod(g(z)) = [z n k u(z) + d (z)]mod(g(z)) = d (z)+d (z)=0 This represents an alternative form of syndrome checking for systematic codes. s(z)=[y(z)]mod(g(z)) Decoding procedure: Get s(z): s(z)=[y(z)] mod [g(z)]; From the syndrome table, get e(z); x(z)=y(z)+e(z); Pick up the last k bits in x to get u. 35

Example A (7,4) cyclic code has a generator polynomial, g(z)=1+z + z 3 i. Find the parity check polynomial associated with this generator polynomial. ii. Calculate the syndrome table for single bit errors for a systematic code associated with this generator polynomial. iii. Decode the following polynomials using the syndrome table: y 1 (z)=1+z + z 3 + z 6 y 2 (z)=1+z 2 + z 3 + z 6 36