School Of Engineering
Department of Electrical and Electronics
Assignment #2 Submitted by: Submitted to :
Amar Shrestha Mr. Brajesh Mishra
Roll- 32024
________________________________________________________________
LINEAR BLOCK CODES
A systematic (n,k) linear block code is a mapping from a k-dimensional message vector to an ndimensional codeword in such a way that part of the sequence generated coincides with the k message digits. The difference (n − k) represents the parity bits. A systematic linear block will have a [k × n] generator matrix [G] of the form G=[P IK ]
Then the code is given as C= D*G
Where D is the data word.
Another important matrix associated with block codes is the [(n − k) × n] parity check matrix, [H]. The parity check matrix is formed by starting with the identity matrix and appending the transpose of the nonidentity portion of [G]:
H=[IK PT ]
The parity check matrix has the property c[H]T = 0
That is, any errorless, received code word multiplied by the transpose of the parity check matrix, [H], yields a zero vector, or syndrome. If the received code word contains an error, the resulting vector will match the corresponding bit that caused the error. S= R[H]T=E H]T
Where S= error syndrome R= received codeword E=error
Algorithm:
1. Take generator matrix from the user. 2. Create the 4 bit data word, total of 16 data words, using two dimensional array in the matlab. 3. Then code word is generated utilizing the matrix multiplication formula for the code word. 4. Then Hamming distance is determined by the minimum of the number of ones among the individual code words. 5. Now to check for error, first we enter a received code word. 6. Now generate the error syndrome utilising the formula for S. 7. After that, the error location in the received code