error correcting codes_oon

Upload: noranisah-binti-nakim

Post on 14-Apr-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 Error Correcting Codes_oon

    1/37

    Error correcting codes

    Oon Boey Lay

    Rujukan: EMM400 StudyGuideFAEMM400Tasks&Solns1

  • 7/29/2019 Error Correcting Codes_oon

    2/37

    The need for powerful (and public) encryption

    has grown out of our ever increasing reliance

    on digital information you will no doubt

    have seen yourselves how when you

    sometimes go to or leave a web page you are

    told that the page is (or is not) encrypted for

    security purposes. Security issues arise notonly in the public domain but also in the

    secrecy that surrounds military operations.

  • 7/29/2019 Error Correcting Codes_oon

    3/37

    There is a conflict between governments

    trying to restrict the use of encryption which

    they regard as a tool for terrorists, and civil

    libertarians who argue that encryption is

    necessary to protect privacy

  • 7/29/2019 Error Correcting Codes_oon

    4/37

    Another product of the digital age is error-

    correcting codes. This area of mathematics

    began just 60 years ago in 1948.

  • 7/29/2019 Error Correcting Codes_oon

    5/37

    Have you ever wondered how satellites send

    photographs back to earth? Or why you cant

    just invent a credit card number when you try

    to buy something on the internet? Or how you

    can be sure when you deposit money into an

    ATM that the correct amount will go to your

    account?

  • 7/29/2019 Error Correcting Codes_oon

    6/37

    We will begin by looking at:

    what are error-correcting codes and why we

    need them;

    the Mariner 6 space mission; and

    some examples of error-correcting codes.

  • 7/29/2019 Error Correcting Codes_oon

    7/37

    The Mariner 6 space mission

    In 1965, the USAs Mariner 4 was the first

    spaceship to photograph Mars. At that time,

    each picture took 8 hours to transmit. Later

    Mariner missions, such as Mariner 6,

    produced improved pictures, using what are

    called error-correcting codes.

  • 7/29/2019 Error Correcting Codes_oon

    8/37

    Mariner 6 spaceship sending pictures from Mars

  • 7/29/2019 Error Correcting Codes_oon

    9/37

    FIGURE 2.2

    Converting Mariner 6

    pictures to binary digits

    In order to transmit pictures, a fine grid was placed on the

    picture and each square or what we would now refer to

    as a pixel, was given a degree of blackness ranging from 0 to 63

  • 7/29/2019 Error Correcting Codes_oon

    10/37

    0 0000001 000001

    2 000010

    3 000011

    4

    0001005 000101

    6 000110

    7 000111

    8 001000

    9 001001

    43 101011

    63

    111111

    Each of these numbers was written as a sequence of six 0s and

    1s, for example by writing it in the binary system (that is, in

    base 2), as shown below.

  • 7/29/2019 Error Correcting Codes_oon

    11/37

    So we have degree of blackness = 43

    101011.

    In the case of Mariner 6, each picture was

    broken up into 700 x 832 squares, so if each

    square was coded using 6 binary digits, each

    picture would consist of a sequence of 6 x 700

    x 832 = 3 494 400 binary digits.

  • 7/29/2019 Error Correcting Codes_oon

    12/37

    However, while the degree of blackness of

    each square consisted of a six binary digits,

    the message that was sent actually used many

    more digits for each degree of blackness in

    fact 32 binary digits were sent for each

    square, so each picture consisted of a

    sequence of 32 x 700 x 832 = 18 636 800binary digits.

  • 7/29/2019 Error Correcting Codes_oon

    13/37

    Message to

    betransmitted

    Coder

    Binary code

    to betransmitted

    Decoder

    Binarycode

    received

    Channel

    transmittingcode

    Messagereceived

    Transmitting data through a communication channel

  • 7/29/2019 Error Correcting Codes_oon

    14/37

    Errors introduced by noise

  • 7/29/2019 Error Correcting Codes_oon

    15/37

    If we have many errors like this they will affectthe quality of the picture that is received andwe cannot really ask for the message to be

    repeated. This is the reason we need error-correcting

    codes.

    Error-correcting codes combat error byintroducing redundancy by including moresymbols than is necessary for the message.

  • 7/29/2019 Error Correcting Codes_oon

    16/37

    Digital alphabet

    The process of encoding a message usuallybegins with the conversion of ordinary textinto a string of numbers by means of a digitalalphabet like the one shown below. In the

    code shown in Figure 2.6, each letter (and afew punctuation marks) are represented by asequence of 0s and 1s of length 5 we canthink of these sequences as being thenumbers between 0 and 32 written in thebinary (base 2) system.

  • 7/29/2019 Error Correcting Codes_oon

    17/37

    = 00000A = 00001 B = 00010 C = 00011 D = 00100

    E = 00101 F = 00110 G = 00111 H = 01000 I = 01001

    J = 01010 K = 01011 L = 01100M = 01101N = 01110

    O = 01111 P = 10000 Q = 10001 R = 10010 S = 10011

    T = 10100 U = 10101V = 10110W = 10111 X = 11000

    Y =

    110001

    Z = 11010 , = 11011 . = 11100 ? = 11101

    : = 11110 ; = 11111

    A binary code using the numbers 0 to 32 in base 2

  • 7/29/2019 Error Correcting Codes_oon

    18/37

    So, for example, if I were to write my name in

    this code I would get:

    SUSIE 10011 10101 10011 01001 00101

    ACTIVITY 2.1

    Write your name using the binary code

    above.

  • 7/29/2019 Error Correcting Codes_oon

    19/37

    An example of a single-error-correcting code

    In this example, we will assume that everymessage we want to transmit consists of just 3binary digits. There are 8 such possible messages,

    so we could think of them as representing theintegers from 0 to 7.

    In this example, we will add an extra 5 redundantdigits to each message as shown below to give

    codewords oflength 8. (Right now we wont tryto explain how we choose the extra digits.)

  • 7/29/2019 Error Correcting Codes_oon

    20/37

    0 = 000 000 00000

    1 = 001 001 10110

    2 = 010 010 10101

    3 = 011 011 00011

    4 = 100 100 10011

    5 = 101 101 00101

    6 = 110 110 00110

    7 = 111 111 10000

    A single-error-correcting code of length 8

  • 7/29/2019 Error Correcting Codes_oon

    21/37

    ACTIVITY 2.2

    Check that every codeword differs

    from every other codeword inexactly four places.

  • 7/29/2019 Error Correcting Codes_oon

    22/37

    Imagine that we receive the following

    message: 00111110

    we see that the codeword closest to 00111110

    is 00110110.

    It differs in just one place the fifth place

    (underlined here).

    hence the name single-error-correcting code.

  • 7/29/2019 Error Correcting Codes_oon

    23/37

    In this example, we have:

    8 digit codewords with

    3 information digits and 5 redundant digits.

    So we can say this code has information rate

    = 3/8

  • 7/29/2019 Error Correcting Codes_oon

    24/37

    Repetition codes

    One simple way of introducing redundancy is

    to repeat everything. So if we have a message

    we could decide to code it by repeating each

    digit n times.

    For example, ifn = 5, we get a repetition code

    oflength 5.

  • 7/29/2019 Error Correcting Codes_oon

    25/37

    S 10011 11111 00000 00000 11111 11111

    U 10101 11111 00000 11111 00000 11111

    S 10011 11111 00000 00000 11111 11111

    I 01001 00000 11111 00000 00000 11111

    E 00101 00000 00000 11111 00000 11111

    In my example earlier, my name would be coded as

    shown below.

  • 7/29/2019 Error Correcting Codes_oon

    26/37

    For example what should we do if we receive

    the following message:

    11011 00110 11000 10000 10111 ?

  • 7/29/2019 Error Correcting Codes_oon

    27/37

    A decoding algorithm for a repetition code of length 5

    The following is an example of a decoding

    algorithm for any one 5-digit block:

    Count the number of 1s.

    If number of 1s 3 , write 11111.

    If number of 1s 2 , write 00000.

  • 7/29/2019 Error Correcting Codes_oon

    28/37

    00000 10010 11011 11000 01111

    11110 01010 01000 01011 00001

    00111 10000 01100 11100 00000

    01000 11111 00111 10111 11101

    01111 00010 01000 10111 10000

    ACTIVITY 2.3

    You receive the following message, which was sent

    using the alphabet from Activity 2.1 and a repetitioncode of length 5.

  • 7/29/2019 Error Correcting Codes_oon

    29/37

    Convert the message to the 5 digit binary

    code.

    Use the alphabet from Activity 2.1 to convert

    it to ordinary letters.

  • 7/29/2019 Error Correcting Codes_oon

    30/37

    00000 11011 01111 00100 11111

    01000 11111 00100 00001 11101

    11101 00100 00000 11110 01111

    11111 10000 01000 00000 00100

    10111 00010 10000 00111 01100

    01100 10001 01010 00011 11001

    01010 10111 01111 11111 00000

    11111 00010 11011 01000 00000

    ACTIVITY 2.4

    Using the same code as in Activity 2.3, you receive the

    following message:

  • 7/29/2019 Error Correcting Codes_oon

    31/37

    Convert the message to the 5 digit binary

    code.

    Use the alphabet from Figure 2.6 to convert it

    to ordinary letters.

    What message do you think was really

    intended?

  • 7/29/2019 Error Correcting Codes_oon

    32/37

    Single parity-check codes

    Single parity-check codes are the other

    extreme from repetition codes. While

    repetition codes have a single message digit,

    single parity-check codes have only one checkdigit.

    The check digit is obtained by taking the sum

    of the information digits mod 2.

  • 7/29/2019 Error Correcting Codes_oon

    33/37

    A 000001 1

    5 messagedigits

    1check digit

    B 000010 1

    C 000011 0

    D 000100 1

    So, for example, using the code in Figure 2.6, we get

  • 7/29/2019 Error Correcting Codes_oon

    34/37

    In general, the codewords look like c1 c2 c3 c4

    c5 c6 where

    c6 = c1 +c2 +c3 +c4 + c5(mod 2).

  • 7/29/2019 Error Correcting Codes_oon

    35/37

    ACTIVITY 2.8

    Find the codewords representing each of the following letters in thesingle-parity-check code above: J , L , Q , S , G , X.

    ACTIVITY 2.9

    Write the message NO ERRORS in the single-parity-check code above.

    ACTIVITY 2.10

    The following message is received in the single-parity-check code:

    000011 000000 001111 011110 010110 001001000000 100100 001010 100111 101001 011000

    101000 Detect the places where the errors occur.

    Decode the remaining letter.

    Use guesswork to complete the message.

  • 7/29/2019 Error Correcting Codes_oon

    36/37

    The information rate is =

    which is very high!

    However, a single-parity-check code can only

    detectan odd number of errors and cannot

    correct them!

    n

    n 1

    n

    k

    SINGLE-PARITY- CHECK CODE

  • 7/29/2019 Error Correcting Codes_oon

    37/37