LDPC
LDPC
Tuan Ta
The University of Texas at Austin
Abstract Low density parity-check codes are one of the hottest topics in coding theory nowadays.
Equipped with very fast encoding and decoding algorithms (probabilistically,) LDPC are very attractive both
theoretically and practically. In this paper, I present a throughout view of LDPC. I discuss in detail LDPCs
popular decoding algorithm: belief propagation. I also present some noticeable encoding algorithms including
Richardson and Urbankes lower triangular modification that gives rise to a linear encoding time. I show that
irregular LDPC perform better than regular LDPC thus are more desirable.
Index Termsbelief propagation, density evolution, Gallager codes, irregular codes, low density paritycheck codes
I. INTRODUCTION
OW density parity-check code (LDPC) is an
error correcting code used in noisy
communication channel to reduce the probability of
loss of information. With LDPC, this probability
can be reduced to as small as desired, thus the data
transmission rate can be as close to Shannons limit
as desired.
LDPC was developed by Robert Gallager in his
doctoral dissertation at MIT in 1960 [1]. It was
published 3 years latter in MIT Press. Due to the
limitation in computational effort in implementing
the coder and decoder for such codes and the
introduction of Reed-Solomon codes, LDPC was
ignored for almost 30 years. During that long
period, the only notable work done on the subject
was due to R. Michael Tanner in 1981 [2] where he
generalized LDPC codes and introduced a graphical
representation of the codes later called Tanner
graph. Since 1993, with the invention of turbo
codes, researchers switched their focus to finding
low complexity code which can approach Shannon
channel capacity. LDPC was reinvented with the
work of Mackay [3], [4] and Luby [5]. Nowadays,
LDPC have made its way into some modern
applications such as 10GBase-T Ethernet, WiFi,
WiMAX, Digital Video Broadcasting (DVB).
Before discussing LDPC, I present a brief review
of error correcting code in section II. I pay the most
attention to linear block code. (7, 4) Hamming code
p1
p2
d1
p3
d2
d3
d4
Equation
corresponds to p1
Equation
corresponds to p2
Equation
corresponds to p3
Bit number
1
1
G = 0
0
0
0
d1
d2
d3
d4
p1
p2
p3
by
For parity bit locations: use associated data
bits (from Table 2)
For data bit locations: put a 1 for the position
of the data bit, the rest are 0s
For the generator matrix of (7, 4) Hamming code
above, bit location 1 (1st row) is a parity bit, thus we
use row 1 from table 2 (1101). Bit location 5 (5th
row) is a data bit, and bit 5 is data bit number 2,
thus we set bit 2 to 1 (0100).
If the message is
1
0
p=
1
1
(1)
(2)
1 0 1 0 1 0 1
H = 0 1 1 0 0 1 1
0 0 0 1 1 1 1
(4)
1 0 1
0 1 1
0 0 0
1 1 1
1 0 0
0 1 0
0 0 1
1
1
c = Gp = 0
0
0
0
(3)
1
2 0
3 1
1
1
0 1 1
0
1 = 2 = 0
1
0 0 0
1
0 1 0
1 1
1 1
0 0 1
1
0
0
1
1
0
1
0
1
0
0
1
1 0 1 0 1 0 1 1 2 0
z = Hy = 0 1 1 0 0 1 1 0 = 4 = 0
0 0 0 1 1 1 1 0 2 0
1
1
c3
c4
c5
c6
c7
then
0
1
1 0 1 0 1 0 1 1 2 0
z = Hy = 0 1 1 0 0 1 1 0 = 3 = 1
0 0 0 1 1 1 1 0 1 1
0
1
III. DECODING
Different authors come up independently with
more or less the same iterative decoding algorithm.
They call it different names: the sum-product
algorithm, the belief propagation algorithm, and the
message passing algorithm. There are two
derivations of this algorithm: hard-decision and
soft-decision schemes.
2.
A. Hard-decision Decoder
1
1
0
0
0
1
1
0
1
0
0
1
1
0
0
1
0
1
1
0
0
0
1
1
1
0
1
3.
4.
(5)
TABLE 3
CHECK NODES ACTIVITIES FOR HARD-DECISION
DECODER FOR CODE OF FIGURE 2
check
nodes
f1
f2
f3
f4
activities
receive
c2 1
c4 1
c5 0
c8 1
send
0 c2
0 c4
1 c5
0 c8
receive
c1 1
c2 1
c3 0
c6 1
send
0 c1
0 c2
1 c3
0 c6
receive
c3 0
c6 1
c7 0
c8 1
send
0 c3
1 c6
0 c7
1 c8
receive
c1 1
c4 1
c5 0
c7 0
send
1 c1
1 c4
0 c5
0 c7
qij( 0 ) (0) = 1 Pi .
Similarly, let r ji(l ) be the message sent by check
node fj to message node ci at round l. Every message
contains a pair r ji(l ) (0) and r ji(l ) (1) which stands for
the amount of belief that yi is 0 or 1. We also have
r ji(l ) (0) + r ji( l ) (1) = 1 . r ji(l ) (0) is also the probability
that there are an even number of 1s on all other
message nodes rather than ci.
First, let consider the probability that there are an
even number of 1s on 2 message nodes. Let q1 be
the probability that there is a 1 at message node c1
and q2 be the probability that there is a 1 at message
node c2. We have
TABLE 4
MESSAGE NODES DECISIONS FOR HARDDECISION DECODER FOR CODE OF FIGURE 2
message
nodes
yi
messages from
check nodes
decision
c1
f2 0
f4 1
c2
f1 0
f2 0
c3
f2 1
f3 0
c4
f1 0
f4 1
c5
f1 1
f4 0
c6
f2 0
f3 1
c7
f3 0
f4 0
c8
f1 1
f3 1
Pr[c1 c 2 = 0] = q1 q 2 + (1 q1 )(1 q 2 )
= 1 q1 q2 + 2q1q2
1
(2 2q1 2q 2 + 4q1 q 2 )
2
1
= [1 + (1 2q1 )(1 2q2 )] = q (6)
2
B. Soft-decision Decoder
The soft-decision decoder operates with the same
principle as the hard-decision decoder, except that
1
= [1 + (1 2(1 q ))(1 2q3 )]
2
6
1
= [1 + (1 2q1 )(1 2q2 )(1 2q3 )]
2
(7)
In general
1 1 n
Pr[c1 ... c n = 0] = + (1 2q i )
2 2 i =1
Pr[ci = 0 | y ] 1 Pi
=
Li =
Pi
Pr[ci = 1 | y ]
(8)
(15)
Pr[ci = 0 | y ]
l i = ln Li = ln
c
Pr[
=
1
|
y
]
i
l is
1 1
r ji( l ) (0) = + (1 2q i('lj1) (1))
2 2 i 'V j i
(9)
(10)
q (ijl ) (0) = k ij (1 Pi )
q (ijl ) (1) = k ij Pi
j 'Ci j
j 'Ci j
( l 1)
j 'i
( l 1)
j 'i
( 0)
Pi =
(11)
(1)
(12)
(l )
m ij
1 Pi
= ln (l )
= ln
q ij (1)
Pi
q ij(l ) (0)
= li +
(17)
r j('li1) (0)
(l 1) (1)
j 'Ci j r j 'i
( l 1)
j 'i
(18)
j 'Ci j
qij(0) + qij(1) = 1
(13)
jCi
m (jil ) = ln
Q i (1) = k i Pi r ji (1)
(l )
(l )
ji
r ( 0)
r ji(l ) (1)
= ln
(14)
jCi
1 1
+ (1 2q (i 'lj1) (1))
2 2 i 'V j i
1 1
(1 2q (i 'lj1) (1))
2 2 i 'V j i
1+
1
1 + Li
(l )
(16)
(l )
i
i 'V j i
= ln
tanh(
tanh(
i 'V j i
mi('lj1)
2
mi('lj1)
2
)
(19)
)
mi ' j
1 q i ' j (1)
qi ' j (1)
(20)
Thus
2.
q i ' j (1) =
1
1+ e
and
mi ' j
mi ' j
1
+1
= tanh(
mi ' j
2
(22)
(l )
i
= ln
Q i(l ) (0)
Q i( l ) (1)
=l
(0)
i
+ m
(l )
ji
is the
(23)
jCi
Pe (l )
(21)
mi ' j
A. Accumulate approach
The first approach modifies LDPC code so it has
8
an inherited fast encoding algorithm. In this case, degree d having all its connected check nodes
we assign a value to each check node which is equal erased is pd. This probability is conditioned on the
to the sum of all message nodes that are connected event that the degree of the message node is d.
to it. (It would be more appropriate to talk about Since the graph is created randomly, the probability
information nodes and redundant nodes, but for that a message node has all its connected check
consistence of notation, I will use message nodes nodes erased is M d p d , which is a constant
d
and check nodes.) The number of summations
needed to calculate the value of a check node is independent of the length of the code. Therefore, no
bounded by the number of message nodes connected algorithm can recover the value of that message
to a check node. This is a constant when the code is node.
sparse. The message consists of the message nodes B. Lower triangular modification approach
appended by the values of the check nodes. To
In [11], Richardson and Urbanke propose an
illustrate the difference between this modified encoding algorithm that has effectively linear
version of LDPC and the original version, consider running time for any code with a sparse parity-check
Figure 2. If Figure 2 represents an original LDPC matrix. The algorithm consists of two phases:
then c1, c2, c3, c4 are information bits and c5, c6, c7, preprocessing and encoding.
c8 are parity bits which have to be calculated from
In the preprocessing phase, H is converted into
c1, c2, c3, c4 by solving the parity-check equations in the form shown in Figure 3 by row and column
f1, f2, f3, f4. The code rate is 4/8 = 1/2. Now if permutations.
Figure 2 represents a modified LDPC, then all of c1,
c2, c3, c4 ,c5, c6, c7, c8 are information bits; while f1,
n-k
g
k-g
f2, f3, f4 are redundant bits calculated from c1,,c8.
f1 is connected to c2, c4, c5, c8 so f1 = c2 + c4 + c5 +
1
c8 and so on. The codeword in this case is
1
T
1
[c1 c8 f1 f4] . The code rate is 8/12 = 2/3.
k-g
1
Although this approach gives a linear encoder, it k
1
causes a major problem at the decoder. In case the
g
channel is erasure, the value of the check nodes
might be erased. On the contrary, the check nodes of
the original LDPC are dependencies, not values,
n
thus they are not affected by the channel. In other
Figure 3: Parity-check matrix in approximately
words, a check node defines a relationship of its
lower triangular form
connected message nodes. This relationship comes
straight from the parity-check matrix. The fact that
In matrix notation,
in modified LDPC, the values of check nodes can be
A B T
erased creates a lower bounded for the convergence
H=
(24)
TABLE 5
COMPUTING p1 USING RICHARDSON AND URBANKES ENCODING ALGORITHM
Operation
AsT
T1[AsT]
E[T1AsT]
CsT
[ET1AsT]+ [CsT]
1(ET1AsT + CsT)
Comment
Multiplication by sparse matrix
Back-substitution, T is lower triangular
Multiplication by sparse matrix
Multiplication by sparse matrix
Addition
Multiplication by gg matrix
Complexity
O(n)
O(n)
O(n)
O(n)
O(n)
O(n+g2)
TABLE 6
COMPUTING p2 USING RICHARDSON AND URBANKES ENCODING ALGORITHM
Operation
AsT
Bp1T
[AsT] + [Bp1T]
T1(AsT + Bp1T)
Comment
Multiplication by sparse matrix
Multiplication by sparse matrix
Addition
Back-substitution, T is lower triangular
0
I
(25)
we get
A
B
T
ET 1 A + C ET 1B + D 0
(26)
= 1(ET1AsT + CsT)
(30)
0 T
Hc
I
s
A
B
T
=
p1 = 0 (27)
1
1
ET A + C ET B + D 0 p
2
Therefore
Complexity
O(n)
O(n)
O(n)
O(n)
(28)
10
define
V. IRREGULAR CODES
It has been shown that irregular LDPC perform
better than regular LDPC [12], [13], [14]. The idea
was pioneered by Luby et al in [12]. He thinks of
finding coefficients for an irregular code as a game,
with the message nodes and check nodes as players.
Each player tries to choose the right number of
edges for them. A constraint of the game is that the
message nodes and the check nodes must agree on
the total number of edges. From the point of view of
the message nodes, it is best to have high degree
since the more information it has from the check
nodes, the more accurately it can judge what its
correct value should be. On the other hand, from the
point of view of the check nodes, it is best to have
low degree, since the lower the degree of a check
node, the more valuable the information it can
transmit back to the message nodes. These two
requirements must be appropriately balanced to
have a good code.
MacKay shows in [15], [16] that for regular
codes, it is best to have low density. However,
allowing irregular codes provides another degree of
freedom. In [12], Luby shows that having a wide
spread of degree is advantageous, at least for the
message nodes. The reason is message nodes with
high degree tend to correct their value faster. These
nodes then provide good information to the check
nodes, which subsequently provide better
information to the lower degree message nodes.
Therefore irregular graph has potential to provide a
wave effect where high degree message nodes are
( x) = i x i 1
(31)
( x) = i x i 1
(32)
and
(33)
(34)
11
dl
p i +1 = p 0 j .
j =1
j 1 1 + (1 2 p i )
p 0
t =bi , j t
j
1 (1 2 pi )
+ (1 p 0 )
t = bi , j
j
j 1 1 + (1 2 p i )
t
2
j 1 t
i
i
(38)
(35)
p0
1 (1 2 p i )
= (1 R )
j 1 t
1 (1 2 p i )
.
2 bi , j j +1
(36)
TABLE 7
f ( x) = p 0 j .
j =1
t
j
j 1 1 + (1 2 x)
p
0
t =bi , j t
1 (1 2 x)
j 1 t
j 1 1 + (1 2 x)
+ (1 p 0 )
t = bi , j t
1 (1 2 x)
.
j 1 t
(37)
B. Richardsons design
In [13], Richardson, Shokrollahi and Urbanke
propose a design of irregular LDPC that can
approach Shannon channel capacity tighter than
turbo code. Their algorithm employs two
optimizations: tolerate the error floor for practical
purpose and carefully design quantization of density
evolution to match the quantization of messages
passed. The idea of the former optimization is that
in practice, we always allow a finite (but small)
probability of error . If we choose small enough
then it automatically implies convergence. The
latter optimization makes sure that the performance
loss due to quantization errors is minimized. Since
belief propagation is optimal, the quantized version
is suboptimal, therefore the simulation results can
be thought of as lower bound for actual values.
Richardsons algorithm starts with an arbitrary
degree distribution (, ). It sets the target error
probability and the maximum number of iterations
m. The algorithm searches for the maximum
admissible channel parameter such that belief
propagation returns a probability of error less than
after m iterations. Now slightly change the degree
distribution pair and runs the algorithm again and
check if a larger admissible channel parameter or a
lower probability of error is found. If yes then set
the current distribution pair to the new distribution
pair, else keep the original pair. This process is
repeated a large number of times. The basic of this
algorithm is that Richardson notices the existence of
stable regions where the probability of error does
not decrease much with the increase number of
iterations. This fact helps limit the search space of
the degree distribution thus shortens the running
time.
Another optimization in Richardsons algorithm
is the fact that he lets the degree to be a continuous
variable, and round it to return to real integer
TABLE 8
RICHARDSONS IRREGULAR CODES
[6] Information
and
Entropy,
OpenCourseWare. Spring 2008.
MIT
VI. CONCLUSION
This paper summaries the important concepts
regarding low density parity-check code (LDPC). It
goes through the motivation of LDPC and how
LDPC can be encoded and decoded. Different
modifications of the codes are presented, especially
irregular codes. I chose to leave out derivations of
regular codes such as MacKay codes [18], repeataccumulate codes [19] because they have become
less important with the advance of irregular codes.
This paper however has not mentioned how
LDPC is implemented in real hardware. For this, I
refer the readers to [20], where a decoder design
based on IEEE 802.11n standards with very high
throughput (900Mbps for FPGA, 2Gbps for ASIC
design) is discussed.
REFERENCES
[1] R. Gallager, Low density parity-check codes,
IRE Trans, Information Theory, pp. 21-28.
January 1962.
[18] D.
Mackay,
Information
Theory,
Interference, and Learning Algorithms,
Cambridge University Press 2003.
15