1 Convolutional Codes: 1.1 Example
1 Convolutional Codes: 1.1 Example
1.1 Example
Binary convolutional codes are similar to parity check codes in some ways, and
different in others. They are similar, because they are linear and the codewords
can be thought of as a sequence of parity bits, and they can be useful for
detecting and correcting errors. But they are different, because convolutional
codes are not block codes.
The message appropriate for a convolutional code is a sequence m of bits (a
bitstream) that you can imagine arriving one bit at a time, first m0 , then m1 ,
then . . ..
The codeword is another bitstream c that is created one bit at a time, first
c0 then c1 , then . . .. When mk arrives, ck can be computed from mk and a finite
number r of preceding message bits mk1 , mk2 , . . ., mkr .
We explain binary convolutional codes with the standard ubiquitous begin-
ning example. Since its binary, we always add bits mod 2: 1+ 1=0.
Example Code 1 Message stream m produces code stream c.
m = m0 , m1 , m2 , m3 , m4 , . . .
c1 = m0 , m1 , m2 + m0 , m3 + m1 , m4 + m2 , . . . , mk + mk2 .
For example, if
m = 1101001
then
c1 = 111001101.
We can express the encoder as a polynomial multiplication.
Writing m1 = m2 = 0, define
X
m(x) = m0 + m1 x + m2 x2 + = mj xj
j=0
X
c1(x) = m0 + m1 x + (m2 + m0 )x2 + = (mj + mj2 )xj
j=0
1
to the right and all memory of mk2 is lost. We start the process off with 0s
in the memory registers and m0 in the current register.
Waiting current Memory1 Memory2
mk+3 , mk+2 , mk+1 mk mk1 mk2
after shifting
mk+4 , mk+3 , mk+2 mk+1 mk mk1
Example Code 2
Message stream m produces code stream c.
m = m0 , m1 , m2 , m3 , m4 , . . .
c2 = m0 , m1 + m0 , m2 + m1 + m0 , . . . , mk + mk1 + mk2 .
c(x) = (1 + x + x2 )m(x).
2
where we have defined
g(x) = 1 + x + x3 + x4 + x5
m2(x) = m(x2 ).
m 1 1 0 1 0 0 1 0 0
c1 1 1 1 0 0 1 1 0 1
.
c2 1 0 0 0 1 1 1 1 1
c 1 1 1 0 1 0 0 0 0 1 1 1 1 1 0 1 1 1
We say that the code C has rate 1/2 because 1 message bit converts to 2 code
bits. We say that the depth of the code is 2 because it can be implemented with
just 2 memory registers.
1/01
11
1/10 0/10
0/01
10 01
1/00
1/11 0/11
start 00
0/00
In the diagram, the four circles represent the four memory states of the
encoder, defined by the values in its memory register. When bit a is in the
current register, the encoder creates two code bits bc indicated by an arrow
labeled a/bc leaving the current memory state and going to the new memory
state after the shift. For example, the step described by the next picture of
the encoder is represented by the arrow 0/10 from state 11 to state 01. The
3
process of encoding a string m0 m1 . . . is represented by beginning at state 00
and then following arrows dictated by the mi as you jump from state to state
in the automaton, with each jump emitting two code bits.