1 / 31

Error Correcting Code

Error Correcting Code. Dr. W. C. Shiu Hong Kong Baptist University Department of Mathematics. Examples:. Let us vonsider the following example. I am a dog, so you have to worship me. Meet me at 8:00 c.m. Parity Check: ISBN-10 ( I nternational S tandard B ook N umber). 0-471-61884- 5.

davis
Download Presentation

Error Correcting Code

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Error Correcting Code Dr. W. C. Shiu Hong Kong Baptist University Department of Mathematics

  2. Examples: • Let us vonsider the following example. • I am a dog, so you have to worship me. • Meet me at 8:00 c.m.

  3. Parity Check: ISBN-10 (International Standard Book Number) 0-471-61884-5 In general, assume the first 9 digits of an ISBN is a1a2…a9, where 0  ai  9 for 1  i  9, then the tenth digit (the check digit) is where 0  a10  10. If a10=10, then use X to instead of it.

  4. Parity Check: ISBN-13 Jan. 1, 2007, ISBN-13 will instead of ISBN-10 How do we convert ISBN-10 to ISBN-13?

  5. Parity Check: ISBN-13 • Drop the check digit from the existing ISBN-10 • Add the prefix 978 or 979 (usually is 978) • Calculate the check digit using modulo 10: Suppose the 13 digits is a1a2…a13, where 0  ai  9 for 1  i  13, then it satisfies

  6. Parity Check: ISBN-13 • Original ISBN-10: 0-471-61884-5 • New ISBN-13: 978- 0-471-61884-? The new ISBN-13 is 978- 0-471-61884-4

  7. 香港身份證號碼 X354670(?) 身份證號碼的「結構」,可以用abcdef (z)表示。「」可能是「空格」或是一個英文字母,「  」則必定是英文字母。「 abcdef 」代表一個六位數字,而「z」是作為檢碼之用,它的可能選擇是0, 1, 2, ... , 9, A(代表10)。這些代號的背後,都可配上一個編碼值。透過編碼值,便可找出 9+8+7a+6b+5c+4d+3e+2f+z 的總和。該總和特別之處,是必須被11整除。利用這特點,我們便能找出括號內的數字。試試看!

  8.  或  的編碼值:

  9. X354670(?) 9(58)+8(33)+7(3)+6(5)+5(4)+4(6)+3(7)+2(0)+z = 902+z 被11整除,所以z=0。 我們可利用Modular arithmetic來簡化運算。 z = 987a6b5c4d3e2f  2+3+4a+5b5c4d3e2f (mod 11) 所以 z  2(58)+3(33)+4(3)+5(5)  5(4)  4(6)  3(7)  2(0)  2(3)+3(0)+12+252024210  6+0+1+3+22+10=11  0 (mod 11) 即 X354670(0) 是正確的香港身分證號碼。

  10. Message We think of a message as a block of symbols from a finite alphabet. A commonly used alphabet is the set of two symbols 0 and 1. A possible message is 1001. This message is then transmitted over a communications channel that is subject to some amount of noise.

  11. Noise e Message Channel Received Message v=0001 u=1001 No Encoding-Decoding System

  12. Noise e Message Encoder Channel u=1001 Eu=b=1001100 Message Decoder Received Message E-1(Dc)=1001 Dc=1001100 c=b+e=0001100 Encoding-Decoding System

  13. Binary Symmetric Channel (BSC) No memory. Receives and transmits two symbols 0 and 1. The BSC has the property that with probability q a transmitted digit will received correctly, and with probability p=1q it will not be. Boolean sum and product:

  14. Encoded Message • Digits in the original message : Information digits • Digits added by the encoder : Redundancy digits Length of a code = the number of information digits + the number of redundancy digits

  15. Examples of single-error detecting code: 1. Repetition code: Each message is repeated once. 2. Even-parity check code: Add an extra digit to the message. It is a 0 if there are an even number of 1’s, otherwise a 1.

  16. Examples of Single-Error Correcting Code Repetition code: Each message is repeated twice. It can also correct some double errors and more errors. 100110011001100010111001100110011001 100110011001100010001001100010001000 100110011001100010110101100110011001

  17. If u=(u1,u2,u3,u4), then we decode it as b=uG. Examples of Single-Error Correcting Code Hamming (7,4) code: Given a matrix

  18. Let d=DcT, where For this example Examples of Single-Error Correcting Code The error occurred at the 4th position. D is called a parity check matrix.

  19. Repetition code: Probability for Correct Sending Suppose we are transmitting a message of 4 digits on a binary channel and q=0.9. Then the probability of correctly sent for No coding: q4=0.6561; Hamming code:  q7+7q6p  0.8503.

  20. Probability for Correct Sending • Rate of a code is the ratio of the number of information digits with the length of the code. • Rate of the repetition code is 1/3. • Rate of the Hamming code is 4/7.

  21. Linear Codes An (n, k) linear codeC over a finite field F is a k-dimensional vector subspace in Fn. Elements of C is called codeword. If F={0, 1}, then C is called a binary code Any kn matrix G whose rows are the basis vectors of C is called a generator matrix. This means that for each C, there exists b=(b1,…,bk) such that =bG. There exists (will show a proof later) an (nk)n matrix H called parity checkmatrix of C such that

  22. By applying a sequence of elementary row operations and column operations, we may assume Proof: and rank(H)=n-k Linear Codes Theorem :If an (n, k) code C over a field has a generator matrix G=(Ik A), then H=(-AT In-k) is a parity check matrix of C.

  23. Parity check matrix Hamming (7,4) code Generating matrix

  24. Decoding Scheme • Let  Fn . The weight of  is defined by wt() the number of nonzero digits in =(a1,…,an). • The distance of two vectors , Fn is defined by d(,)=wt(). • The method of decoding a received vector to the closest codeword. It is called maximum-likelihood decoding.

  25. For binary code, if u is transmitted and v is received, then the error e is defined to be Then d(u,v)=wt(e). Thus the decoded codeword is chosen such that Decoding Scheme

  26. Mini-example Consider a binary code C with generator matrix Therefore, C={0000, 1010, 0111, 1101}. The number of all binary sequences of length 4 are 16.

  27. Mini-example A decoding scheme is Another decoding scheme is

  28. Detect and Correct Errors The minimum weightdof a code is defined to be the minimum value among all nonzero codewords. Theorem:C can detect t errors if and only if t=d-1. Theorem:C can correct t errors if and only if t=[(d-1)/2].

  29. The decoding scheme is to choose a (fixed) vector such that , and then to decode the received vector to Decoding Scheme Suppose u is transmitted, v is received and e is the error, i.e., u+e=v. Then HvT=H(u+e)T=HuT+HeT=HeT.

  30. Hamming Code Hamming (7,4)-code or Ham(3,2) Hamming (15,11)-code or Ham(4,2) Any Hamming code can only correct one error.

  31. Hamming Code Given 15 coins which should be of equal weight, but you are told that there may be one that is different from the others. You have a balance on which to compare the weights of different coins or sets of coins. Devise a scheme using four balance checks to determine which coin, if any, has the wrong weight.

More Related