* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download ICTCM2006 - Radford University
Survey
Document related concepts
Rotation matrix wikipedia , lookup
Covariance and contravariance of vectors wikipedia , lookup
Determinant wikipedia , lookup
Matrix (mathematics) wikipedia , lookup
Jordan normal form wikipedia , lookup
Eigenvalues and eigenvectors wikipedia , lookup
Singular-value decomposition wikipedia , lookup
Orthogonal matrix wikipedia , lookup
Perron–Frobenius theorem wikipedia , lookup
Non-negative matrix factorization wikipedia , lookup
Four-vector wikipedia , lookup
Gaussian elimination wikipedia , lookup
Matrix multiplication wikipedia , lookup
Transcript
Elementary Coding Theory Including Hamming and Reed-Solomom Codes with Maple and MATLAB Richard Klima Neil Sigmon Appalachian State University Boone, North Carolina Radford University Radford, Virginia Purpose for Presentation To demonstrate some applications with error correcting codes with MATLAB and Maple Reed-Muller Codes Hamming Codes Reed-Solomon Codes Basic Notation Terminology Coding theory is the study of methods for efficient and accurate transformation from one place to another. A code is a set of codewords representing the messages to be transferred between two parties. An error-correcting code is a code where it is possible to detect and correct errors during the transmission of codewords. Applications Information transmitted by Internet. Wireless communication devices. Compact Discs. Transmission of information from satellites. Reed-Muller Codes Invented by I. Reed and D. Muller in 1954. Can be constructed using matrices. Can correct a multiple number of errors. Was used to perform error correction for the Mariner 9 space probe mission to Mars in 1972. Hadamard Matrices A n n matrix H is a Hadamard matrix if all entries of H are 1 or -1 and HH T nI , where I is the n n identity matrix. A normalized Hadamard matrix is one where the first row and column of H only contain positive ones. The only normalized Hadamard matrices of order one and two are H1 1 1 1 and H 2 1 1 Subsequent normalized Hadamard matrices can be generated using the block matrix formula H n H 2n H n Hn H n Reed-Muller Code Construction Steps Construct a normalized Hadamard matrix of order 4k 8 . Delete the first row and first column of the normalized Hadamard matrix. Change all negative ones to zeros. Call this matrix A. Change all ones to zeros and zeros to ones in the matrix A. Call this matrix B. Attach a column of all ones to the left of the matrix A and a column of all zeros to the left of the matrix B. Call these matrices scriptA and scriptB, respectively. Stack the matrix scriptA on top of scriptB. Add an extra row of all zeros and an extra row of all ones to the bottom of the matrix. The codewords for the code are vectors obtained from the rows for the resulting matrix. Each codeword c is a vector consisting over elements in Z 2 of length 4k. Reed-Muller codes are classified as (4k, 2k) codes, where 4k is the length of each codeword and 2k is the minimum distance between codewords. A Reed-Muller code has 8k codewords. Error Correction for Reed-Muller Codes Reed-Muller codes are designed to correct up to k – 1 errors. Suppose a vector r is received. This vector is compared to all codewords in the code. The vector r will be corrected to the codeword that differs from it in k – 1 or less positions. MATLAB Example We generate the Reed-Muller code that was used for in Mariner 9 space probe used to take pictures of Mars in 1972. The code was constructed using the normalized Hadamard H 32 (k = 8). The code consisted of 64 codewords of length 32 each. The code could correct up to 7 errors. Before being transmitted, each photograph taken was broken down into a collection of pixels. Each pixel was assigned one of 64 levels of grayness, and then encoded into one of the 64 codewords in the code. Hamming Codes First published by Richard Hamming in 1950. Used by the telephone industry and in computer data transfer. Can correct 1 error. Code is perfect, which says every message received with errors is uniquely correctable to a codeword. Hamming Codeword Construction Let W and V Z 2n be vector spaces with k n and let G be a k n matrix over Z 2 of full row rank. Then k Z2 C {v V | v wG for some w W } is a subspace of V of dimension k . The vectors in C form 2 k codewords. The matrix G is called the generator matrix for the code C. The matrix G is formed by finding the nullspace of a matrix H known as the parity check matrix. Hamming codes form a linear [n, k] code, where the codewords have a length of n positions and k is the dimension of the vector space the code forms. In Hamming codes, n 2 1 and m k 2 1 m for some integer m > 1. m The parity check matrix H is a matrix of m size m (2 1) that is formed by placing as its columns the binary expressions of the m integers 1,2, ,2 1 . The generator matrix G will be of size (2m 1 m) (2m 1). If c wG a codeword, then Hc 0 . T MATLAB Example In MATLAB, suppose we demonstrate how to construct a codeword from the vector w = (10111011110). We encode this message using a [15, 11] Hamming code with generator matrix G formed from the nullspace of the rows of the parity check matrix 0 0 H 0 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Error Correction for Hamming Codes Suppose a vector r is transmitted and T received. If Hr 0, then r is a codeword. If not, then the error can be corrected by computing c r ei where ei is a vector containing all zeros except at the i th position. The error position i is determined by using T T the fact that Hr Hei . T Since Hei and T produce the same Hr column, the column number produced by T Hr gives the error position i. MATLAB Example Using a [15, 11] Hamming code, we demonstrate how to correct the following received vector. r = (011100010111110) Reed-Solomon Codes Developed by Irving Reed and Gustave Solomon in 1960. One of the most widely used error correcting code techniques. Ideal at correcting error bursts, where several errors occur close together. Important for the Voyager 2 satellite’s transmission of pictures of the outer planets Uranus and Neptune. Besides satellite communications, Reed Solomon codes are used with wireless communication and with compact disks. Example Pictures taken by Voyager Pictures of Uranus and its rings Example Pictures taken by Voyager Picture of Neptune and one its moons, Triton Codeword Construction in Reed-Solomon Codes The Reed-Solomon code implemented on Voyager 2 was constructed using a finite field F Z 2 [ x] /( p( x)) of 28 256 elements represented by the primitive polynomial p ( x) x8 x 4 x 3 x 2 1 Codewords for Voyager were obtained by taking multiples of the generating polynomial g ( x) ( x a)( x a )( x a ) 2 32 where a is a primitive element use to generate F . A codeword c (x ) is formed by computing the polynomial c ( x ) m( x ) g ( x ) where m(x) is a polynomial with coefficients from the finite field F . Each codeword c (x ) is represented by polynomials of degree less than 28 1 255 . Each codeword is a vector of length 255 with the information transformed in the polynomial’s coefficients. Each polynomial coefficient in the codeword is a polynomial of degree < p( x) 8. Each polynomial coefficient is a unique element from the finite field F . On Voyager, full color images were digitized into binary vectors over Z 2 . The binary vectors can be represented in “blocks” of length 8 as the coefficients of polynomials of degree < p(x) = 8. For example, (10111001) 1 a a a a 2 3 4 7 In binary, the length of each codeword converts to a vector of length of (deg p( x)) (28 1) 2040 Error Correction in Reed-Solomon Codes A codeword c (x ) has the property that i c(a ) 0 for i 1,,32 . This gives a technique for verifying a transmitted message is a codeword. If a transmitted message r(x) is received that is not a codeword, a polynomial e(x) is computed to correct its coefficients by forming r ( x) e( x) c( x) . The Voyager 2 Reed-Solomon code could correct up to 32 / 2 16 polynomial coefficient errors. This translates to a minimum of 121 errors in binary. Finding e(x) involves performing computations involving the Euclidean algorithm and polynomial differentiation. Maple Example Involves user-written procedures bincoeff binword rscoeff rseuclid We demonstrate both the codeword construction and error correction process. References R. E. Klima, N. P. Sigmon, and E. L. Stitzinger, Applications of Abstract Algebra with Maple, CRC Press, Llc, Boca Raton, FL 2000. Stephen B. Wicker and Vijay K Bhargava, editors: Reed-Solomon Codes and their Applications, The Institute of Electrical and Electronics Engineers, Inc., New York, NY 1994.