Decoding of Linear Block Codes
Contents
Block diagram and requirements
We start from the block diagram already shown in the chapter Channel Models and Decision Structures where the digital channel model used is mostly the Binary Symmetric Channel (BSC).
For code word estimation, we use the "Maximum Likelihood Decision" (ML), which for binary codes ⇒ x_∈GF(2n) at the block level gives the same result as the MAP Receiver.
The task of the channel decoder can be described as follows:
- The vector v_ after decoding (at the sink) should match the information word u_ as well as possible.
- That is: The »block error probability« should be as small as possible:
- Pr(blockerror)=Pr(v_≠u_)!=minimum.
- Because of assignments x_=enc(u_) resp. v_=enc−1(z_) also holds:
- Pr(blockerror)=Pr(z_≠x_)!=minimum.
- Sought is the most likely sent code word y_=x_+e_ for the given received word x_i, which is passed on as result z_:
- z_=argmaxx_i∈CPr(x_i|y_).
- For the BSC model, both x_i∈GF(2n) and y_∈GF(2n), so the maximum likelihood decision rule can also be written using the Hamming distance dH(y_,x_i):
- z_=argminx_i∈CdH(y_,x_i).
Principle of syndrome decoding
Assumed here is a (n,k) block code with the parity-check matrix H and the systematic code words
- x_=(x1,x2,...,xi,...,xn)=(u1,u2,...,uk,p1,...,pn−k).
With the error vector e_ then applies to the received word:
- y_=x_+e_,y_∈GF(2n),x_∈GF(2n),e_∈GF(2n).
A bit error at position i ⇒ yi≠xi is expressed by the »error coefficient« ei=1.
Definition: The »syndrome« s_=(s0,s1,...,sm−1) is calculated (as row resp. column vector) from the received word y_ and the parity-check matrix H as follows:
- s_=y_⋅HTbzw.s_T=H⋅y_T.
- The vector length of s_ is equal to m=n−k (row number of H).
The syndrome s_ shows the following characteristics:
- Because of the equation x_⋅HT=0_ the syndrome s_ does not depend on the code word x_ but solely on the error vector e_:
- s_=y_⋅HT=x_⋅HT+e_⋅HT=e_⋅HT.
- For sufficiently few bit errors, s_ provides a clear indication of the error locations, allowing full error correction.
Example 1: Starting from the systematic (7, 4, 3) Hamming code, the following result is obtained for the received vector y_=(0,1,1,1,0,0,1):
- H⋅y_T=(111010001110101101001)⋅(0111001)=(011)=s_T.
Comparing the syndrome with the parity-check equations of the Hamming code, we see that
- most likely the fourth symbol (x4=u4) of the code word has been falsified,
- the code word estimator will thus yield the result z_=(0,1,1,0,0,0,1),
- the decision is correct only if only one bit was falsified during transmission.
Below are the required corrections for the (7, 4, 3) Hamming code resulting from the calculated syndrome s_ corresponding to the columns of the parity-check matrix:
- s_=(0,0,0)⇒nocorrection;s_=(1,0,0)⇒invertp1;
- s_=(0,0,1)⇒invertp3;s_=(1,0,1)⇒invertu1;
- s_=(0,1,0)⇒invertp2;s_=(1,1,0)⇒invertu3;
- s_=(0,1,1)⇒invertu4;s_=(1,1,1)⇒invertu2.
Generalization of syndrome coding
We continue to assume the BSC channel model. This means:
- The received vector y_ and the error vector e_ are elements of GF(2n).
- The possible code words x_i belong to the code C, which spans a (n−k)-dimensional subspace of GF(2n).
Under this assumption, we briefly summarize the results of the last sections:
- Syndrome decoding is a realization possibility of maximum likelihood decoding of block codes. One decides on the code word x_i with the least Hamming distance to the received word y_:
- z_=argminx_i∈CdH(y_,x_i).
- But the syndrome decoding is also the search for the most probable error vector e_ that satisfies the condition e_⋅HT=s_. The "syndrome" is thereby determined by the equation
- s_=y_⋅HT.
- With the Hamming weight wH(e_) the second interpretation can also be mathematically formulated as follows:
- z_=y_+argmine_i∈GF(2n)wH(e_i).
Conclusion: Note that the error vector e_ as well as the received vector y_ is an element of GF(2n) unlike the syndrome s_∈GF(2m) with number m=n−k of parity-check equations. This means, that
- the association between the syndrome s_ and the error vector e_ is not unique, but
- each 2k error vectors lead to the same syndrome s_ which one groups together into a so-called "coset".
Example 2: The facts shall be illustrated by the example with parameters n=5, k=2 ⇒ m=n−k=3 .
You can see from this graph:
- The 2n=32 possible error vectors e_ are divided into 2m=8 cosets Ψ0, ... , Ψ7. Explicitly drawn here are only the cosets Ψ0 and Ψ5.
- All 2k=4 error vectors of the coset Ψμ lead to the syndrome s_μ.
- Each minor class Ψμ has a "leader" e_μ, namely the one with the minimum Hamming weight.
Example 3: Starting from the systematic (5, 2, 3) code C={(0,0,0,0,0),(0,1,0,1,1),(1,0,1,1,0),(1,1,1,0,1)} the syndrome decoding procedure is now described in detail.
- The generator matrix and the parity-check matrix are:
- G=(1011001011),
- H=(101001101001001).
- The table summarizes the final result. Note:
- The index μ is not identical to the binary value of s_μ.
- The order is rather given by the number of ones in the minor class leader e_μ.
- For example, the syndrome s_5=(1,1,0) and the syndrome s_6=(1,0,1).
- To derive this table, note:
- The row 1 refers to the syndrome s_0=(0,0,0) and the associated cosets Ψ0. The most likely error sequence here is (0,0,0,0,0) ⇒ no bit error, which we call the "coset leader" e_0.
- The other entries in the first row, namely (1,0,1,1,0), (0,1,0,1,1) and (1,1,1,0,1), also each yield the syndrome s_0=(0,0,0), but only result with at least three bit errors and are correspondingly unlikely.
- In rows 2 to 6, the respective coset leader e_μ contains exactly a single "1" (μ=1, ... , 5). Here e_μ is always the most likely error pattern of the class Ψμ. The other group members result only with at least two bit errors.
- The syndrome s_6=(1,0,1) is not possible with only one bit error. In creating the table, we then considered all "5 over 2=10" error patterns e_ with weight wH(e_)=2.
- The first found sequence with syndrome s_6=(1,0,1) was chosen as coset leader e_6=(1,1,0,0) . With a different probing order, the sequence (0,0,1,0,1) could also have resulted from Ψ6.
- Similar procedure was followed in determining the leader e_7=(0,1,1,0,0) of the cosets class Ψ7 characterized by the uniform syndrome s_7=(1,1,1). Also in the class Ψ7 there is another sequence with Hamming weight wH(e_)=2, namely (1,0,0,0,1).
- The table only needs to be created once. First, the syndrome must be determined, e.g. for the received vector y_=(0,1,0,0,1):
- s_=y_⋅HT=(01001)⋅(110011100010001)=(010)=s_2.
- Using the coset leader e_2=(0,0,0,1,0) from the above table (red entry for μ=2) finally arrives at the decoding result:
- z_=y_+e_2=(0,1,0,0,1)+(0,0,0,1,0)=(0,1,0,1,1).
Conclusion: From these examples it is already clear that the »syndrome decoding means a considerable effort«, if one cannot use certain properties e.g. cyclic codes.
- For large block code lengths, this method fails completely. Thus, to decode a BCH code (the abbreviation stands for their inventors Bose, Chaudhuri, Hocquenghem) with code parameters n=511, k=259 and dmin=61, one has to evaluate and store exactly 2511−259≈1076 error patterns of length 511.
- Happily, however, there are special decoding algorithms for these and also for other codes of large block length, which lead to success with less effort
.
Coding gain - bit error rate with AWGN
We now consider the bit error rate for the following constellation:
- Hamming code HC (7, 4, 3),
- AWGN–channel, characterized by the quotient EB/N0 (in dB),
- Maximum Likelihood Decoder (ML) with
"Hard Decision" (HD) and "Soft Decision" (SD), resp.
It should be noted with regard to this graph:
- The black comparison curve applies e.g. to binary phase modulation (BPSK) without coding. For this one needs for the bit error rate 10−5 about 10⋅lgEB/N0=9.6dB.
- The red circles apply to the HC (7, 4, 3) and hard decisions of the maximum likelihood decoder (ML–HD). Syndrome decoding is a possible realization form for this.
- This configuration brings an improvement over the comparison system only for 10⋅lgEB/N0>6dB. For BER=10−5 one only needs 10⋅lgEB/N0≈9.2dB.
- The green crosses for HC (7, 4, 3) and soft decision (ML–SD) are below the red curve throughout the range. For BER=10−5 this gives 10⋅lgEB/N0≈7.8dB.
Definition: We refer as »coding gain« of a considered system configuration,
- characterized by its code and
- the way it is decoded,
the smaller 10⋅lgEB/N0 required for a given bit error rate (BER) compared to the comparison system (without coding):
- GCode(considered system|BER)=10⋅lgEB/N0(comparison system|BER)−10⋅lgEB/N0(considered system|BER).
Applied to the above graph, one obtains:
GCode(Hamming(7,4,3),ML−HD|BER=10−5)=0.4 dB,
GCode(Hamming(7,4,3),ML−SD|BER=10−5)=1.8 dB.
Decoding at the Binary Erasure Channel
Finally, it will be shown to what extent the decoder has to be modified
- if instead of the BSC model ("Binary Symmetric Channel")
- the BEC model ("Binary Erasure Channel") is used,
which does not produce errors but marks uncertain bits as "erasures".
Example 4: We consider again as in Example 3 the systematic (5, 2, 3) block code
- C={(0,0,0,0,0),(0,1,0,1,1),(1,0,1,1,0),(1,1,1,0,1)}.
The graphic shows the system model and gives exemplary values for the individual vectors.
- The left part of the picture (yellow background) is valid for "BSC" with one bit error (0→1) at the third bit.
- The right part of the picture (green background) is for "BEC" and shows two erasures (1→E) at the second and the fourth bit.
One recognizes:
- With BSC only t=1 bit error (marked in red in the left part) can be corrected due to dmin=3. If one restricts oneself to error detection, this works up to e=dmin−1=2 bit errors.
- For BEC, error detection makes no sense, because already the channel locates an uncertain bit as an "erasure" E. The zeros and ones in the BEC received word y_ are safe. Therefore the error correction works here up to e=2 erasures (marked in red in the right part) with certainty.
- Also e=3 erasures are sometimes still correctable. So y_=(E,E,E,1,1) to z_=(0,1,0,1,1) to be corrected since no second code word ends with two ones. But y_=(0,E,0,E,E) is not correctable because of the all zero word allowed in the code.
- If it is ensured that there are no more than two erasures in any received word, the BEC block error probability Pr(z_≠x_)=Pr(v_≠u_)≡0. In contrast, the corresponding block error probability in the BSC model always has a value greater than 0.
Since after the BEC each received word is either decoded correctly or not at all, we call here the block y_→z_ in the future "code word finder". An "estimation" takes place only in the BSC model.
But how does the decoding of a received word y_ with erasures work algorithmically?
Example 5: Starting from the received word y_=(0,E,0,E,1) in Example 4 we formally set the output of the code word finder to z_=(0,z2,0,z4,1), where the symbols z2∈{0,1} and z4∈{0,1} are to be determined according to the following equation:
- z_⋅HT=0_⇒H⋅z_T=0_T.
The task is now to implement this determination equation as efficiently as possible. The following calculation steps result:
- With the parity-check matrix H of the (5, 2, 3) block code and the vector z_=(0,z2,0,z4,1) is the above determination equation:
- H⋅z_T=(101001101001001)⋅(0z20z41)=(000).
- We sum up the "correct bits" (German: "korrekt" ⇒ subscript "K") to the vector z_K and the "erased bits" to the vector z_E. Then we split the parity-check matrix H into the corresponding submatrices HK and HE:
- z_K=(0,0,1),HK=(110100001)⇒Rows 1, 3 and 5 of the parity-check matrix,
- z_E=(z2,z4),HE=(001110)⇒Rows 2 and 4 of the parity-check matrix.
- Remembering that in GF(2) subtraction equals addition, the above equation can be represented as follows:
- HK⋅z_TK+HE⋅z_TE=0_T⇒HE⋅z_TE=HK⋅z_TK⇒(001110)⋅(z2z4)=(110100001)⋅(001)=(001).
- This leads to a linear system of equations with two equations for the unknown z2 and z4 (each 0 or 1).
- From the last row follows z2=1 and from the second row z2+z4=0 ⇒ z4=1. This gives the allowed code word z_=(0,1,0,1,1).
Exercises for the chapter
Exercise 1.11: Syndrome Decoding
Exercise 1.11Z: Syndrome Decoding again
Exercise 1.12: Hard Decision vs. Soft Decision
Exercise 1.12Z: Comparison of HC (7, 4, 3) and HC (8, 4, 4)
Exercise 1.13: Binary Erasure Channel Decoding
Exercise 1.13Z: Binary Erasure Channel Decoding again