Lectures No. 13 and 14: Channel Coding
Lectures No. 13 and 14: Channel Coding
Overview
These lectures will look at the following: Channel coding Block codes Hamming distance Repetition codes Single parity check codes Cross word error correction
DT008/2 Digital Communications Engineering II Slide: 1 Lectures No. 13 and 14: Channel Coding
Introduction
Channel coding deals with error control techniques. If the data at the output of a communications system has errors that are too frequent for the desired use, the errors can often be reduced by the use of a number of techniques. Coding permits an increased rate of information transfer
at a fixed error rate, or a reduced error rate for a fixed transfer rate. The two main methods of error control are: Automatic Repeat Request (ARQ) when a receiver circuit detects errors in a block of data, it reDT008/2 Digital Communications Engineering II Slide: 2 Lectures No. 13 and 14: Channel Coding
Channel Coding
The two main categories of channel codes are: Block codes a block of k information bits is encoded to give a codeword of n bits (n > k). For each sequence of k information bits, there is a a distinct codeword of n bits. Examples of block codes include
Hamming Codes and Cyclic Codes. A Cyclic Redundancy Check (CRC) code can detect any error burst up to the length of the CRC code itself. Convolutional Codes the coded sequence of n bits
DT008/2 Digital Communications Engineering II Slide: 4 Lectures No. 13 and 14: Channel Coding
Block codes
The block coder input is a stream of information bits. The coder segments this bit stream into blocks of k information bits and for each block it calculates a number of r check bits, or it picks the r check bits from a tabulated set of values. It then transmits the entire block, or
codeword of n = k + r channel bits. This is called an (n,k) block code. If errors occur in sufficiently few of these transmitted channel bits, the r check bits may provide the receiver
DT008/2 Digital Communications Engineering II Slide: 6 Lectures No. 13 and 14: Channel Coding
with sufficient information to enable it to detect and/or correct the channel errors. The code efficiency (or code rate) is k/n. If the k information bits are transmitted unaltered first followed by the transmission of the r check bits it is called a systematic code. A non-systematic block code is one which has the check bits interspersed between the information bits.
DT008/2 Digital Communications Engineering II Slide: 7 Lectures No. 13 and 14: Channel Coding
Repetition Codes
These are the simplest type of block codes. One way to detect an error in an information block is to send the information twice. The two received blocks are compared bit by bit and if there is a difference an error has occurred. This method may be extended by sending the information block three times. If one block differs from the other two, assume an error has occurred in that block and discard it.
DT008/2 Digital Communications Engineering II Slide: 11 Lectures No. 13 and 14: Channel Coding
very inefficient in terms of information transfer. Another method is to encode a single symbol into a block of n identical bits - an (n,1) block code. There are only two codewords - the sequence of n 0s and the sequence of n 1s. The first bit is the information bit, the other r = n 1 bits are check bits. The value of each check bit is identical to the information bit. The decoder might use the following rules: Count the number of 0s and the number of 1s in the received bits.
DT008/2 Digital Communications Engineering II Slide: 12 Lectures No. 13 and 14: Channel Coding
If there are more received 0s than 1s, decide that the all-0 codeword was sent.
If there are more 1s than 0s decide that the all-1 codeword was sent. If the number of 1s equals the number of 0s do not decide - just flag a decoding failure and perhaps generate and ARQ (automatic request to repeat the message). In this case the Hamming distance is n so that the original data can be recovered if there are less than (n1)/2 errors in the received codeword - this is the basis of the 2nd and 3rd steps above. This rule will decode correctly
DT008/2 Digital Communications Engineering II Slide: 13 Lectures No. 13 and 14: Channel Coding
in all cases where the channel noise changes less than half the bits in any one block.
If the channel noise changes more than half of the bits in any one block, the decoder will make a decoding error, i.e., it will decode the received word into the wrong codeword. If channel errors occur infrequently the probability of a decoding failure or a decoding error for a repetition code of long block length is very small indeed.
DT008/2 Digital Communications Engineering II Slide: 14 Lectures No. 13 and 14: Channel Coding
This check bit is the modulo-2 sum (modulo-2 addition is equivalent to the exclusive OR logical operation) of the codeword (n 1) information bits. If the number of 1s in the information word is even, then the modulo-2 sum of all the information bits will be equal
DT008/2 Digital Communications Engineering II Slide: 15 Lectures No. 13 and 14: Channel Coding
to 0. If the number of 1s in the information word is odd their modulo-2 sum will be equal to 1. The parity bit is calculated and appended to the information bits to form the codeword. Even parity means that the parity bit is set so that the total number of 1s in the codeword is even. Odd parity means that the total number of 1s in
the codeword must be odd. This type of code can only detect and cannot correct errors. A single bit error (or any number of odd bit errors) will be detected but any combination of two bit errors (or any
DT008/2 Digital Communications Engineering II Slide: 16 Lectures No. 13 and 14: Channel Coding
number of even bit errors) will cause a decoding error. Repetitive codes and single parity check codes are, respectively, examples of extreme and relatively trivial block codes. However, single parity checks are used quite often with ASCII codes in computer communications.
DT008/2 Digital Communications Engineering II Slide: 17 Lectures No. 13 and 14: Channel Coding
This is an extension of the use of parity bits to enable error recovery. Assume that data is sent in 7 bit words and a single parity bit is appended (Shown as Rx in the table below). This parity bit may be either even or odd. After 7 data words have been sent, another 8 bit check word is appended. Bit 1 of this word is a parity bit for bit 1 in all 7 data words. Bit 2 is a parity bit for bit 2 in all of the 7 data words etc. etc. These are shown as Cx
DT008/2 Digital Communications Engineering II Slide: 18 v Lectures No. 13 and 14: Channel Coding
bits in the table below. If bit 3 in word 4 is errored in transmission it will show up as two parity bit errors, i.e., parity bit R4 and C3.
This allows the errored bit to be identified and the error to be corrected. The problem with this correction method is in the low transmission efficiency. For example, the above arrangement sends 7 _ 7(49) bits of data but 8 _ 8(64) bits are required for error correction - the efficiency is 49/64 = 77 %.
DT008/2 Digital Communications Engineering II Slide: 19 Lectures No. 13 and 14: Channel Coding
Word 1 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 R1 Word 2 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 R2 Word 3 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 R3 Word 4 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 R4 Word 5 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 R5 Word 6 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 R6 Word 7 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 R7 Check Word C1 C2 C3 C4 C5 C6 C7 C8 DT008/2 Digital Communications Engineering II Slide: 20
Lectures No. 13 and 14: Channel Coding
Conclusion
These lectures have looked at the following: Channel coding Block codes Hamming distance Repetition codes Single parity check codes Cross word error correction
DT008/2 Digital Communications Engineering II Slide: 21