7. linear codes

Upload: james-lawson

Post on 05-Apr-2018

221 views

Category:

Documents


3 download

TRANSCRIPT

  • 7/31/2019 7. Linear Codes

    1/23

  • 7/31/2019 7. Linear Codes

    2/23

    Binary Block Codes

    Definition of Binary Block Code:A binary block code is a subset of for some n.Elements of the code are called code words

    Definition of Linear Code:

    A linear code is a linear subspace of

    Definition of Minimum Distance:The minimum distance of a linear code is the minimum ofthe weights of the non-zero code words

    Bn

    Bn

  • 7/31/2019 7. Linear Codes

    3/23

    Example

    The following two-dimensional codes in haveminimum distance 1

    The code {000, 011, 101, 110} has minimum distance 2

    3B

  • 7/31/2019 7. Linear Codes

    4/23

    Binary Block Codes

    IfL is a k-dimensional subspace of , then we can find abasis for L consisting ofkcode words in

    Every code word in L is a linear combination of the basiscode words

    B

    n

    1 2, , ,

    kb b b B

    n

  • 7/31/2019 7. Linear Codes

    5/23

    Binary Block Codes

    Definition of Generator Matrix:A generator matrix for a linear code is a binary matrixwhose rows are the code words belonging to some basisfor the code

    A generator matrix for a k-dimensional linear code is ak x n matrix whose rank is k

    A rankis the number oflinearly independent rows or

    column in a matrix

  • 7/31/2019 7. Linear Codes

    6/23

    Example 1

    The code {0000, 0001, 1000, 1001} is a two-dimensionallinear code in B4

    The basis of this code is {0001, 1000}

    To find the code words from the generator matrix

  • 7/31/2019 7. Linear Codes

    7/23

    Example 2

    The code {0000, 0011, 0110, 1100, 0101, 1111, 1010,1001} is a three-dimensional linear code in B4

    The basis of this code {0011, 0110, 1100}

    Thus, the generator matrix is

    The code words can be obtained:

  • 7/31/2019 7. Linear Codes

    8/23

    Example 2 (Contd)

    If we use basis of {0101, 1001, 1010}, the generator matrixwill be

    The code words are

  • 7/31/2019 7. Linear Codes

    9/23

    Example 3

    The generator matrix ofrank3 is given below

    The code words are

  • 7/31/2019 7. Linear Codes

    10/23

    Binary Block Codes

    Definition of Elementary Row Operation:An elementary row operation on a binary matrix consistsof replacing a row of the matrix with the sum of that rowand any other row

    If we have a generator matrix G for a linear code, allother generator matrices for L can be obtained byapplying a sequence of elementary row operations to G

  • 7/31/2019 7. Linear Codes

    11/23

    Binary Block Codes

    Definition of Equivalent Codes:

    Two codes are equivalent if each can be constructed from theother by reordering the bits of each code word in the sameway

    Definition of Canonical Form:The generator matrix G of a k-dimensional linear code in Bn isin canonical form if it is of the form:

    where I is a k x k identity matrix and A is an arbitrary

    k x (n k) binary matrix

    |G I A

  • 7/31/2019 7. Linear Codes

    12/23

    Example

    We have

    To make canonical form, we conduct the following steps

    The code generated by the canonical form: {0000, 1000,0100, 1100}

    It has minimum distance 1

  • 7/31/2019 7. Linear Codes

    13/23

    Binary Block Codes

    Definition of Parity Check Matrix:The parity check matrix of a linear code with k x ngenerator matrix G is the k x n matrix H satisfying

    where HT is the transpose ofH and 0 denotes thek x (n k) zero matrix

    0

    TGH

  • 7/31/2019 7. Linear Codes

    14/23

    Binary Block Codes

    If G is canonical form, then

    If G is not canonical, we can find H by:

    reducing G to canonical from

    finding the canonical form of H by using the equation above

    reversing the column operations used to convert G tocanonical form to convert G the canonical form of H to the

    parity check matrix of G

    |T

    H A I

  • 7/31/2019 7. Linear Codes

    15/23

    Example 1

    The canonical matrix G is given

    with

    The H is obtained by transposing A and adjoining a 2 x 2identity matrix to get

    By definition

  • 7/31/2019 7. Linear Codes

    16/23

    Example 2

    The generator matrix for linear code {000, 101, 011, 110}is

    The parity check matrix is

    If we calculate all the elements of the B3, it results

  • 7/31/2019 7. Linear Codes

    17/23

    Binary Block Codes

    IfL is a k-dimensional linear code inBn

    , and G is agenerator matrix for L, every code word in L can beobtained by taking some and multiplying it by G,to get the code word bG.

    If we now multiply this by the transpose of the paritycheck matrix H, we get

    kb B

    0 0T TbG H b GH b

  • 7/31/2019 7. Linear Codes

    18/23

    Example

    The linear code {0000, 0011, 1100, 1111} has generatormatrix of

    The parity check of this matrix is

    We can check

  • 7/31/2019 7. Linear Codes

    19/23

    Encoding and Decoding

    If we assume the corruption occured while transmissionthrough a BSC and we use ML, it follows that a corruptedstring should be restored to the code word which isclosest to it

    Suppose that generator matrix G generates the linear

    code L, and the code word w is corrupted by a noisevector e, the result is x = w + e

    Ifx is not the code word, the decoder must find theclosest code word y (the error vector is smallest)

    Ifx is not a code word, it belongs to the coset x + L,which is x = e + u where and e is the vector ofleast weight in the coset

    Lu

  • 7/31/2019 7. Linear Codes

    20/23

    Encoding and Decoding

    Definition of Syndrome:

    If L is a linear code with generator matrix G and paritycheck matrix H, the syndrome ofx is given by

    Procedure for removing noise: Draw up the syndrome table: list of the cosets, showing the

    vector of minimum weight and the syndrome

    When a string that is not a code word is received, compute itssyndrome

    Add the vector of minimum weight from the correspondingcoset to the corrupted string to recover the uncorrupted codeword

    Ts H x

  • 7/31/2019 7. Linear Codes

    21/23

    Example

    Suppose that the parity check matrix of the linear code L

    To draw up the syndrome table, we start with the

    elements of L, which have syndrome 00

    syndrome code words Error vector

  • 7/31/2019 7. Linear Codes

    22/23

    Example (Contd)

    We choose a vector that does not belong to L andcompute its syndrome. If we choose 0001, whosesyndrome is 10, we add this vector to all the code words

    If we choose 0110, the syndrome is 11

  • 7/31/2019 7. Linear Codes

    23/23

    Example (Contd)

    Then, we choose 0100 whose syndrome is 01

    If we receive the vector 1010, we compute the syndrome,which is 11

    We add the vector of minimum weight in the coset withsyndrome 11 to 1010, so the corrected code word is1111