ChannelEncoding (1)
ChannelEncoding (1)
1
0 → 000000 ⎫
Repetition codes: ⎬ (n, 1) code
1 → 111111 ⎭
Single parity-check codes:
0 0 0 0 0⎫
0 0 0 1 1⎪
⎪
⎬ (n, n-1) code
0 0 1 0 1⎪
0 0 1 1 0⎪
⎭
References:
[1] Shu Lin and D. J. Costello, Jr. Error Control Coding: Fundamentals and Applications.
2nd ed. Prentice-Hall, 2004.
[2] 王新梅,肖国镇.纠错码-原理与方法.西安:西安电子科技大学出版社,1991.
[3] D. J. Costello, J. Hagenauer, H. Imai, and S. B. Wicker, “Applications of error-control
coding,” IEEE Trans. Inform. Theory, vol.44, no.6, pp.2531-2560, Oct. 1998.
[4] D. J. Costello and G. D. Forney, “Channel coding: The road to channel capacity,”
Proceedings of The IEEE, vol.95, no.6, pp.1150-1177, June 2007.
ci ⊕ c j = (ci ,0 ⊕ c j ,0 , ci ,1 ⊕ c j ,1 , , ci , n −1 ⊕ c j ,n −1 ) ∈ C
2
Linear block codes are normally put in systematic form:
(c0 , c1 , , cn −1 ) = ( c0 , c1 , , cn − k −1 , u0 , u1 , , uk −1 )
parity −check part message part
where pij =0 or 1. The n − k equations which gives the parity-check bits are called the
c0 = u0 + u1 + u2
Here, c1 = u1 + u2 + u3
c2 = u0 + u1 + u3
In matrix form:
⎡1 0 1 1 0 0 0⎤
⎢1 1 1 0 1 0 0 ⎥⎥
c = (u0 , u1 , u2 , u3 ) ⎢ = u ⋅G
⎢1 1 0 0 0 1 0⎥
⎢ ⎥
⎣0 1 1 0 0 0 1⎦
Encoder circuit:
3
u
message register
To channel
⊕ ⊕
c0 c1
⊕
c2
u(1) c(1)
u(2) c(2)
u Encoder c
(memory)
u(k) c(n)
shift register
data frame
运算逻辑
有记忆
n n n n
4
In the process of coding, the information sequence u is divided into data frames of
length k. These subsequences of length k are applied to the k-input terminals of the
encoder, producing coded sequence of length n.
An example:
Let n=2, k=1 and m=2. Consider a rate-1/2 (2,1,2) convolutional code which is specified
by the following two generator sequences:
g (1) = (101), g (2) = (111)
c(1)
c
u
c(2)
- Let u = (u0 , u1 , ) be the input message sequence. Then the two output sequences are
c(1) = u * g (1) ⎫
⎬ 编码方程 (与冲激响应的卷积运算)
c(2) = u * g (2) ⎭
- At the lth time unit, the input is a single bit ul . The corresponding output is a block of two
m
cl( j ) = ∑ ul −i gi( j ) = ul g 0( j ) + ul −1 g1( j ) + + ul − m g m( j )
i =1
⎧cl(1) = ul + ul − 2
⎪
⇒ ⎨cl2 = ul + ul −1 + ul − 2
⎪
⎩ memory
5
State Diagram: Since the encoder is a linear sequential circuit, its behavior can be
described by a state diagram. The encoder state at time l is represented by the message
bits stored in the memory units.
The encoder of the (2, 1, 2) convolutional code given in the example has 4 possible
states, and its state diagram is shown in the figure below .
0/00
00 input
0/11 1/11
output
1/00
01 10
0/01
1/10
0/10
11
1/01
label = input/output
Trellis diagram: The state diagram can be expanded in time to display the state
transition of a convolutional encoder in time. This expansion in time results in a trellis
diagram.
state
1/01
11 1/10 0/10
1/10
10 0/01
0/01
1/11 1/00
01
0/11
1/11 1/11
00 0/00 0/00 0/00 0/00
The encoding of a message sequence u is equivalent to tracing a path through the trellis.
The trellis structure is very useful in decoding a convolutional code.
6
IV. Conventional Coding
1. Types of codes
⎧ block codes - linear codes, cyclic codes ⎫
⎨ ⎬ classfication based on structure
⎩convolutional codes ⎭
⎧random-error-correcting codes
⎨
⎩burst-error-correcting codes
⎧ Binary codes
⎨
⎩ Nonbinary codes
⎧error-correction codes
⎨
⎩ error-detection codes
2. Error correcting capacity/ability
The error correcting capacity of a code C depends on its distance structure.
n
⎧1, if xi ≠ yi
d H (x, y ) = ∑ d H ( xi , yi ), d H ( xi , yi ) = ⎨
i =1 ⎩0, if xi = yi
or d H (x, y ) =|{i : xi ≠ yi }|
2) d H (x, y ) = d H (y , x) (对称性)
For a convolutional code, this minimum Hamming distance is usually called the
minimum free distance, denoted by d free .
An (n, k) block code with minimum Hamming distance d min is capable of correcting
7
⎢ d − 1⎥
t = ⎢ min ⎥ or fewer random errors over a block of n digits (using minimum distance
⎣ 2 ⎦
decoding rule). This parameter t is called the error correcting capacity of the code.
d min
t t
The minimum Hamming distance of a linear block code depends on the choice of
parity-check equations and the number of parity bits, n − k .
3. Important codes
1) Algebraic block codes
- Hamming codes
- BCH codes: A large class of powerful multiple random error-correcting codes, rich in
algebraic structure, algebraic decoding algorithms available.
- Golay (23, 12) code: A perfect triple-error-correcting code, widely used and
generated by
g ( x) = 1 + x 2 + x 4 + x 5 + x 6 + x10 + x11
- Reed-Muller codes
- Reed-Solomon codes: nonbinary, correcting symbol errors or burst errors ,most widely
used for error control in data communications and data storages.
2) Convolutional codes: (2, 1, 6) code generated by
g (1) = (1101101), g (2) = (1001111)
8
If the presence of error is detected in a received word, a retransmission is requested. The
request signal is sent to the transmitter through a feedback channel. Retransmission
continues until no errors being detected.
- Hybrid ARQ: A proper combination of FEC and ARQ.
5. Decoding
Based on the received sequence, the encoding rules and the noise characteristics of the
channel, the receiver makes a decision which message was actually transmitted. This
decision making operation is called decoding.
Hard-decision
When binary coding is used, the modulator has only binary inputs (M=2). If binary
demodulator output quantization is used (Q=2), the decoder has only binary inputs. In this
case, the demodulator is said to make hard decision. Decoding based on hard decisions made
by the demodulator is called hard-decision decoding.
Soft-decision
If the output of demodulator consists of more than two quantization levels (Q>2) or is
left unquantized, the demodulator is said to make soft decisions. Decoding based on this is
called soft-decision decoding.
硬判决(Q=2)
Q 电平
解调器 译
量化器
码
软判决
器
9
BPSK soft-decision bound
Shannon bound
1.2
BSC bound
1 soft-decision
Capacity (bits/symbol)
0.8
hard-decision
0.6
0.4
0.2
0
-2 0 2 4 6 8 10
E b/N0 (dB)
Figure 2 软判决与硬判决译码的信道容量
Optimal decoding
Given that y is received, the conditional error probability of decoding is defined as
P( E y ) P(cˆ ≠ c y )
ML rule: cˆ = arg max P ( y | c) (Suppose all the messages are equally likely)
c
10
For a codeword ci , the conditional probability P (y | ci ) is
P ( y | ci ) = p dH ( y ,ci ) (1 − p ) n − d H ( y ,ci )
MLD:
1) Compute d H (y , ci ) for all ci ∈ C .
11
Figure 3 Milestones in the drive towards channel capacity achieved over the past 50 years.
12
V. Finite Fields (分组码的代数结构)
1. Binary arithmetic and field
Consider the binary set {0,1}, Define two binary operations, called addition ‘+’ and
multiplication ‘·’, on {0,1} as follows
+ 0 1 · 0 1
0 0 1 0 0 0
1 1 0 1 0 1
These two operations are commonly called module-2 addition and multiplication
respectively. They can be implemented with an XOR and an AND gate, respectively.
The set {0, 1} together with module-2 addition and multiplication is called a binary field,
denoted by GF(2) or F2 .
13
2) the sum of two vectors in S is also a vector in S;
V = c1V1 + c2 V2 + + ck Vk
我们经常用‘0’表示加法运算下的单位元,‘-a’表示a的加法逆。经常用‘1’表示乘法
14
运算下的单位元,‘a-1’表示a的乘法逆。这样,减法a-b means a+(-b), 除法a/b means b-1a.
A field with q elements, if it exists, is called a finite field, or a Galois field, and is
denoted by GF(q).
For example, GF (2) ——the smallest field
- Let α be the root of p ( x ) ; i.e., p (α ) =0. Then the field elements can be represented
0 = α −∞ , 1 = α 0 , α 1 , α 2 , …, α q − 2 ,
The element α whose powers generate all the nonzero elements of GF (2 m ) is called
a primitive element of GF (2 m ) .
An (n, k) linear block code over GF ( 2) is simply a k-dim subspace of the vector
15
space Vn of all the binary n-tuples.
In any linear code, the all-zero word, as the vector-space origion, is always a codeword
(∵if c is a codeword, then (-c) is also a codeword,so dose c+(-c)).
The Hamming weight w(c) of a vector c is the number of nonzero components of c.
Obviously, w(c) = d H (c, 0) .
The minimum Hamming weight of a code C is the smallest Hamming weight of any
nonzero codeword of C.
w m in = m in w H ( c )
c∈ C , c ≠ 0
{ }
d min = min d H ( 0, ci − c j ) ci , c j ∈ C , i ≠ j = min w(c) = wmin
c≠0
1. Generator matrix
A generator matrix for a linear block code C of length n and dimension k is any k×n
⎡ g 0 ⎤ ⎡ g 00 g 01 … g 0,n −1 ⎤
⎢g ⎥ ⎢ g g11 … g1,n −1 ⎥
⎥
G= ⎢ 1 ⎥
= ⎢ 10
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎣ g k −1 ⎦ ⎢⎣ g k −1,0 g k −1,1 … g k −1, n −1 ⎥⎦ k ×n
⎡g 0 ⎤
⎢g ⎥ k −1
Encoding procedure: c = u ⋅ G = [u0 , u1 , uk −1 ] ⎢ 1 ⎥ = ∑ ul g l
⎢ ⎥ l =0
⎢ ⎥
⎣g k −1 ⎦
Example: For a (6, 3) linear block code,
⎡g 0 ⎤ ⎡0 111 0 0 ⎤
G = ⎢⎢g1 ⎥⎥ = ⎢⎢1 0 1 0 1 0 ⎥⎥
⎢⎣g 2 ⎥⎦ ⎢⎣11 0 0 0 1⎥⎦
c = u ⋅ G = 1⋅ ( 0 111 0 0 ) + 0 ⋅ (1 0 1 01 0 ) + 1⋅ (11 0 0 0 1) = (1 0 11 0 1)
16
⎡g 0 ⎤ ⎡ p00 p01 p0,n − k −1 1 0 0⎤
⎢g ⎥ ⎢ p
⎢ 1 ⎥ ⎢ p11 p1,n − k −1 0 1 0 ⎥⎥
= [P Ik ]
10
G= =
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎣ g k −1 ⎦ ⎣⎢ pk −1,0 pk −1,1 pk −1,n − k −1 0 0 1⎦
P matrix with pij = 0 or1 k ×k identity matrix
c2 = u0 + u1 ⎫
⎪
c1 = u0 + u2 ⎬ parity-check equations
c0 = u1 + u2 ⎪⎭
2. Parity-check matrix
An (n, k) linear code can also be specified by an (n-k)×n matrix H.
Let c = ( c0 c1 cn −1 ) be an n-tuple. Then c is a codeword iff
c ⋅ HT = 0 = ( 0 0 0)
n −k个
parity-check matrix is
⎡ h0 ⎤
⎢ h ⎥
H = ⎢ 1 ⎥ = ⎡I
⎣ n−k − P
T
⎤⎦
⎢ ⎥
⎢ ⎥
⎣h n−k ⎦
Example: For (7, 4) Hamming code
⎡1101000 ⎤ ⎡ ⎤
⎢0110100⎥ ⎢100 1011 ⎥ ⎧c0 = u0 + u2 + u3
⎢ ⎥ ⎪
G = ⎢1110010 ⎥ ⇒ H 3×7 = ⎢010 1110⎥ ⇒ ⎨c1 = u0 + u1 + u2
⎢ ⎥
⎢ ⎥ ⎢ 001 0111⎥ ⎪c = u + u + u
⎢1010001 ⎥ ⎩ 2 1 2 3
⎣ P ⎦ ⎣⎢ ⎥
PT ⎦
{
Thus, block code C = c ∈ GF (q) n cHT = 0 . }
17
3. Syndrome decoding
Error vector (or error pattern): Let c be the transmitted codeword, and r be the received
word. Then the difference between r and c gives the pattern of errors: e = r - c (for
binary codes, e = r ⊕ c )
ej =1 indicates that the j-th position of r has an error.
Obviously, r = c + e .
There are in total 2n possible error patterns. Among them, only 2n-k patterns are
correctable by an (n, k) linear code.
To test whether a received vector r contains errors, we compute the following (n-k)-
tuple:
s = ( s0 , s1 , , sn − k −1 ) r ⋅ HT
= (c + e) ⋅ HT
= cH T + eH T = eH T
问题: s ⇒ e = ?
If s ≠ 0 ⇒ e ≠ 0
If s = 0 ⇒ 无错,e = 0 ; 或错误不可检: e ∈ C .
The (n-k)-tuple, s is called the syndrome of r.
Any method solving these n-k equations is a decoding method.
最小距离译码就是找重量最轻的 e such that eHT = rHT = s
Syndrome decoding consists of these steps:
1) Calculate syndrome s = rH T of received n-tuple.
Let e = (e0 , e1 ,..., e6 ) be the error pattern. Since s = eH T , we have the following 3
equations :
1=e0+e3+e5+e6
1=e1+e3+e4+e5
1=e2+e4+e5+e6
There are 16 possible solutions, 其中 e=(0000010)是重量最小,是最可能发生的错误图
样,故 cˆ = r ⊕ e =(10010010)⊕(0000010)=(1001011).
18
Standard array
c1=0 c2 c3 … cM
e2 e2+c2 e2+c3 … e2+cM
e3 e3+c2 e3+c3 … e3+cM
… … … … …
…
e 2r e 2r + c 2 e 2r + c3 e 2r + c M
M = 2k , r = n-k
- Each row is called a coset.
4. Hamming codes
First class of codes devised for error correction.
For any positive integer m ≥ 3 , there exists a Hamming code with the following
parameters:
code length: n = 2m − 1
dimension: k = 2 m − m − 1
Number of parity-check symbols: n-k=m
Error correcting capability: t=1
Minimum distance: dmin=3
i =0 ⎝ i ⎠
从而
qn
≥ Vq (n, t )
qk
n − k ≥ log q Vq (n, t )
z Note: Hamming codes are one of few perfect codes – achieving Hamming bound.
19