DSC-Chapter 4-1
DSC-Chapter 4-1
◼ INTRODUCTION
◼ CODE TYPOLOGIES
◼ BLOCK CODES
◼ REPETITION CODE
◼ PARITY-CHECK CODE
◼ HAMMING DISTANCE
1
DSC – Chapter 4 University of Trento
◼ SYSTEMATIC CODES
◼ HAMMING CODE
◼ SYNDROME DECODING
◼ CYCLIC CODE
◼ CONVOLUTIONAL CODE
◼ VITERBI DECODING
◼ SEQUENTIAL DECODING
2
DSC – Chapter 4 University of Trento
INTRODUCTION
3
DSC – Chapter 4 University of Trento
INTRODUCTION
4
DSC – Chapter 4 University of Trento
INTRODUCTION
◼ Below, we will see the main coding strategies and the main
codes that can be used to protect the message from the
noise present on the channel.
5
DSC – Chapter 4 University of Trento
INTRODUCTION
6
DSC – Chapter 4 University of Trento
7
DSC – Chapter 4 University of Trento
FORWARD ERROR
CORRECTION (FEC) SYSTEMS
8
DSC – Chapter 4 University of Trento
CODES: DEFINITIONS
We define:
detection capability of a code: maximum number of errors it
can detect in a codeword
9
DSC – Chapter 4 University of Trento
CODE TYPOLOGIES
10
DSC – Chapter 4 University of Trento
CODE TYPOLOGIES
CODES
BLOCK CONVOLUTIONAL
11
DSC – Chapter 4 University of Trento
CODE TYPOLOGIES
BLOCK CODES (n,k)
k q k q
12
DSC – Chapter 4 University of Trento
CODE TYPOLOGIES
CONVOLUTIONAL CODES
0 0 1 0 11 0 10 011 1 0 11 0 1 0 1 1 1 0 1 1 0 01 1 0 11 1 0
13
DSC – Chapter 4 University of Trento
Repetition code
Parity-check code
14
DSC – Chapter 4 University of Trento
REPETITION CODE
0 → 000…00
1 → 111...11
15
DSC – Chapter 4 University of Trento
REPETITION CODE
n i n i
P (i, n ) = a (1 − a ) a
n −i
i i
◼ Repetition codes are efficient if a is small enough to satisfy the
condition P(i+1,n) << P(i,n).
16
DSC – Chapter 4 University of Trento
18
DSC – Chapter 4 University of Trento
With n=3, in the case where we use the code to reveal any
error, we are able to identify 1 or 2 errors (single or double
errors).
Pwe =P(3,3) = a3
19
DSC – Chapter 4 University of Trento
PARITY-CHECK CODE
Another very simple type of linear and systematic (n,k) block codes
is that of parity-check codes.
In parity-check codes:
21
DSC – Chapter 4 University of Trento
PARITY-CHECK CODE:
EXAMPLE (n=3, k=2)
Not revealed because of even parity
PARITY-CHECK CODE
a<<1
23
DSC – Chapter 4 University of Trento
PARITY-CHECK CODE:
EXAMPLE (n=10, k=9)
0
= 1 − (1 − a ) 1 − 1 − (n − 1)a = (n − 1)a = 9 10
n −1 −3
24
DSC – Chapter 4 University of Trento
25
DSC – Chapter 4 University of Trento
CODE SPACE
Let us see how the codewords obtained with the
repetition code (3,1) and the parity-check code (3,2)
are represented in the code space of size n=3: Zerzons
3
ords ↓ desoue
:
Z
arances I
001
↑ 001
Codeword 011 011
101 101
Word not belonging 111 111
to the code 000 010 000 010
af
100 · Since they're cosen
100
110 robunues 110
s scolle
Pl 31
,
=
(3/Pb
In the first case, the codewords are more spaced P(3 31 .
=
(3) Obe
HAMMING DISTANCE
X:101 to
poieu
d(X,Y) = 2 codren
Y:110
"allerenbus
The minimum code distance dmin is the minimum Hamming
distance between all possible pairs of codewords.
27
DSC – Chapter 4 University of Trento
DETECTION CAPABILITY
28
*
DE SPACE
①
Or x
UNACTIONZID
U ee
a
a
St
.
&
minimal de Sara
un authatd
&
&
0
S
-
...,
NO DETECTED ,
IT BECONGS
To A PretBET
92"-2"-unauthouza
I
①"N ↓ Sequence
- THANNEL >
-
-
DSC – Chapter 4 University of Trento
CORRECTION CAPABILITY
29
DSC – Chapter 4 University of Trento
O
EXAMPLE: Repetition Code (3,1)
dmin +1 3 –1=2
30
DSC – Chapter 4 University of Trento
Hamming distances:
dmin +1 2 –1=1
So (as already seen), a (3,2) parity-check code can detect 1 error, while
it cannot be used for error correction.
31
X Xt) :
dd(xy4
: 1 +
MIN
%na (* , y9)
-
>
Depens on
the
wih
↓ ~ [ 1 + MAX)da(x9 491/
message
.
-1 +a
101
- Entr den (x 4),
= 1 +g
·
9 :
2 =
admin/ax : 3
DSC – Chapter 4 University of Trento
linearity
sistematicity
33
DSC – Chapter 4 University of Trento
LINEARITY
34
Repritions
1 Yaxe lite
Pain
DSC – Chapter 4 University of Trento
LINEARITY
d(X,Z)=w(X+Z)
SISTEMATICITY
X = (m1 m2 … mk c1 c2 … cn-k ) =
=(M|C)
36
DSC – Chapter 4 University of Trento
MATRIX REPRESENTATION OF
LINEAR SYSTEMATIC CODES
X=MG
Matrix G (of size kxn) is called generator matrix and has the following
t
structure:
1 0 ... 0 p1,1 p1,2 ... p1,n − k
0 1 ... 0 p 2 ,1 p 2 ,2 ... p 2 ,n − k
def
G = Ik P =
k
9
0 0 ... 1 p k ,1 ... ... p k ,n − k
~ Lexul Cexul Min
M G
bina alienis X = +
37
:
[MC]
DSC – Chapter 4 University of Trento
MATRIX REPRESENTATION OF
LINEAR SYSTEMATIC CODES
OBSERVATION
HAMMING CODE
k q
Rc = = 1 − q 3 an = = =
k 4
2 −1 q
=
n
=
=
9 4 = 15
: D K ll
=
i
39
es[ii) 3
DSC – Chapter 4 University of Trento
HAMMING CODE
dmin=3
I
trivovoscon non
>
-
40
DSC – Chapter 4 University of Trento
1
0 0 0 1 0 1
se [Mic]
G=
0 1 0 0 1 1 1 cics
0 0 1 0 1 1 0 mx
0
0 0 1 0 1 1
4 =
[1]
( My
Control bits are therefore: [i]
=
c1 =m1 m2 m3 0
c2 =0 m2 m3 m4
C = Mx
[])
c3 =m1 m2 0 m4
41
DSC – Chapter 4 University of Trento
mi
Buffer message bits
m4 m3 m2 m1
X
c3 c2 c1 control bits
42
DSC – Chapter 4 University of Trento
43
a
= 4 =
an = 13 = Bk = 1
10 - 0000000
198
- O
G
I
= - &
01 -
S
, o
&
O O 1 -
-
-
100
11x15 0
o
-O ⑧ 1 110
&
1
S
I
&
001
I S
1
S
I 0 10 I
G
&
1 101
S
1 &
& 01 I I
&
I
=
I 1 S 1 O
I I
-
↑ 1 S 110 I
1
1' I'l
0 0000 e 0 0 O 8
-
-
P
Ik
X 16
=
: M +
[IniP]
[M In : M .
P]
= [MIc]
control bis
it (m ..
mony . . -
Mil
C =
(C(zx)
colora de P
-
prodotto de M per
1
S
collicient ( = m . Mi MEDMSMDM
-
W2m2
C =
prodotto der
per
2 colora de P
>
-
Mi
M
tr
X =
MG
i
DECODING OF LINEAR
SYSTEMATIC CODES
EXAMPLE
44
DSC – Chapter 4 University of Trento
def
· H =O
P Iq
T
(axk) (axa)
qq identity matrix
This matrix has the following property:
- T
XH = ( 0 0 0 … 0 )
element.
45
DSC – Chapter 4 University of Trento
SYNDROME DECODING:
ERROR DETECTION
lexal (exulluxal
The quantity S=YHT is called syndrome and allows to detect possible
errors present in the received vector Y.
1. no errors occurred
46
DSC – Chapter 4 University of Trento
SYNDROME DECODING:
ERROR CORRECTION
EXAMPLE
X= ( 1 0 1 1 0 )
obinayvector
I
E=(00101)
accred tlat
Y= ( 1 0 0 1 1 ) oror
in
poster
47
DSC – Chapter 4 University of Trento
SYNDROME DECODING:
ERROR CORRECTION
Y = X+E
X = Y+E
t
-D
O
S=YHT=(X+E)HT = X HT +E HT= E HT
48
DSC – Chapter 4 University of Trento
SYNDROME DECODING:
ERROR CORRECTION Error sce
Overine
SPACESINDR
PROBLEM
021-e
The possible errors on a codeword encoded with n bits are
2n-1. Space Sindrome 29 :
-
SPAC
I
It can be shown that this vector is the one that contains the smallest
number of incorrect bits. This choice corresponds to determining the
codeword X̂ that has the smallest Hamming distance from the received
vector Y.
50
DSC – Chapter 4 University of Trento
𝒆ො 𝒏 … 𝒆ො 𝒌 … 𝒆ො 𝟐
Y + Ê = X̂
Y
yn … yk … y2 y1 In reality, we are only
… … interested in the first k bits
as they are the ones that
Syndrome computation contain the message.
S
Look-up table
Ê
51
DSC – Chapter 4 University of Trento
CYCLIC CODE
heghzonela
e
U Dduu RET
=
Dq
=
52 &P
DSC – Chapter 4 University of Trento
CYCLIC CODE
m
Consider a generic codeword consisting of n bits:
X=(xn-1 xn-2 … x1 x0 )
xn-1 xn-1 … x1 x0
-
CYCLIC CODE
I
[100111935x6 p php p2
+
y = : +
2 54
DSC – Chapter 4 University of Trento
since these coefficients can only assume the value “1” or “0”
and 11=0 subtraction operation is equal to modulo-2
addition: X.
(p( Xz(p) X3(9)
+ =
X(p)+Z(p)=0 X(p)=Z(p)
55
DSC – Chapter 4 University of Trento
56
- --
[Xn Yne---
X =
.. XXo]
2 X(p Yn-ph Xep" Xu-sphs: + + +
Xep2 Xope +
Xneph Xnsph + -
----Xopt :
po
CROTATED
TANSCATION :
px(1 +
Yuzph
2
Xn- > p X, p tope
.
: + +
+ +
--
x((p) px()
+ = Xn - ph + Xn po =
Xn -1(p4 +
1)
=
px(p) Xn 1(ph 1) + - +
La correction
Thoudated
Generator polyrarial
G(pl -G(pl pa
ga 1 pa geph pas
= + +
- +.. -
facta el phie
G(P)
And :And G
DSC – Chapter 4 University of Trento
The polynomial (pn+1) and its coefficient xn-1 play a very important
role in cyclic codes.
57
DSC – Chapter 4 University of Trento
58
DSC – Chapter 4 University of Trento
Codice n k Rc dmin
n 7=
↑
The following table reports the generator polynomials of some
G(p)
i Ok it's
offe
7 4 0.57 3 genota
evid a 1 011 p3 +
p
+2
OO
63 45 0.71 7 1 111 000 001 011 001 111
Golay 23 12 0.52 7 101 011 100 011
approva i Muodes en
layer cod
59
&
DSC – Chapter 4 >
University of Trento
X a Xmpmm
-pr(p +A d
mush
M - (p) 7 no]: 0 :
PM(p) pk
1
= = mk -
1 + wk 29
pl M
+ la +
,
C [Ca (2
--
CC]
.
=
.
....
=>
C(p1 Ca :
.
1 pq Ca pa 2
-
. . .
+
---
Gp' Cope
pa
-
op
ani Re
60
DSC – Chapter 4 University of Trento
61
DSC – Chapter 4 University of Trento
p q M ( p) C( p)
= QM ( p ) +
G( p ) G( p )
q
C ( p ) = p M ( p ) mod G ( p )
↑ M(pl p
=
X =
+
2
1
62
-pel C =
DSC – Chapter 4 #2
University of Trento [10 +1 = , J
= X =
[oo 11101
S ( p ) = Y ( p ) mod G( p )
-(p
x(p)
63
DSC – Chapter 4 University of Trento
corre
nugh Dir copobetis
syndrome calculation simplicity
64
DSC – Chapter 4 University of Trento
CONVOLUTIONAL CODE
Convolutional codes, unlike block codes, do not generate sequences
organized into well-defined codewords.
-
Weiglis g0 g1 ... gL -
seems
the
predcorig
xi
similar to convolution
L integral
xi = mi-L gL … mi-1 g1 mi g0 = mi − j g j
j =0
65
DSC – Chapter 4 University of Trento
CONVOLUTIONAL CODE
66
DSC – Chapter 4 University of Trento
CONVOLUTIONAL CODE
L
x "i = m i− j g 2 , j 67
j =0
DSC – Chapter 4 University of Trento
CONVOLUTIONAL CODE
68
DSC – Chapter 4 University of Trento
CONVOLUTIONAL CODE
69
DSC – Chapter 4 University of Trento
O
Encoder scheme of a convolutional code (3,2,1) pacious
euroz
(i.e., characterized by n=3, k=2 e L=1).
stilTs
,
med
mi mi-2 Temol
LeAtte
8
~
X = . . . . x 'i x "i x 'i ' ' . . . .
3 combination
Combi-convo
:
poder d
3 bisie
70
(n =
3)
ave stadwelsin pote
a
cauwe
DSC – Chapter 4 University of Trento
CONVOLUTIONAL CODE:
-
OBSERVATIONS
71
DSC – Chapter 4 University of Trento
Tree representation
Trellis representation
72
DSC – Chapter 4 University of Trento
mi
mi mi-1 mi-2
message bit
X = . . . . x 'i x "i . . . .
73
DSC – Chapter 4 University of Trento
TREE REPRESENTATION
00
00 a
output a 11
00 b
State a 10
11 c
a=00 b 01
00 d
b=10 a 11
10 a
c
c=01 11 00 b
b 01
d=11 01 c
d 10 d
a
00
11 a
a
11 b
state transition that occurs as 10 c 10
a result of an input mi=0 00 c
b 01
11 d
b 11
01 a
c
00 b
state transition that occurs as 01
a result of an input mi=1 d 01
10 c
d 10 d 74
DSC – Chapter 4 University of Trento
TRELLIS REPRESENTATION
output
b
State
11 01
a=00
b=10 00 a 00 10 d 10
c=01
11 01
d=11
c
Input 1 1 0 1 1 1 0 0 1 0 0 0
State a b d c b d d c a b c a a
Output 11 01 01 00 01 10 01 11 11 10 11 00
77
DSC – Chapter 4 University of Trento
CONVOLUTIONAL CODE:
FREE DISTANCE
78
DSC – Chapter 4 University of Trento
CONVOLUTIONAL CODE:
FREE DISTANCE
One must identify the path with minimum weight that detaches
itself from the trivial all-zero path and return to it in a stable
way.
79
DSC – Chapter 4 University of Trento
CONVOLUTIONAL CODE:
FREE DISTANCE
0 0 0 0
a a a a F
2 2
2
b 1 2 b 1 2 0 b 2
1
c 0 1 c 1 c c
1 1 final state
1
d 1
d d
1
80
DSC – Chapter 4 University of Trento
CONVOLUTIONAL CODE:
FREE DISTANCE
Consider the path with minimum weight (not all zero) that
starts from state a and arrives at the final state F:
0
a a a a F
2
1 2
b b b
c c c c
final state
d d d
CONVOLUTIONAL CODE:
FREE DISTANCE
82
DSC – Chapter 4 University of Trento
83
DSC – Chapter 4 University of Trento
VITERBI ALGORITHM
84
DSC – Chapter 4 University of Trento
VITERBI ALGORITHM
The metric of each path is obtained by adding the values of the
metric of the branches that compose it.
85
DSC – Chapter 4 University of Trento
86
DSC – Chapter 4 University of Trento
Y= 11 01 11
2 00 2 1
00 3 2 00 5
a0 a1 a2 a3
11 0
11 0
11 2
1 3
0
b1 b2 1 11 3 b3
2
00
10 2 1 4
0 0
4
c2 01 10 c3
2
0 1
01 1
d2 01 4
d3
Branch metric Path metric 1 10
1
87
DSC – Chapter 4 University of Trento
Reasoning in this way, for each of the nodes a3 ,b3 ,c3 ,d3 that we have at
the third transition, we can eliminate the path with the larger metric, thus
reducing the number of paths to be memorized by keeping only the
surviving paths.
88
DSC – Chapter 4 University of Trento
00 00
a0 a1 a2 2 a3
11 11
b1 b2 11 b3
3
10
c2 1 c3
01
d2 01 1
d3
10
89
DSC – Chapter 4 University of Trento
This iterative process ends when the last bit of the received
sequence Y is reached.
90
DSC – Chapter 4 University of Trento
Maximum
likelihood path
91
DSC – Chapter 4 University of Trento
VITERBI ALGORITHM
92
DSC – Chapter 4 University of Trento
93
DSC – Chapter 4 University of Trento
After the first 5Ln bits have been received, the first k bits of the
message can be decoded (and consequently the first sets of
branches can be erased from memory).
94
DSC – Chapter 4 University of Trento
SEQUENTIAL DECODING
sequential decoding
95
DSC – Chapter 4 University of Trento
SEQUENTIAL DECODING
Starting from the initial state a0, a sequential decoder takes the path that
has the smallest metric at the next node (if 2 paths have the same metric,
one is chosen randomly).
If the decoder takes a path that turns out to be “too” unlikely, in a few
branches the metric of that path tends to grow very quickly. In these
cases, the decoder can “decide” to go back and try another path
(backtracking).
96
DSC – Chapter 4 University of Trento
SEQUENTIAL DECODING
97
DSC – Chapter 4 University of Trento
SEQUENTIAL DECODING
98
DSC – Chapter 4 University of Trento
path associated
with the transmitted
sequence
99
DSC – Chapter 4 University of Trento
jnPbe
100
DSC – Chapter 4 University of Trento
101
DSC – Chapter 4 University of Trento
Data-storage coding
102
DSC – Chapter 4 University of Trento
103
DSC – Chapter 4 University of Trento
Examples are:
In these cases, ARQ strategies using cyclic linear block codes are
generally used.
104
DSC – Chapter 4 University of Trento
DATA-STORAGE CODING
105