channel coding (ii)
DESCRIPTION
Channel Coding (II). Cyclic Codes and Convolutional Codes. Topics today. Cyclic codes presenting codes: code polynomials systematic and non-systematic codes generating codes: generator polynomials encoding/decoding circuits realized by shift registers Convolutional codes presenting codes - PowerPoint PPT PresentationTRANSCRIPT
1
Channel Coding (II)
Cyclic Codes and Convolutional Codes
ECED4504
2 of 20Topics today
Cyclic codes
– presenting codes: code polynomials
– systematic and non-systematic codes
– generating codes: generator polynomials
– encoding/decoding circuits realized by shift registers Convolutional codes
– presenting codes convolutional encoder code trees and state diagram generator sequences
ECED4504
3 of 20Defining cyclic codes: code polynomial
An (n,k) linear code X is called a cyclic code when every cyclic shift of a code X, as for instance X’, is also a code, e.g.
Each cyclic code has the associated code vector with the polynomial
Note that the (n,k) code vector has the polynomial of degree of n-1 or less. Mapping between code vector and code polynomial is one-to-one, e.g. they specify the same code uniquely
Manipulation of the associated polynomial is done in a Galois field (for instance GF(2)) having elements {0,1}, where operations are performed mod-2
For each cyclic code, there exist only one generator polynomial whose degree equals the number of check bits in the encoded word
2 1
0 1 2 1( ) n n
n np x x p x p x p X
0 1 2 1( )
n nx x x x X
1 0 3 2' ( )
n n nx x x x X
ECED4504
4 of 20The common factor of cyclic codes
GF(2) operations (XOR and AND):
Cyclic codes have a common factor pn+1. In order to see this we consider summing two (unity shifted) cyclic code vectors:
Question is how to make the cyclic code from the multiplied code? Adding the last two equations together reveals the common factor:
Modulo-2 Addition+ 0 10 0 11 1 0
Modulo-2 Multiplication* 0 10 0 01 0 1
2 1
1 0 1 2
2 1
0 1 2 1
2 1
0 1 2 1( )
'( )
( )
n
n n
n n
n n
n n
n np x x p x p x p
p x x p x p x p
p p x p x p x p x p
X
X
X
1 1 1( ) '( ) ( 1)n n
n n np p p x p x x p X X
Right rotated
Right shifted by multiplication
Unshifted
ECED4504
5 of 20Factoring cyclic code generator polynomial
Any factor of pn+1 (Note: decompose it into factors) with the degree q=n-k generates an (n,k) cyclic code
Example: Consider the polynomial p7+1. This can be factored as
For instance the factors 1+p+p3 or 1+p2+p3, can be used to generate an unique cyclic code. For a message polynomial 1+p2 (I.e. 110), the following encoded word is generated:
and the respective code vector (of degree n-1, n=7, in this case) is
7 3 2 31 (1 )(1 )(1 )p p p p p p
2 3 2 5(1 )(1 ) 1p p p p p p
(111 0 0 1 0)
ECED4504
6 of 20Obtaining a cyclic code from another cyclic code
Therefore unity cyclic shift is obtained by (1) multiplication by p where after (2) division by the common factor yields a cyclic code
and by induction, any cyclic shift is obtained by
Example:right shift 101
(n=3)
Important point is that division by mod pn+1 and multiplication by the generator polynomial is enabled by tapped shift register.
'( ) ( )mod( 1)np p p p X X
( ) ( )( ) ( )mod( 1)i i np p p p X X
2101 ( ) 1p p X3( )p p p p X
3
( ) 11 110
1 1 pp p
p
X
not a three-bit code,divide by the common factor
33
3
1
1
1
1
p pp
p
p
ECED4504
7 of 20Using shift registers for multiplication
Figure shows a shift register to realize multiplication by 1+p2+p3
In practice, multiplication can be realized by two equivalent topologies:
ECED4504
8 of 20Example: multiplication by using a shift register
2 3
2 3
(1 )(1 )
1
p p p
p p
3p p 4
2 41 11101
p
p p p
out1 1 0 0 0 0 0 0 0 0 00 1 1 0 0 0 0 0 0 0 00 0 1 1 0 0 0 0 0 0 00 0 0 1 1 0 0 0 0 0 10 0 0 0 1 1 0 0 0 0 10 0 0 0 0 1 1 0 0 0 10 0 0 0 0 0 1 1 0 0 00 0 0 0 0 0 0 1 1 0 10 0 0 0 0 0 0 0 1 1 0
determined by the tapped connectionsword to be
encoded
adding dashed line would enable division by 1+pn
Encoded word
ECED4504
9 of 20Examples of cyclic code generator polynomials
The generator polynomial for a (n,k) cyclic code is defined by
and G(p) is a factor of pn+1. Any factor of pn+1 that has the degree q may serve as the generator polynomial. We noticed that a code is generated by the multiplication
where M(p) is a block of k message bits. Hence this gives a criterion to select the generator polynomial, e.g. it must be a factor of pn+1.
Only few of the possible generating polynomials yield high quality codes (in terms of their minimum Hamming distance)
1
1 1( ) 1 ,q q
qp g p g p p q n k
G
( ) ( ) ( )p p pX M G
Some cyclic codes:
3( ) 0 1p p p G
ECED4504
10 of 20Systematic cyclic codes
Define the length q=n-k check vector C and the length-k message vector M by
Thus the systematic n:th degree codeword polynomial is
1
0 1 1( ) k
kp m m p m p
M 1
0 1 1( ) q
qp c c p c p
C
1
0 1 1
1
0 1 1
( ) ( )
( ) ( )
n k k
k
q
q
q
p p m m p m p
c c p c p
p p p
X
M C
Check bits determined by:
( ) mod ( ) / ( )n kp p p pC M G
check bits
message bits
ECED4504
11 of 20Determining check-bits
Prove that the check-bits can be calculated from the message bits M(p) by ( ) mod ( ) / ( )n kp p p pC M G
( ) / ( ) ( ) ( ) / ( )n kp p p p p p M G Q C G
0
( ) / ( ) ( ) / ( ) ( ) ( ) / ( ) ( ) / ( )n kp p p p p p p p p p
M G C G Q C G C G
( )
( ) ( ) ( ) ( )n k
p
p p p p p
X
M C G Q checkmessage
3 2
3
7 4 6 4
( ) 1
( )
( )
p p p
p p p
p p p p
G
M
M
3 2
3 3 6 4
3 2 3 2 6 4
( )( )
( ) / ( ) 1 1
( ) ( ) ( ) 1 1
( ) ( ) ( 1)( 1) 1
n k
n k
pp
p p p p p
p p p p p p p p
p p p p p p p p
CQ
M G
M C
Q G
Example: (7,4) Cyclic code:
must be a systematic codebased on its definition (previous slide)
10 / 2 /4 42
( )pC
ECED4504
12 of 20Example: Encoding of systematic cyclic codes
ECED4504
13 of 20Decoding cyclic codes
Every valid, received code word R(p) must be a multiple of G(p), otherwise an error has occurred. (Assume that the probability for noise to convert code words to other code words is very small.)
Therefore dividing the R(p)/G(p) and considering the remainder as a syndrome can reveal if the error has happened and sometimes also to reveal in which bit (depending on code strength)
The error syndrome of n-k-1 degree is therefore
This can be expressed also in terms of error E(p) and the code word X(p)
( ) mod ( ) / ( )p p pS R G
( ) ( ) ( )p p p R X E
( ) mod ( ) ( ) / ( )
( ) mod ( ) / ( )
p p p p
p p p
S X E G
S E G
error syndrome S(p) is:
ECED4504
14 of 20Decoding cyclic codes: example
16.20 ( ) mod ( ) / ( )s x e x g xUsing denotation of this example:
ECED4504
15 of 20
( )g x
( ) mod ( ) / ( )s x r x g x
Table 16.6Decoding cyclic codes (cont.)
msgcode
error
error
syndrome
ECED4504
16 of 20Part II. Convolutional coding
Block codes are memoryless Convolution codes have memory that utilizes previous bits to encode or
decode following bits Convolutional codes are specified by n, k and constraint length that is
the maximum number of information symbols upon which the symbol may depend
Thus they are denoted by (n,k,L), where L is the code memory depth Convolutional codes are commonly used in applications that require
relatively good performance with low implementation cost Convolutional codes are encoded by circuits based on shift registers and
decoded by several methods as Viterbi decoding that is a maximum likelihood method Sequential decoding (performance depends on decoder
complexity) Feedback decoding (simplified hardware, lower performance)
ECED4504
17 of 20Example: convolutional encoder
Convolutional encoder is a finite state machine processing information bits in a serial manner
Thus the generated code word is a function of input and the state of the machine at that time instant
In this (n,k,L)=(2,1,2) encoder, each message bit influences a span of n(L+1)=6 successive output bits that is the code constraint length
Thus (n,k,L) convolutional code is produced that is a 2n(L-1) state finite-state machine
2 1'
j j j jx m m m
2''
j j jx m m
1 1 2 2 3 3' '' ' '' ' '' ...
outX x x x x x x (n,k,L) = (2,1,2) encoder
ECED4504
18 of 20(3,2,1) Convolutional encoder
3 2'
j j j jx m m m
3 1''
j j j jx m m m
2'''
j j jx m m
Here each message bit influences a span of n(L+1)=3(1+1)=6 successive output bits
ECED4504
19 of 20
2 1'
j j j jx m m m
2''
j j jx m m
1 1 2 2 3 3' '' ' '' ' '' ...
outX x x x x x x
Tells how one input bitis transformed into two output bits(initially register is all zero)
Representing convolutional code: code tree
ECED4504
20 of 20Representing convolutional codes compactly: code trellis and state diagram
Shift register states
Input state ‘1’ indicated by dashed line