Error Detection N Correction

5,410
-1

Published on

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,410
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
215
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Error Detection N Correction

  1. 1. Error Detection & Correction<br />-=namma Angels™=-<br />» NikethaDalmia<br />» Neha Sharma<br />» ChanchalJalan<br />
  2. 2. The problem»<br />Many Factors can alter one or more bits of a message during transmission.<br />Single bit error<br />Burst error (2 or more bits altered)<br />Solution?<br />Detect if there was an error.<br />Its easy to determine if an error has occurred.<br />Simple answer Y/N<br />Correction:<br />Knowledge of exact number of corrupted bits.<br />Knowledge of exact position of error.<br />
  3. 3. So how do we correct?»<br />Retransmission<br />Detect an error<br />Repeatedly request sender to resend.<br />Forward Error Correction<br />Receiver tries to guess the correct code.<br />Coding:<br />Block Coding<br />Complex Convolution code (wiki definition included)<br />In telecommunication, a convolutional code is a type of error-correcting code in which (a) each m-bitinformation symbol (each m-bit string) to be encoded is transformed into an n-bit symbol, where m/n is the code rate (n ≥ m) and (b) the transformation is a function of the last k information symbols, where k is the constraint length of the code.<br />
  4. 4. Coding<br />The Addition of redundant bits<br />The concept of Block Coding:<br />Each message of k bits are datawords.<br />Add r redundant bits.<br />The resulting n=k+rblocks are codewords.<br />No. of possible codewards larger than possible datawords.<br />2n – 2kcodewords not used<br />These are invalid, and help in error detection.<br />
  5. 5. Our Own c++ implementation of error detection and correction.<br />A few terms to grasp first<br />
  6. 6. Hamming code:<br />It is easy to determine how many bits sequences A and B differ by, in the above case 3 bits. <br />The number of bits in which two codewords vary is called the Hamming distance. <br />Note: for two codewords, with Hamming distance d, a total of d single-bit errors are needed to convert one codeword into the other codeword.<br />The Hamming distance of a complete code (A code consists of a number of codewords) is the minimum Hamming distance between any two codewords of that code.<br />
  7. 7. A simple example:<br />A codeword is a binary sequence used to represent an item. <br />ASCII is one such example where a 7 or 8 bit code is used to represent a character. <br />Note, the Hamming distance of ASCII is 1, i.e. changing one bit of an ASCII code will result in another valid ASCII code.<br />
  8. 8. Detection/correction by hamming code:<br />The error detecting and correction properties of a code depend upon its Hamming distance.<br />To detect d errors, a Hamming distance of d+1 is needed (thereby ensuring that it is impossible for d errors to change one valid codeword into another valid codeword).<br />To correct d errors, a Hamming distance of 2d+1 is needed (thereby ensuring that after d errors the original codeword is still the closest match to the corrupted signal, and hence the best match).<br />
  9. 9. The hamming(7,4) algorithm:<br />4 Bit DataWord » 7 bit CodeWord by adding 3 redundant bits (anywhere)<br />This is done by the encoding algorithm.<br />The Received CodeWord is Decoded<br />Errors upto 2 bits can be detected.<br />But only errors upto 1 bit can be corrected.<br />(Recall the mechanism of Hamming codes)<br />P1<br />P2<br />P3<br />D1<br />D2<br />D3<br />D4<br />
  10. 10. Encoding:<br />p1 = d2 + d3 + d4p2 = d1 + d3 + d4p3 = d1 + d2 + d4<br />Each of the three parity bits are parity for three of the four data bits, and no two parity bits are for the same three data bits. All of the parity bits are even parity<br />There&apos;s a fourth equation for a parity bit that may be used in Hamming codes: p4 = d1 + d2 + d3. Any of the three out of four may be used.<br />One method for transforming four bits of data into a seven bit Hamming code word is to use a 4×7 generator matrix [G], Define d to be the 1×4 vector [d1 d2 d3 d4]<br />
  11. 11. So why a generator matrix?<br />We could have kept it simple:<br />But after thorough analysis we realized…<br />The 4x7 Generator Matrix prevails.<br />| 1 0 1 0 | * |0 1 1 1|<br /> |1 0 1 1| = | | <br /> |1 1 0 1|<br /> (parity equation matrix)<br />
  12. 12. The 4x7 Generator matrix:<br />      | 1 |d1 = | 0 |      | 0 |      | 0 |<br />      | 0 |d2 = | 1 |      | 0 |      | 0 |<br />      | 0 |d3 = | 0 |      | 1 |      | 0 |<br />      | 0 |d4 = | 0 |      | 0 |      | 1 |<br />     | 0 |p1 = | 1 |      | 1 |      | 1 |<br />      | 1 |p2 = | 0 |      | 1 |      | 1 |<br />      | 1 |p3 = | 1 |      | 0 |      | 1 |<br />Arrange the column vectors from the previous steps into a 4×7 matrix such that the columns are ordered to match their corresponding bits in a code word.Using the vectors from the previous steps, the following will produce code words of the form [p1 p2 p3 d1 d2 d3 d4]       | 0 1 1 1 0 0 0 | G = | 1 0 1 0 1 0 0 |      | 1 1 0 0 0 1 0 |      | 1 1 1 0 0 0 1 |Arranging the columns in any other order will just change the positions of bits in the code word. <br />
  13. 13. Example:<br />So 1010 encodes to 1011010. Equivalent Hamming codes represented by different generator matrices will produce different results.<br />Lets test the C++ Encoding code we wrote (not copied)<br />

×