Upload
others
View
16
Download
0
Embed Size (px)
Citation preview
ELEC 6131: Error Detecting and Correcting Codes Lecture 4: Linear Block Codes
Linear block codes:
In a digital communication system, the sequence of bits to be transmitted are arranged as blocks of ๐๐ bits. So, there are 2๐๐ possible ๐๐-tuples to be transmitted. In a block code, the encoder assigns ๐๐ bits to each ๐๐-tuple where ๐๐ > ๐๐. For a block code to be useful we require that all of 2๐๐, ๐๐-tuples (called codewords) be distinct. That is there should be a 1-to-1 correspondence between the input ๐ข๐ข and the output ๐ฃ๐ฃ of the encoder.
Unless the codewords are structured according to a certain structure, the encoding (and obviously decoding) will be prohibitively complex. That is why we are interested in linear block codes. A code is linear if a linear combination of any two of its codewords is a codeword, or equivalently:
Definition: a block code of length ๐๐ and 2๐๐ codewords is an (๐๐, ๐๐) linear code if and only if its 2๐๐ codewords form the ๐๐-dimensional subspace of the vector space of ๐๐-tuples over ๐บ๐บ๐บ๐บ(2).
A linear (๐๐, ๐๐) code ๐ถ๐ถ is a ๐๐-dimensional subspace of all the binary ๐๐-tuples (๐๐๐๐). So, we can find ๐๐ linearly independent members of ๐ถ๐ถ, say ๐๐0,๐๐1,โฏ ,๐๐๐๐โ1 such that any ๐ฃ๐ฃ โ ๐๐ can be written as:
๐ฃ๐ฃ = ๐ข๐ข0๐๐0 + ๐ข๐ข1๐๐1 + โฏ+ ๐ข๐ข๐๐โ1๐๐๐๐โ1.
Arranging these ๐๐ linearly independent in a matrix:
๐บ๐บ =
โฃโขโขโก๐๐0๐๐1โฎ
๐๐๐๐โ1โฆโฅโฅโค
= ๏ฟฝ
๐๐00 ๐๐01 โฏ ๐๐0,๐๐โ1
๐๐10 ๐๐11 โฏ ๐๐1,๐๐โ1โฎ
๐๐๐๐โ1,0
โฎ๐๐๐๐โ1,1
โฎโฏ ๐๐๐๐โ1,๐๐โ1
๏ฟฝ
where ๐บ๐บ is a ๐๐ ร ๐๐, binary matrix.
Let ๐ข๐ข = (๐ข๐ข0, ๐ข๐ข1,โฏ , ๐ข๐ข๐๐โ1) be the message to be sent. Then, the codeword can be given as:
๐ฃ๐ฃ = ๐ข๐ข โ ๐บ๐บ = (๐ข๐ข0, ๐ข๐ข1,โฏ ,๐ข๐ข๐๐โ1)
โฃโขโขโก๐๐0๐๐1โฎ
๐๐๐๐โ1โฆโฅโฅโค
= ๐ข๐ข0๐๐0 + ๐ข๐ข1๐๐1 + โฏ+ ๐ข๐ข๐๐โ1๐๐๐๐โ1.
That is, rows of ๐บ๐บ, span or generate ๐ถ๐ถ. That is why ๐บ๐บ is called the generator matrix.
Example: (Hamming code)
Consider (7,4) code we saw before:
๐บ๐บ =
โฃโขโขโก๐๐0๐๐1๐๐2๐๐3โฆโฅโฅโค
= ๏ฟฝ
1 1 0 1 0 0 00 1 1 0 1 0 011
10
1 0 0 1 01 0 0 0 1
๏ฟฝ
Letโs message be ๐ข๐ข = (1 1 0 1). Then,
๐ฃ๐ฃ = 1 โ ๐๐0 + 1 โ ๐๐1 + 0 โ ๐๐2 + 1 โ ๐๐3
= (1101000) + (0110100) + (1010001)
= (0001101)
Example: (7,4) linear block code:
message codeword 0000 0000000 1000 1101000 0100 0110100 1100 1011100 0010 1110010 1010 0011010 0110 1000110 1110 0101110 0001 1010001 1001 0111001 0101 1100101 1101 0001101 0011 0100011 1011 1001011 0111 0010111 1111 1111111
Definition: a block code is called systematic if its message bits are consecutive and so are its parity bits.
parity message
The generator of a systematic code consists of a ๐๐ ร ๐๐ identity matrix (to repeat the message bits) and a ๐๐ ร (๐๐ โ ๐๐) parity matrix to generate parity bits.
๐บ๐บ =
โฃโขโขโก๐๐0๐๐1โฎ
๐๐๐๐โ1โฆโฅโฅโค
= ๏ฟฝ
๐๐00 ๐๐01 โฏ ๐๐0,๐๐โ๐๐โ1 1 0 โฏ 0๐๐10 ๐๐11 โฏ ๐๐1,๐๐โ๐๐โ1 0 1 โฏ 0โฎ
๐๐๐๐โ1,0
โฎ๐๐๐๐โ1,1
โฎ โฏ ๐๐๐๐โ1,๐๐โ๐๐โ1 0 0 โฏ 1
๏ฟฝ
๐๐ โ ๐๐ digits ๐๐ digits
So, ๐บ๐บ = [๐๐ ๐ผ๐ผ๐๐].
For an input ๐ข๐ข = (๐ข๐ข0,๐ข๐ข1,โฏ ,๐ข๐ข๐๐โ1), the output of the encoder is:
๐ฃ๐ฃ = (๐ฃ๐ฃ0, ๐ฃ๐ฃ1,โฏ , ๐ฃ๐ฃ๐๐โ1) = (๐ข๐ข0,๐ข๐ข1,โฏ ,๐ข๐ข๐๐โ1)๐บ๐บ.
So, ๐ฃ๐ฃ๐๐ = ๐ข๐ข0๐๐0๐๐ + ๐ข๐ข1๐๐1๐๐ + โฏ+ ๐ข๐ข๐๐โ1๐๐๐๐โ1,๐๐ for 0 โค ๐๐ < ๐๐ โ ๐๐ and ๐ฃ๐ฃ๐๐โ๐๐+๐๐ = ๐ข๐ข๐๐ for 0 โค ๐๐ < ๐๐.
Going back to our (7,4) example:
๐ฃ๐ฃ = (๐ข๐ข0,๐ข๐ข1,โฏ ,๐ข๐ข๐๐โ1) ๏ฟฝ
1 1 0 1 0 0 00 1 1 0 1 0 011
10
1 0 0 1 01 0 0 0 1
๏ฟฝ.
Therefore,
๐ฃ๐ฃ0 = ๐ข๐ข0 + ๐ข๐ข2 + ๐ข๐ข3
๐ฃ๐ฃ1 = ๐ข๐ข0 + ๐ข๐ข1 + ๐ข๐ข2
๐ฃ๐ฃ2 = ๐ข๐ข1 + ๐ข๐ข2 + ๐ข๐ข3
๐ฃ๐ฃ3 = ๐ข๐ข0
๐ฃ๐ฃ4 = ๐ข๐ข1
๐ฃ๐ฃ5 = ๐ข๐ข2
๐ฃ๐ฃ6 = ๐ข๐ข3.
Parity check matrix:
Let ๐บ๐บ be the generating polynomial of a code ๐ถ๐ถ. Form an (๐๐ โ ๐๐) ร ๐๐ matrix ๐ป๐ป whose rows are orthogonal to all rows of ๐บ๐บ. For a systematic code ๐บ๐บ = [๐๐ ๐ผ๐ผ๐๐] and ๐ป๐ป = [๐ผ๐ผ๐๐โ๐๐ ๐๐๐๐], where ๐๐๐๐ is the transpose of ๐๐. That is:
๐ป๐ป = [๐ผ๐ผ๐๐โ๐๐ ๐๐๐๐] = ๏ฟฝ
1 0 0 โฏ 0 ๐๐00 โฏ ๐๐๐๐โ1,0
0 1 0 โฏ 0 ๐๐01 โฏ ๐๐๐๐โ1,1
โฎ0
โฎ0
โฎ 0 โฏ 1 ๐๐0,๐๐โ๐๐โ1 โฏ ๐๐๐๐โ1,๐๐โ๐๐โ1
๏ฟฝ
Then, we have:
๐บ๐บ โ ๐ป๐ป๐๐ = 0.
Therefore, for any ๐ฃ๐ฃ โ ๐ถ๐ถ โ ๐ฃ๐ฃ = ๐ข๐ข โ ๐บ๐บ โ ๐ป๐ป๐๐ = 0.
For the (7, 4) Hamming code:
๏ฟฝ1 0 0 1 0 1 10 1 0 1 1 1 00 0 1 0 1 1 1
๏ฟฝ.
Note that a parity check matrix can generate an (๐๐,๐๐ โ ๐๐) code. Each codeword of this code, ๐ถ๐ถ๐๐ is orthogonal to each codeword of ๐ถ๐ถ. ๐ถ๐ถ๐๐ is called the dual code of ๐ถ๐ถ.
To encode a linear block code, we use XOR gates to form parities. Following figure shows how a systematic linear block code is encoded:
Bits of the message are fed to a shift register and also go to the channel. When they are in the shift register, they are linearly combined according to:
๐ฃ๐ฃ๐๐ = ๐ข๐ข0๐๐0๐๐ + ๐ข๐ข1๐๐1๐๐ + โฏ+ ๐ข๐ข๐๐โ1๐๐๐๐โ1,๐๐,
and placed in an output register and fed to channel.
For the (7, 4) code:
Syndrome:
Assume that the message ๐ข๐ข is encoded as ๐ฃ๐ฃ = ๐ข๐ข โ ๐บ๐บ. If there is no error, at the receiver we have ๐๐ = ๐ฃ๐ฃ and no need for error detection and error correction. But if there is an error, we get:
๐๐ = ๐ฃ๐ฃ + ๐๐,
where ๐๐ = (๐๐0, ๐๐1,โฏ , ๐๐๐๐) is an error vector. If we multiply ๐๐ by ๐ป๐ป๐๐, we get:
๐๐ โ ๐ป๐ป๐๐ = ๏ฟฝ๐ฃ๐ฃ + ๐๐๏ฟฝ โ ๐ป๐ป๐๐ = ๐ฃ๐ฃ โ ๐ป๐ป๐๐ + ๐๐ โ ๐ป๐ป๐๐ = ๐๐ โ ๐ป๐ป๐๐
It is important to note that the result does not depend on the message, but on the error pattern ๐๐. We call the vector ๐ ๐ = ๐๐ โ ๐ป๐ป๐๐ the syndrome. Since ๐๐ is an ๐๐-vector and ๐ป๐ป๐๐ is ๐๐ ร (๐๐ โ ๐๐), there are (๐๐ โ ๐๐) bits in vector ๐ ๐ . So, ๐ ๐ can point to 2๐๐โ๐๐ patterns (one correct transmission 0, 0,โฏ , 0 and 2๐๐โ๐๐ โ 1 error patterns).
Example: consider the (7, 4) code. Let ๐๐ = (๐๐0, ๐๐1, ๐๐2, ๐๐3, ๐๐4, ๐๐5, ๐๐6) be the received vector (output of demodulator). Then the syndrome
๐ ๐ = (๐ ๐ 0, ๐ ๐ 1, ๐ ๐ 2) = (๐๐0, ๐๐1, ๐๐2, ๐๐3, ๐๐4, ๐๐5, ๐๐6)
โฃโขโขโขโขโขโก1 0 00 1 001011
01110
10111โฆโฅโฅโฅโฅโฅโค
or:
๐ ๐ 0 = ๐๐0 + ๐๐3 + ๐๐5 + ๐๐6
๐ ๐ 1 = ๐๐1 + ๐๐3 + ๐๐4 + ๐๐5
Syndrome circuit for a linear systematic (๐๐,๐๐) code
Syndrome circuit for the (7, 4) code
We saw that:
๐ ๐ = ๐๐ โ ๐ป๐ป๐๐ = ๐๐ โ ๐ป๐ป๐๐ .
So, we can write ๐ ๐ ๐๐โs as:
๐ ๐ ๐๐ = ๐๐๐๐ + ๐๐๐๐โ๐๐๐๐0๐๐ + ๐๐๐๐โ๐๐+1๐๐1๐๐ + โฏ+ ๐๐๐๐โ1๐๐๐๐โ1,๐๐, ๐๐ = 0, 1,โฏ ,๐๐ โ ๐๐ โ 1.
Since ๐๐ = ๐ฃ๐ฃ + ๐๐, we have:
๐ ๐ ๐๐ = (๐ฃ๐ฃ๐๐ + ๐๐๐๐) + (๐ฃ๐ฃ๐๐โ๐๐ + ๐๐๐๐โ๐๐)๐๐0๐๐ + โฏ+ (๐ฃ๐ฃ๐๐โ1 + ๐๐๐๐โ1)๐๐๐๐โ1,๐๐.
But ๐ฃ๐ฃ๐๐ + ๐ฃ๐ฃ๐๐โ๐๐๐๐0๐๐ + โฏ+ ๐ฃ๐ฃ๐๐โ1๐๐๐๐โ1,๐๐ = 0 and
๐ ๐ ๐๐ = ๐๐๐๐ + ๐๐๐๐โ๐๐๐๐0๐๐ + ๐๐๐๐โ๐๐+1๐๐1๐๐ + โฏ+ ๐๐๐๐โ1๐๐๐๐โ1,๐๐, ๐๐ = 0, 1,โฏ ,๐๐ โ ๐๐ โ 1.
This shows that ๐๐ โ ๐๐ syndromes provide us with ๐๐ โ ๐๐ equations about error pattern. There are 2๐๐ error patterns, but we have 2๐๐โ๐๐ equations. So, we cannot catch all errors.
In fact, there are 2๐๐ error patterns for each syndrome. To put it another way, the code ๐ถ๐ถ is a subgroup of the set of ๐๐-tuples. The set of ๐๐-tuples is partitioned into 2๐๐โ๐๐ cosets of ๐ถ๐ถ. All the ๐๐-tuples in one coset result in the same syndrome. So, the syndrome only points us to a coset of ๐ถ๐ถ not to a single error pattern. Out of 2๐๐ patterns (๐๐-tuples in the coset), we decide (based on the property of the channel) which error has occurred.
Example: take again the (7, 4) code. Assume that we receive ๐๐ = (1001001). Then,
๐ ๐ = ๐๐ โ ๐ป๐ป๐๐ = (1, 1, 1).
This means that
1 = ๐๐0 + ๐๐3 + ๐๐5 + ๐๐6
1 = ๐๐1 + ๐๐3 + ๐๐4 + ๐๐5
1 = ๐๐2 + ๐๐4 + ๐๐5 + ๐๐6
Any of the following 24 = 16 patterns satisfy these equations:
To decide which error to choose depends on our expectation about the channel behaviours. For example, in a BSC channel, we know that the probability of a single error is more than multiple errors. So, we decide ๐๐ = (0000010) as the error and therefore, the codeword transmitted must have been:
๐ฃ๐ฃ = ๐๐ + ๐๐ = (1001001) + (0000010) = (1001011).
Minimum distance of a code:
Hamming distance ๐๐(๐ฃ๐ฃ,๐ค๐ค) between two vectors ๐ฃ๐ฃ and ๐ค๐ค is the number of places they are different. In binary case, the distance ๐๐(๐ฃ๐ฃ,๐ค๐ค) is the weight (the number of places a vector is non-zero) of ๐ฃ๐ฃ + ๐ค๐ค or
๐๐๏ฟฝ๐ฃ๐ฃ,๐ค๐ค๏ฟฝ = ๐ค๐ค(๐ฃ๐ฃ,๐ค๐ค)
The minimum distance of a code ๐ถ๐ถ is the minimum value of ๐๐๏ฟฝ๐ฃ๐ฃ,๐ค๐ค๏ฟฝ for all non-identical ๐ฃ๐ฃ and ๐ค๐ค โ ๐ถ๐ถ
๐๐๐๐๐๐๐๐ = ๐๐๐๐๐๐๏ฟฝ๐๐๏ฟฝ๐ฃ๐ฃ,๐ค๐ค๏ฟฝ: ๐ฃ๐ฃ,๐ค๐ค โ ๐ถ๐ถ, ๐ฃ๐ฃ โ ๐ค๐ค๏ฟฝ.
Since for any ๐ฃ๐ฃ and ๐ค๐ค โ ๐ถ๐ถ, ๐ฃ๐ฃ + ๐ค๐ค โ ๐ถ๐ถ then the minimum distance of a linear block code is equal to minimum weight of its non-zero codewords:
๐๐๐๐๐๐๐๐ = ๐๐๐๐๐๐๏ฟฝ๐ค๐ค๏ฟฝ๐ฃ๐ฃ + ๐ค๐ค๏ฟฝ: ๐ฃ๐ฃ,๐ค๐ค โ ๐ถ๐ถ, ๐ฃ๐ฃ โ ๐ค๐ค๏ฟฝ
= ๐๐๐๐๐๐๏ฟฝ๐ค๐ค๏ฟฝ๐ฅ๐ฅ๏ฟฝ: ๐ฅ๐ฅ โ ๐ถ๐ถ, ๐ฅ๐ฅ โ 0๏ฟฝ
= ๐ค๐ค๐๐๐๐๐๐.
Therefore, we have:
Theorem 1: the minimum distance of a linear block code is equal to the minimum weight of its non-zero codewords.
Theorem 2: let ๐ถ๐ถ be an (๐๐, ๐๐) linear block code with parity check matrix ๐ป๐ป.
โข For any codeword ๐ฃ๐ฃ โ ๐ถ๐ถ of weight ๐๐, there are ๐๐ columns of ๐ป๐ป such that their vector sum is 0.
โข If there are ๐๐ columns of ๐ป๐ป whose vector sum is 0, then there is a codeword ๐ฃ๐ฃ โ ๐ถ๐ถ with weight ๐๐.
Proof: let ๐ฃ๐ฃ = (๐ฃ๐ฃ0, ๐ฃ๐ฃ1,โฏ , ๐ฃ๐ฃ๐๐โ1) have ๐๐ non-zero elements at places ๐๐1, ๐๐2,โฏ , ๐๐๐๐. Then,
๐ฃ๐ฃ โ ๐ป๐ป๐๐ = 0 โ ๐ฃ๐ฃ0โ0 + ๐ฃ๐ฃ1โ1 + โฏ+ ๐ฃ๐ฃ๐๐โ1โ๐๐โ1 = 0
โ ๐ฃ๐ฃ๐๐1โ๐๐1 + ๐ฃ๐ฃ๐๐2โ๐๐2 + โฏ+ ๐ฃ๐ฃ๐๐๐๐โ๐๐๐๐ = 0
โ โ๐๐1 + โ๐๐2 + โ๐๐3 + โฏ+ โ๐๐๐๐ = 0
So, part 1 is proved.
Now assume that:
โ๐๐1 + โ๐๐2 + โ๐๐3 + โฏ+ โ๐๐๐๐ = 0.
Take ๐ฅ๐ฅ = (๐ฅ๐ฅ0, ๐ฅ๐ฅ1,โฏ , ๐ฅ๐ฅ๐๐โ1) such that:
๏ฟฝ๐ฅ๐ฅ๐๐ = 1 ๐๐๐๐ ๐๐ = ๐๐1, ๐๐2,โฏ , ๐๐๐๐๐ฅ๐ฅ๐๐ = 0 ๐๐๐๐โ๐๐๐๐๐ค๐ค๐๐๐ ๐ ๐๐.
Then,
๐ฅ๐ฅ โ ๐ป๐ป๐๐ = ๐ฅ๐ฅ0โ0 + ๐ฅ๐ฅ1โ1 + โฏ+ ๐ฅ๐ฅ๐๐โ1โ๐๐โ1
= ๐ฅ๐ฅ๐๐1โ๐๐1 + ๐ฅ๐ฅ๐๐2โ๐๐2 +โฏ+ ๐ฅ๐ฅ๐๐๐๐โ๐๐๐๐
= โ๐๐1 + โ๐๐2 +โฏ+ โ๐๐๐๐ = 0,
so, ๐ฅ๐ฅ โ ๐ถ๐ถ.
Corollary 2.1: let ๐ถ๐ถ be a linear block code with parity check matrix ๐ป๐ป. If no ๐๐ โ 1 or less columns of ๐ป๐ป add to 0, then minimum weight of ๐ป๐ป is at least ๐๐.
Corollary 2.2: the minimum distance of a linear block code ๐ถ๐ถ is the smallest number of columns of ๐ป๐ป adding to 0.
Error-detection and error-correction capability of a linear block code:
If the minimum distance of a code is ๐๐๐๐๐๐๐๐, it can detect any error pattern with ๐๐๐๐๐๐๐๐ โ 1 or less errors.
Definition: assume that ๐ด๐ด0,๐ด๐ด1,๐ด๐ด2,โฏ ,๐ด๐ด๐๐ are the number of codewords with weight 0, 1, 2,โฏ , ๐๐ in a code ๐ถ๐ถ. ๐ด๐ด0,๐ด๐ด1,๐ด๐ด2,โฏ ,๐ด๐ด๐๐ are called weight distribution of the code.
For example, for (7, 4) Hamming code,
๐ด๐ด0 = ๐ด๐ด7 = 1, ๐ด๐ด3 = 7, ๐ด๐ด4 = 7, and ๐ด๐ด๐๐ = 0 otherwise.
If we send a codeword ๐ฃ๐ฃ and we receive ๐๐ = ๐ฃ๐ฃ + ๐๐, we can detect errors unless ๐๐ โ ๐ถ๐ถ. So, ๐๐๐ข๐ข(๐ธ๐ธ) =โ ๐ด๐ด๐๐(1 โ ๐๐)๐๐โ๐๐๐๐๐๐๐๐๐๐=1 , where ๐๐๐ข๐ข(๐ธ๐ธ) is the probability of undetected error and ๐๐ is the probability
of error of modulation-demodulation.
For the (7, 4) code, we have:
๐๐๐ข๐ข(๐ธ๐ธ) = 7๐๐3(1 โ ๐๐)4 + 7๐๐4(1 โ ๐๐)3 + ๐๐7.
So, if ๐๐ = 10โ2, we get ๐๐๐ข๐ข(๐ธ๐ธ) = 7 ร 10โ6. That is if one million bits are transmitted on the average 7 errors go through undetected.
Error correction capability:
A code ๐ถ๐ถ with minimum distance ๐๐๐๐๐๐๐๐ can correct ๐๐ = ๏ฟฝ๐๐๐๐๐๐๐๐โ12
๏ฟฝ and less errors. (โ๐๐โ denotes the
floor, i.e., the largest integer number less than ๐๐). ๐๐ = ๏ฟฝ๐๐๐๐๐๐๐๐โ12
๏ฟฝ means that ๐๐๐๐๐๐๐๐ = 2๐๐ + 1 or ๐๐๐๐๐๐๐๐ = 2๐๐ + 2 or 2๐๐ + 1 โค ๐๐๐๐๐๐๐๐ โค 2๐๐ + 2.
Triangle inequality: ๐๐๏ฟฝ๐ฃ๐ฃ, ๐๐๏ฟฝ + ๐๐(๐ค๐ค, ๐๐) โฅ ๐๐(๐ฃ๐ฃ,๐ค๐ค)
But: ๐๐๏ฟฝ๐ฃ๐ฃ,๐ค๐ค๏ฟฝ โฅ ๐๐๐๐๐๐๐๐ โฅ 2๐๐ + 1.
Let ๐๐๏ฟฝ๐ฃ๐ฃ, ๐๐๏ฟฝ = ๐๐โฒ, then: ๐๐๏ฟฝ๐ค๐ค, ๐๐๏ฟฝ โฅ 2๐๐ + 1 โ ๐๐โฒ. If ๐๐โฒ โค ๐๐, then ๐๐๏ฟฝ๐ค๐ค, ๐๐๏ฟฝ โฅ ๐๐. This means if the distance between the received vector and the transmitted code is less than or equal to ๐๐, the received vector is closer to this codeword, say ๐ฃ๐ฃ, than any other codeword ๐ค๐ค.
A code ๐ถ๐ถ with minimum distance ๐๐๐๐๐๐๐๐ can correct ๐๐ = ๏ฟฝ๐๐๐๐๐๐๐๐โ12
๏ฟฝ errors. It may correct some of the error patterns of weight higher than ๐๐, but it cannot correct all of those with ๐๐ + 1 errors. Probability of error is upper bounded as
๐๐(๐ธ๐ธ) โค ๏ฟฝ ๏ฟฝ๐๐๐๐ ๏ฟฝ ๐๐๐๐(1 โ ๐๐)๐๐โ๐๐
๐๐
๐๐=๐ก๐ก+1
.
Erasures:
Sometimes instead of deciding 0 or 1 at the output of the demodulator, we decide 0 and 1 for those received values far away zero and ๐๐ or erasure for those close to zero.
A linear block code with ๐๐๐๐๐๐๐๐ can correct ๐พ๐พ errors and ๐๐ erasures such that:
๐๐๐๐๐๐๐๐ โฅ 2๐พ๐พ + ๐๐ + 1.
Standard arrays:
We said that a code of length ๐๐ and dimension ๐๐, i.e., and (๐๐,๐๐) code partitions the set ๐๐๐๐ of ๐๐-tuples into 2๐๐โ๐๐ cosets of the code ๐ถ๐ถ. If we write elements of ๐ถ๐ถ in a row and then from 2๐๐ โ 2๐๐ remaining ๐๐-tuples take a vector ๐๐2, add ๐๐2 to each element of ๐ถ๐ถ and write in the second row, then
take an unused element of the ๐๐-tuples say ๐๐3, add it to each codeword and write in the second row and continue this until we have used all ๐๐-tuples, we get a standard array.
๐ฃ๐ฃ1 = 0 ๐ฃ๐ฃ2 โฏ ๐ฃ๐ฃ๐๐ โฏ ๐ฃ๐ฃ2๐๐ ๐๐2 ๐๐2 + ๐ฃ๐ฃ2 โฏ ๐๐2 + ๐ฃ๐ฃ๐๐ โฏ ๐๐2 + ๐ฃ๐ฃ2๐๐ ๐๐3 ๐๐3 + ๐ฃ๐ฃ2 โฏ ๐๐3 + ๐ฃ๐ฃ๐๐ โฏ ๐๐3 + ๐ฃ๐ฃ2๐๐ โฎ โฎ โฎ โฎ ๐๐๐๐ ๐๐๐๐ + ๐ฃ๐ฃ2 โฏ ๐๐๐๐ + ๐ฃ๐ฃ๐๐ โฏ ๐๐๐๐ + ๐ฃ๐ฃ2๐๐ โฎ โฎ โฎ โฎ
๐๐2๐๐โ๐๐ ๐๐2๐๐โ๐๐ + ๐ฃ๐ฃ2 โฏ ๐๐2๐๐โ๐๐ + ๐ฃ๐ฃ๐๐ โฏ ๐๐2๐๐โ๐๐ + ๐ฃ๐ฃ2๐๐
Theorem 3: no two ๐๐-tuples in the same row are identical. Every ๐๐-tuple is in one and only one row.
Proof: since ๐ถ๐ถ is a subgroup of ๐๐๐๐ and each row is a coset of ๐ถ๐ถ.
Since a code ๐ถ๐ถ with minimum distance ๐๐๐๐๐๐๐๐ can correct up to ๐๐ = ๏ฟฝ๐๐๐๐๐๐๐๐โ12
๏ฟฝ errors, we can use as the first coset leaders (๐๐๐๐โs) the patterns with ๐๐ and less 1โs. this covers for:
๏ฟฝ๐๐0๏ฟฝ + ๏ฟฝ๐๐1๏ฟฝ + โฏ+ ๏ฟฝ๐๐๐๐๏ฟฝ = ๏ฟฝ๏ฟฝ๐๐๐๐ ๏ฟฝ๐ก๐ก
๐๐=0
coset leaders, but this sum may not be equal to 2๐๐โ๐๐. So, we may add some error patterns with two or more errors.
Definition: if โ ๏ฟฝ๐๐๐๐ ๏ฟฝ๐ก๐ก๐๐=0 = 2๐๐โ๐๐, we say that the (๐๐,๐๐) code is perfect.
(7, 4) code is perfect since it has ๐๐๐๐๐๐๐๐ = 3 and therefore, ๐๐ = 1 and
๏ฟฝ๏ฟฝ๐๐๐๐ ๏ฟฝ๐ก๐ก
๐๐=0
= ๏ฟฝ70๏ฟฝ + ๏ฟฝ7
1๏ฟฝ = 1 + 7 = 8 = 23 = 2๐๐โ๐๐.
Note that since the elements on each row of the standard array are the 2๐๐ codewords each added to a unique ๐๐-tuple (the coset leader), the syndromes of all numbers of a coset are the same. So, by finding the syndrome, we find out in what row of the standard array the received vector and hopefully the transmitted codeword is. We can the output the coset leader. For small codes, a lookup table is feasible. But for longer codes, we need to calculate the error based on the syndrome.
General decoder for a linear block code
Decoding circuit for the (7, 4) code