Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linear Codes.

Similar presentations


Presentation on theme: "Linear Codes."— Presentation transcript:

1 Linear Codes

2 Outline [1] Linear codes [2] Two important subspaces
[3] Independence,basis,dimension [4] Matrices [5] Bases for and [6] Generating matrices and encoding [7] Parity-check matrices [8] Equivalent codes [9] Distance of a linear code [10] Cosets [11] MLD for linear codes

3 Linear Codes [1] Linear codes A code C is called a linear code if
v+w is a word in C if v and w are in C C must contain the zero word C is a linear code iff C is a subspace of Kn We will use the knowledge of subspace to dramatically improve our techniques for encoding and decoding The distance of a linear code is equal to the minimum weight of any nonzero codeword(ex2.1.4) Advantage simpler procedure for MLD faster encoding and less storage space straightforward calculation for error patterns are easily describable

4 Linear Codes [2] Two important subspaces <S> : Linear span of S
Linear combination:w Linear span of S: the set of all linear combinations of the vectors in set S Theorem 2.2.1: For any subset S of Kn , the code C=<S> generated by S consists precisely of the following words:the zero word , all words in S, and all sums of two or more words in S. Example: vector: scalar:

5 Linear Codes Dual code of C Scalar product: Orthogonal:
Orthogonal complement of S : (a subspace of Kn) The set of all vectors orthogonal to the set S of vectors Dual code of C : If C = <S> , then Example:

6 Linear Codes [3] Independence, basis, dimension Linear independent
Definition:A set of vectors is linearly independent if for all scalars such that iff Example: S2 is a linearly dependent set. S1 is a linear independent set.

7 Linear Codes Basis: Dimension:
A nonempty subset B of vectors from a vector space V is a basis for V if both B spans V ( that is , <B>=V ) B is a linearly independent set Example: Dimension: The number of elements in any basis for a vector space is called the dimension of the space.(all bases for a vector space contain the same number of elements.) a linearly independent set S is a basis for C The dimension of C is 3

8 Linear Codes C : linear code of dimension k with basis
C has precisely different bases Example: How many bases for K4 ? (24-1)(24-2)(24-22)(24-23)/4! = 840 w in C can be expressed as a unique lin comb of the basis vectors There are 2k choices of ai, and hence 2k words in C

9 Linear Codes [4] Matrices Zero matrix Identity matrix
Elementary row operations: Interchanging two rows Replacing a row by itself plus another row

10 Linear Codes Leading 1: Leading column: REF:row echelon form
a 1 in a matrix M such that there are no 1s to its left in the same row. Leading column: a column of M contains a leading 1. REF:row echelon form The zero rows of M are all at the bottom, and each leading 1 is to the right of the leading 1s in the rows above. RREF: reduced row echelon form Each leading column of M contains exactly one 1

11 Linear Codes [5] Bases for Algorithm 2.5.1:finding a basis for C
Form the matrix A whose rows are the words in S. Use elementary row operations to find a REF of A. Then the nonzero rows of the REF form a basis for C=<S> Example: is a basis

12 Linear Codes Algorithm 2.5.4:finding a basis for C
Form the matrix A whose columns are the words in S. Use elementary row operations to place A in REF and locate the leading columns in the REF. Then the original columns of A corresponding to these leading columns form a basis for C=<S> Example: Columns 1, 2, and 4 are the leading columns is a basis

13 Linear Codes Algorithm 2.5.7:finding a basis for
Use elementary row operations to place A in RREF. Let G be the kxn matrix consisting of all the nonzero rows of the RREF. Form the matrix A whose rows are the words in S. Let X be the kx(n-k) matrix obtained from G by deleting the leading columns of G. Form an nx(n-k) matrix H as follows: In the rows of H corresponding to the leading columns of G, place, in order, the rows of X In the remaining n-k rows of H, place, in order, the rows of the (n-k)x(n-k) identity matrix I Then the columns of H form a basis of

14 Linear Codes Example 2.5.8:

15 Linear Codes Example 2.5.9:n=10.
1. Place A in RREF and delete zero rows to get G. 2.The leading cols of G are cols 1, 4, 5, 7, 9, so we permute the cols of G into the order 1, 4, 5, 7, 9, 2, 3, 6, 8, 10 to form G’. 3. Form H’. 4. Rearrange the rows of H’ to get H. The cols of H form a basis for

16 Linear Codes Why Algorithm 2.5.7 works?
1. Rows of G form a basis of C with dimension k 2. Cols of H form a basis of a linear code with dimension n-k 3. G H = So cols of H form a basis of

17 Linear Codes [6] Generating matrices and encoding
Rank:the number of nonzero rows in any REF of the matrix (n,k,d) linear code C:C has length n , distance d, dimension k Generator matrix: Definition:Any matrix whose rows form a basis for C is called a generator matrix for C. Theorem 2.6.1: A matrix G is a generator matrix for some linear code C iff the rows for G are linearly independent Theorem 2.6.2: If G is a generator matrix for a linear code C, then any matrix row equivalent to G is also a generator matrix for C. In particular, any linear code has a generator matrix in RREF.

