Linear code

from Wikipedia, the free encyclopedia

In coding theory, a linear code is a special block code in which the code words are elements of a finite-dimensional vector space over a finite field . A code is linear if and only if it is a subspace of .

Linear codes have the advantage that methods of linear algebra can be used. They are therefore easy to encode and decode. Most of the important codes are linear: Hamming code , low density parity check code , Reed-Muller code , Hadamard code , all cyclic codes (including BCH , Reed-Solomon codes , Golay codes and Goppa Codes ).

Is the vector space dimension of the linear code is equal , it is called a code or a Hamming distance of even code .

properties

Since is a subspace of , there is a basis of . If you summarize this basis in a matrix

together, a producer matrix is ​​obtained . The code also has a control matrix . It applies to them if and only if is a code word. The rank of is , which is of . The Hamming distance of is the minimum number of linearly dependent columns in the control matrix.

The Hamming weight of a code word is equal to the number of those that are different from zero. For example, the code word has a Hamming weight of 4. The Hamming distance of the code is equal to the smallest Hamming weight of all code words except for the zero word.

If the individual coordinates of the code words are permuted, a so-called equivalent code is obtained . With this and by means of linear algebra , one can find an equivalent for every linear code, which has a generator matrix of the form . Where is the - identity matrix , and is a - matrix. Then it is called producer matrix in a reduced form. The first coordinates can be interpreted as information symbols and the last as control symbols. Is a generator matrix in reduced form, a control matrix can be found immediately . A linear code is already determined by its generator matrix or its control matrix.

example

The binary - Hamming code has the following generator matrix in reduced form and the associated control matrix:

   
   

Coding

A word from space is encoded by forming the product . The encoding of the word with the - Hamming code illustrated example, the following statement.

Since the addition takes place in here, the following applies

Decoding

With the decoding associating is called a received, possibly faulty input vector  to a code vector  . The decoding is not the reverse function of the coding, which assigns a vector to a code vector .

As a decoding method which is in the coding theory most maximum-likelihood (English: maximum likelihood decoding ) is used. A received vector is decoded into the code vector which is most likely identical to the code  vector  actually sent  . Often the vector in which the fewest places (errors) need to be corrected is assumed to be the most likely. In mathematical terms, this means looking for the code  vector with the smallest Hamming distance to the vector received  . This case is also a method of nearest neighbors (English: nearest neighbor decoding ), respectively. By knowing the type of data being sent or the channel being used, other information may be used to determine the likelihood of certain code vectors.

Let it be the actually sent (code) vector and the received vector. The decoding searches for the code vector or vectors that were most likely sent from all code vectors .

With the nearest neighbor decoding :

It should be noted that this assignment is not unique for most codes for all error vectors. There are then some error vectors that cannot be assigned because they have more than one nearest neighbor. If a unique decoding is possible for each error vector, the code is called perfect .

Syndrome decoding

A more efficient method for decoding is so-called syndrome decoding . The syndrome of a vector is obtained by multiplying the control matrix  with .

Let it be the error vector of . In are exactly the coordinates not equal to zero, for which errors occurred during the transfer.

Because of the linearity of the code, the following applies to the syndrome of :

Since the syndrome of error-free code vectors is always zero, it follows:

All (incorrect) words with the same error vector are in the same affine subspace , i.e. the syndrome is constant for such words .

All vectors that have emerged from any fixed vector by subtracting any code vector form a subsidiary class of the subgroup of . The vector with minimal weight in this class is called the leader of the secondary class (English: coset leader ). This is why the term “coset leader decoding” is widely used.

In order to decode, one looks for the error vector  whose syndrome is identical to the syndrome of and whose Hamming weight is minimal. This error vector is used to calculate the closest code  vector . You can therefore set up a table with up to rows that contains the corresponding error vector with minimal Hamming weight for each syndrome of a received vector. If the syndrome is 0, then nothing needs to be corrected, otherwise decoding is limited to looking up the error vector in this table and correcting the errors detected in this way.

Interpreted differently, the secondary classes are precisely the equivalence classes of the equivalence relation. The leaders are representatives of the equivalence classes, one chooses one with a minimal Hamming weight. Perfect codes are characterized by the fact that the leaders are clearly established.

The decoding of linear codes is generally NP-complete , i.e. no algorithms with a polynomial running time are known. The known linear codes, for example Hamming codes, are distinguished by the fact that efficient decoding algorithms are known for them. The complexity of linear decoding is the basis for the McEliece cryptosystem , which is considered secure, but has so far rarely been used due to its comparatively long keys.

example

Will you to decode Hamming code (from above), we come out the assumption that only - Bit errors occur. The possible error vectors are then

The syndrome is now calculated for each of these error vectors . This results in

If the incorrect word is then received, then results . This results in the error vector and is thus decoded. The plaintext word is then .

Example with incomplete decoding

The ternary ( ) repetition code of length 3 is given:

   

Every two columns of are linearly independent, whereas all three are linearly dependent. The minimum Hamming distance of the code is calculated as the minimum number of linearly dependent columns in 3. This means that at most one character error can be corrected. The syndrome table looks like this:

By using linearities, the number of rows could be halved, but then you have to test whether there is a linearly dependent syndrome in the table.

Now consider , . When the syndrome is , the correction is: . The calculation of the syndrome of results: . This value is not in the syndrome table, so the word cannot be corrected.

application

The coding and decoding, as described above, is relatively complex. During the coding, the generator matrix must be kept in memory, which is problematic in systems with limited resources (for example mobile devices or space probes). A large table is required for decoding, depending on the correction rate; the memory consumption is correspondingly large. For this reason, additional properties of the codes are usually used in order to encode and decode them efficiently. Binary cyclic codes can be implemented very easily using shift registers and exclusive-or gates , for example .

Dual code

For every (linear) code there is a dual code (or also dual code) , which is itself a linear code. The code words of the dual code are all words that are dual to the code words :

An inner product is defined for this:

which maps the vectors as follows:

Despite the similar definition, this is not a scalar product because this bilinear form is not positive definite . Because of the properties of finite fields there are mostly vectors that are not equal to the zero vector and for which the inner product is 0. Think of the binary vector, for example .

With the help of this definition, the dual code results as:

A generator matrix of the dual code is a control matrix of the source code and vice versa.

The dual code plays an important role in analyzing the properties of codes.

The so-called self-dual codes are a special case. These are codes that are identical to their dual code. For dimensional reasons, these always have the dimension . The most important example of a self-dual code is the extended Hamming code, in which the binary [7,4,3] Hamming code is extended by one parity bit to even parity:

literature

Individual evidence

  1. ^ ER Berlekamp, ​​RJ McEliece, HCA von Tilburg: On the inherent intractability of certain coding problems . In: IEEE Transactions on Information Theory 24 . 1978.