18 Linear Codes Example : is a generator matrix for C

19 Linear Codes Encoding: Method: Theorem 2.6.8
If G is a generator matrix for a linear code C of length n and dimension k, then v=uG ranges over all 2k words in C as u ranges over all 2k words of length k . Thus C is the set of all words uG, u in Kk. Moreover, u1G = u2G iff u1=u2

20 Linear Codes Example:

21 Linear Codes [7] Parity-check matrices Parity-check matrix
Definition:a matrix H is called a parity-check matrix for a linear code C if the columns of H form a basis for the dual code Theorem 2.7.1 A matrix H is a parity-check matrix for some linear code C iff the columns of H are linearly independent. Theorem 2.7.2 If H is a parity-check matrix for a linear code C of length n , then C consists precisely of all words v in Kn such that vH = 0.

22 Linear Codes Example:find the parity-check matrix for C
use Algorithm 2.5.7 is a parity-check matrix for C

23 Linear Codes Generator matrix and parity-check matrix Theorem 2.7.6
Matrices G and H are generating and parity-check matrices for some linear code C iff The rows of G are linearly independent The columns of H are linearly independent The number of rows of G plus the number of columns of H equals the number of columns of G which equals the number of rows of H GH = 0 Theorem 2.7.7 H is a parity-check matrix of C iff HT is a generator matrix for transpose Algorithm 2.5.7

24 Linear Codes Example: C:linear code Parity-check matrix:
transpose Algorithm 2.5.7 Linear Codes Example: Parity-check matrix: C:linear code A generator matrix for is The RREF of HT is A parity-check matrix for :

25 transpose Algorithm 2.5.7 Linear Codes From the form of H, we can get the generator matrix G for C: It’s another parity-check matrix for

26 Linear Codes [8] equivalent codes Standard form:G Systematic code:C
k x n matrix G with k<n is in standard form First k columns form k X k identity matrix Ik It has linearly independent rows It is in RREF It is a generator matrix for some linear code of length n and dimension k. Systematic code:C The code C is generated by G which is in standard form. Theorem 2.8.2 If C is an linear code of length n and dimension k with generator matrix G in standard form, then the first k digits in the codeword v=uG form the word u in Kk

27 Linear Codes k n - k information digits
Example: k n - k information digits redundancy (parity-check digits)

28 Linear Codes Theorem 2.8.8 Any linear code C is equivalent to a linear code C’ having a generator matrix in standard form. Example: generator matrix in RREF generator matrix in standard form The code generated by G is equivalent to the code generated by G’.

29 Linear Codes [9] Distance of a linear code
The distance of a linear code can be determined from a parity-check matrix for the code. Theorem 2.9.1 Let H be a parity-check matrix for a linear code C. Then C has distance d iff any set of d-1 rows of H is linearly independent , and at least one set of d rows of H is linearly dependent. Example: No two rows of H sum to 000 Any two rows of H are linearly independent. Rows 1,3, and 4 sum to 000. Rows 1,3, and 4 are linearly dependent d-1 = 2 the distance of C:d = 3

30 Linear Codes [10] Cosets Definition: Theorem 2.10.3
The coset of C determined by u is the set of all words of the form v+u as v ranges over all the words in C. Theorem Let C be a linear code of length n. Let u and v be words of length of n. If u is in the coset C+v, then C+u=C+v The word u is in the coset C+u. If u+v is in C, then u and v are in the same coset. If u+v is not in C, the u and v are in different cosets. Every word in Kn is contained in one and only one coset of C. |C+u|=|C| If C has dimension k, then there are exactly 2n-k different cosets of C, and each coset contains exactly 2k words. The code C itself is one of its cosets.

31 Linear Codes Example: The dimension of C:2 The number of cosets:
The number of words in each coset:

32 Linear Codes [11] MLD for linear codes Decoding coset channel
The error pattern u and the received word w are in the same coset of C Error patterns of small weight are the most likely to occur Example: coset It is hard to find the coset containing w and find a word of least weight in that coset !!!

33 Linear Codes Syndrome C:a linear code of length n and dimension k
Theorem Let C be a linear code of length n. Let H be a parity-check matrix for C. Let w and u be words in Kn. wH=0 iff w is a codeword in C wH = uH iff w and u lie in the same coset of C If u is the error pattern in a received word w, then uH is the sum of the rows of H that correspond to the positions in which errors occurred in transmission. C:a linear code of length n and dimension k H :parity check matrix for C The syndrome of w:

34 Linear Codes SDA:Standard Decoding Array Coset leader u Syndrome uH
0000 00 1000 11 0100 01 0010 10

35 Linear Codes Decoding with SDA Example: channel


Download ppt "Linear Codes."

Similar presentations


Ads by Google