0% found this document useful (0 votes)
9 views72 pages

Basic Coding Techniques: Digital Communications

Uploaded by

barnabe123yt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views72 pages

Basic Coding Techniques: Digital Communications

Uploaded by

barnabe123yt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

Digital Communications

Basic coding techniques


• Error detection and Error correction;
• Block codes;
• Hamming codes;
• Cyclic codes;
• Convolutional codes;

Universidade do Minho
Escola de Engenharia 1
Definitions
• One of the predictions made in the Shannon
channel coding theorem is that a rather
sophisticated coding technique can convert a
noisy channel (unreliable transmission) into an
error-free channel (reliable transmission).
• Message words are arranged as blocks of k bits,
which are randomly assigned codewords of n bits,
n > k, in an assignment that is characterized by
the addition of redundancy.

Universidade do Minho
Escola de Engenharia 2
Definitions
• However, what is not completely defined in the
theorem is a constructive method for designing
such a sophisticated coding technique.
• There are basically two mechanisms for adding
redundancy, in relation to error-control coding
techniques:
– Block coding
– Convolutional coding.

Universidade do Minho
Escola de Engenharia 3
Definitions
• For a given practical requirement, detection of
errors is simpler than the correction of errors.

• The decision for applying detection or correction


in a given code design depends on the
characteristics of the application.

Universidade do Minho
Escola de Engenharia 4
Definitions
• Codes can be designed for detecting errors, the
correction is performed by requiring a repetition of
the transmission. These schemes are known as
automatic repeat reQuest (ARQ) schemes.
• When there is no possibility of requiring
retransmission in the case of a detected error, and so
the receiver has to implement some error-correction
algorithm to properly decode the message. This
transmission mode is known as forward error
correction (FEC).

Universidade do Minho
Escola de Engenharia 5
The Repetition Code
• One of the simplest ways of performing coding is to
repeat a transmitted symbol n times.
• If this transmission uses a binary alphabet then the
bit ‘1’ is usually represented by a sequence of n
‘1’s, while the bit ‘0’ is represented by a sequence
of n ‘0’s.
– 1 -> 11..1
– 0 -> 00..0

Universidade do Minho
Escola de Engenharia 6
The Repetition Code
• If errors happen randomly and with an error
probability Pe = p [as happens in the case of the
binary symmetric channel (BSC)], the binomial
distribution describes the probability of having i
errors in a word of n bits:
n i n i n i
p (i, n)    p (1  p )    p , p  1 (1)
i  i 
n n!
   (2)
 i  (n  i )!i!
Universidade do Minho
Escola de Engenharia 7
The Repetition Code
• Usually the value of p is small enough to validate the
approximation made in equation (1). On the other
hand, and for the same reason, it will be also true
that if p << 1, then the probability of having i errors is
higher than that of having i + 1 errors; that is:

P(i + 1, n) << P(i, n) ---- Why?

Universidade do Minho
Escola de Engenharia 8
Block codes
Original sequence

Coded sequence
n
(n,k) – block code
Information bits
k: information bits (message) - 2k possible messages
Parity check bits
n: coded bits or the bits of the codeword – 2n possible
codewords

n – k: redundant bits or parity check bits.

Code rate: Rc = k / n
Universidade do Minho
Escola de Engenharia 9
Block Codes - Introduction
• Error-control coding requires the use of a mechanism for
adding redundancy to the message word.
• This redundancy addition (encoding operation) can be
performed in different ways, but always in a way that by
applying the inverse operation (decoding) at the decoder
the message information can be successfully recovered.
• The final step in the decoding process involves the
application of the decoding procedure, and then the
discarding of the redundancy bits, since they do not contain
any message information.

Universidade do Minho
Escola de Engenharia 10
Block Codes – Vector Spaces
• Since the 2k messages are converted into codewords of n
bits, this encoding procedure can be understood as an
expansion of the message vector space of size 2k to a coded
vector space of larger size 2n, from which a set of 2k
codewords is conveniently selected.
• Block codes can be properly analysed by using vector space
theory.
• A vector space is essentially a set of vectors ruled by certain
conditions, which are verified by performing operations
over these vectors, operations that are usually defined over
a given field F.

Universidade do Minho
Escola de Engenharia 11
Block Codes – Galois Fields
• A very useful vector space for the description of block codes is
the vector space defined over the binary field, or Galois field
GF(2). Galois fields GF(q) are defined for all the prime
numbers q and their powers.
• The binary field GF(2) is a particular case of a Galois field for
which q = 2. Consider an ordered sequence of n components
(a0, a1, . . . , an−1) where each component ai is an element of
the field GF(2), that is, an element adopting one of the two
possible values 0 or 1.
• This sequence will be called an n-component vector. There
will be a total of 2n vectors. The corresponding vector space
for this set of vectors will be denoted as Vn.
Universidade do Minho
Escola de Engenharia 12
Block Codes – Modulo-2 addition
• The binary addition operation  is defined for this vector
space as follows:
– if u = (u1, u2,…, un−1) and v = (v1, v2,…, vn−1) are vectors in
Vn, then: u  v = (u1  v1, u2  v2, ..., un  vn)
– Where  is the classic modulo-2 addition.
• Since the sum vector is also an n-component vector, this
vector also belongs to the vector space Vn, and so the vector
space is said to be closed under the addition operation .
• The addition of any two vectors of a given vector space is also
another vector of the same vector space.

Universidade do Minho
Escola de Engenharia 13
Modulo-2 addition and multiplication.
Modulo-2 addition Modulo-2 multiplication

00=0 00=0
01=1 01=0
10=1 10=0
11=0 11=1

• Vn is a commutative group under the addition operation.


• The all-zero vector 0 = (0, 0, …, 0) is also in the vector space
• u  0 = (u1 0, u2  0, . . . , un  0) = u
• u  u = (u1  u1, u2  u2, . . . , un  un) = 0
• a • u = (a • u1, a • u2, . . . , a • un−1) - product between a vector of the vectorial space
u  V and a scalar of the binary field a  GF(2)
• It can be shown that the addition and scalar multiplication fit the associative,
commutative and distributive laws, so that the set of vectors Vn is a vector space
defined over the binary field GF(2).

Universidade do Minho
Escola de Engenharia 14
Vector Subspaces
• For a given set of vectors forming a vector space V defined
over a field F, it is possible to find a subset of vectors inside
the vector space V, which can obey all the conditions for also
being a vector space.
• This subset S is called a subspace of the vector space V. This
non-empty subset S of the vector space V is a subspace if the
following conditions are obeyed:
– For any two vectors in S, u, v  S, the sum vector (u + v)  S.

– For any element of the field a  F and any vector u  S, the scalar
multiplication a • u  S.

Universidade do Minho
Escola de Engenharia 15
Vector Subspaces
• Example: The following subset is a subspace of the vector
space V4: S = {(0000), (1001), (0100), (1101)}
• On the other hand, if {v1, v2,…, vk} is a set of vectors of the
vector space V defined over F and a1, a2,…, ak are scalar
numbers of the field F, the sum:
– a1 • v1  a2 • v2  ·· ·  ak • vk
• is called a linear combination of the vectors {v1,v2,…, vk}.
• Addition of linear combinations and multiplication of a linear
combination by an element of the field F are also linear
combinations of the vectors {v1, v2,…, vk}.

Universidade do Minho
Escola de Engenharia 16
Vector Subspaces
• Theorem: If {v1,v2,…, vk} are k vectors in V defined over F, the
set of all the linear combinations of {v1,v2,…, vk} is a subspace
S of V.

• Example: By considering two vectors (1001) and (0100) of the


vector space V4, their linear combinations form the same
subspace S as shown in the above example:
– 0 • (1001)  0 • (0100) = (0000)
– 0 • (1001)  1 • (0100) = (0100)
– 1 • (1001)  0 • (0100) = (1001)
– 1 • (1001)  1 • (0100) = (1101)

Universidade do Minho
Escola de Engenharia 17
Vector Subspaces
• A set of k vectors {v1,v2,…, vk} is said to be linearly dependent if and
only if there exist k scalars of the field F, not all equal to zero, such
that a linear combination is equal to the all-zero vector:
– a1 • v1  a2 • v2  ·· ·  ak • vk = 0
• If the set of vectors is not linearly dependent, then this set is said to
be linearly independent.
• Example: Vectors (1001), (0100) and (1101) are linearly dependent
because
– 1 • (1001)  1 • (0100)  1 • (1101) = (0000)
• A set of vectors is said to generate a vector space V if each vector in
that vector space is a linear combination of the vectors of the set.

Universidade do Minho
Escola de Engenharia 18
Dual Subspaces
• If S is a k-dimensional subspace of the n-dimensional vector
space Vn, the set Sd of vectors v for which for any u  S and v
 Sd, u ◦ v = 0 is called the dual subspace of S.
• It is possible to demonstrate that this set is also a subspace of
Vn.
• Moreover, it can also be demonstrated that if the subspace S
is of dimension k, the dual subspace Sd is of dimension (n − k).
In other words:
– dim(S) + dim(Sd) = n

Universidade do Minho
Escola de Engenharia 19
Dual Subspaces
• Example: For the vector space V4 over GF(2), the following set of
vectors
– S = {(0000), (0011), (0110), (0100), (0101), (0111), (0010), (0001)}

• is a three-dimensional subspace of V4 for which the one-


dimensional subspace
– Sd = {(0000), (1000)} is the dual subspace

• Sd of S.

Universidade do Minho
Escola de Engenharia 20
Linear Block Codes
• Definition: A block code of length n and 2k message words is said to be a
linear block code Cb(n, k) if the 2k codewords form a vector subspace, of
dimension k, of the vector space Vn of all the vectors of length n with
components in the field GF(2)
• Encoding basically means to take the 2k binary message words of k bits
each, and assign to them some of the 2n vectors of n bits.
• Since usually k < n, there are more vectors of n bits than those of k bits,
and so the selection of the vectors of n bits has to be done using the
lowest level of redundancy while maximizing the distance among the
codewords.
• The set of 2k codewords constitute a vector subspace of the set of words
of n bits. As a consequence of its definition, a linear block code is
characterized by the fact that the sum of any of two codewords is also a
codeword.

Universidade do Minho
Escola de Engenharia 21
Generator Matrix G
• Since a linear block code Cb(n, k) is a vector subspace of the vector
space Vn, there will be k linearly independent vectors that in turn are
codewords g0, g1,…, gk−1, such that each possible codeword is a linear
combination of them:

– c = m0 • g0  m1 • g1  ·· ·  mk−1 • gk−1

• These linearly independent vectors can be arranged in a matrix called


the generator matrix G:

[k X n]

Universidade do Minho
Escola de Engenharia 22
Generator Matrix G
• This is a matrix mechanism for generating any codeword. For a given message
vector:

– m = (m0, m1, …, mk−1), the corresponding codeword is obtained by matrix


multiplication:

– ‘◦’ represents the inner product between vectors or matrices

– ‘•’ represents the multiplication by a scalar in the field GF(2) of a vector of the
vector space or subspace used
Universidade do Minho
Escola de Engenharia 23
Generator Matrix G
• The rows of the generator matrix G generate the linear block code Cb(n,
k), or, equivalently, the k linearly independent rows of G completely
define the code.
– Example: Codewords of a linear block code Cb(7, 4)

Universidade do Minho
Escola de Engenharia 24
Generator Matrix G
• Example: Consider the following generator matrix (4×7) and
obtain the codeword corresponding to the vector message m =
(1001).

• The corresponding codeword is:

c = m ◦ G = 1 • g0  0 • g1  0 • g2  1 • g3

= (1101000)  (1010001) = (0111001)


Universidade do Minho
Escola de Engenharia 25
Block Codes in Systematic Form
• It can be seen that the last four bits of each codeword are the same as the
message bits; that is, the message appears as it is, inside the codeword.
• In this case, the first three bits are the so-called parity check or
redundancy bits.
• This particular form of the codeword is called systematic form. In this
form, the codewords consist of the (n − k) parity check bits followed by the
k bits of the message. The structure of a codeword in systematic form is
shown above

n − k parity check bits k message bits

• but this can be done the other way round. However, the choice of
convention does not modify the properties of a given block code, although
some mathematic expressions related to the code will of course adopt a
different form in each case.
Universidade do Minho
Escola de Engenharia 26
Block Codes in Systematic Form
• Generator matrix of the systematic linear block code Cb(n, k):

• which, in a compact notation, is G = [P Ik]


• Example: linear block code Cb(7, 4)

Universidade do Minho
Escola de Engenharia 27
Parity Check Matrix H
• The 2n−k linear combinations of the matrix H generate the dual
code Cbd(n, n − k), which is the dual subspace of the code Cb
generated by the matrix G.
• The systematic form of the parity check matrix H of the code
Cb generated by the generator matrix G is:

• where PT is the transpose of the parity check submatrix P.


• The matrix H is constructed so that: G ◦ HT = 0
Universidade do Minho
Escola de Engenharia 28
Parity Check Matrix H
• Example: Determine the parity check matrix H for the linear
block code Cb(7, 4) generated by the generator matrix

• the parity check matrix H is constructed using the submatrices


P and I:

• A practical implementation of these codes could be done


using combinational logic for the parity check equations
Universidade do Minho
Escola de Engenharia 29
Errors in a noisy channel
• The codeword c = (c0, c1, …, cn−1) is such that its
components are taken from the binary field GF(2), ci
 GF(2).
• As a consequence of its transmission through a noisy
channel, this codeword could be received containing
some possible errors.
• The received vector can therefore be different from
the corresponding transmitted codeword, and it will
be denoted as:
– r = (r0, r1, …, rn−1), where it is also true that ri  GF(2).
Universidade do Minho
Escola de Engenharia 30
Error pattern
• An error event can be modelled as an error vector or
error pattern
– e = (e0, e1, …, en−1), ei  GF(2),
• which is related to the codeword and received vectors as
follows:
– e=rc
• it is possible to do a correction of the received vector in
order to determine an estimate of the valid codeword,
and this can be done by using the expression
– c=re

Universidade do Minho
Escola de Engenharia 31
Syndrome vector
• Since any codeword should obey the condition:
– c ◦ HT = 0
• an error-detection mechanism can be implemented
based on the above expression, which adopts the
following form:
– S = r ◦ HT = (s0, s1, ..., sn−k−1) -> Syndrome vector
– The dimension of the syndrome vector is 1 × (n − k).
• The detection operation is performed over the received
vector, so that if this operation results in the all-zero
vector, then the received vector is considered to be a
valid codeword
Universidade do Minho
Escola de Engenharia 32
Syndrome vector
• Since:
– r=ce
• In case of the decoder has detected errors.
– S = r ◦ HT = (c  e) ◦ HT = c ◦ HT  e ◦ HT = e ◦ HT
• If the error pattern is the all-zero vector, then the
syndrome vector will also be an all-zero vector, and thus
the received vector is a valid codeword.
• When the syndrome vector contains at least one non-
zero component, it will be detecting the presence of
errors in the received vector.

Universidade do Minho
Escola de Engenharia 33
Syndrome error detection
• If the error pattern is equal to a codeword; that is, if the number
and positions of the errors are such that the transmitted
codeword is converted into another codeword, then the
syndrome vector can be the all-zero vector!!!
• This error pattern will not be detected by the syndrome
operation. This is what is called an undetected error pattern, and
as such is not within the error-correction capability of the code.
• Undetected error patterns are characterized by satisfying the
condition S = e ◦ HT = 0; that is, these are the error patterns that
are equal to one of the codewords (e = c). There will be
therefore 2k − 1 undetectable non-zero error patterns.

Universidade do Minho
Escola de Engenharia 34
Syndrome error detection
• Example: For the same linear block code Cb(7, 4), as seen in
previous examples, obtain the analytical expressions for the
syndrome vector’s bits.

– If r = (r0, r1, r2, r3, r4, r5, r6)

Universidade do Minho
Escola de Engenharia 35
Syndrome error detection
• The syndrome vector does not depend on the received vector,
but on the error vector.
• These will allow us to evaluate the error vector, which in turn
will allow us to do an estimation of a valid codeword.
• However, this set of (n − k) equations does not have a unique
solution, but exhibits 2k solutions.
• This is due to the fact that there are 2k error patterns that
produce the same syndrome vector.
• Because the noise power normally acts with minimum effect,
the error pattern with the least number of errors will be
considered to be the true solution of this system of equations

Universidade do Minho
Escola de Engenharia 36
Syndrome error detection
• Example: For the linear block code Cb(7,4) of the previous
examples, a transmitted codeword
– c = (0011010)
• is affected by the channel noise and received as:
– r = (0001010).
• The calculation of the syndrome vector results:
– S = (001)
• which in terms of the system of equations becomes:
– 0 = e0  e3  e5  e6
– 0 = e1  e3  e4  e5
– 1 = e2  e4  e5  e6

Universidade do Minho
Escola de Engenharia 37
Syndrome error detection
• There are 24 = 16 different error patterns that satisfy the above equations:

• Since the error pattern with i errors is more likely than the error pattern of
i + 1 errors, the smallest number of non-zero components will be
considered as the true error pattern
– c = r  e = (0011010) = (0001010)  (0010000)

Universidade do Minho
Escola de Engenharia 38
Minimum Distance of a BC
• Definition: The number of non-zero components ci ≠ 0 of a given vector c =
(c0, c1, …, cn−1) of size (1 × n) is called the weight, or Hamming weight,
w(c), of that vector. In the case of a vector defined over the binary field
GF(2), the weight is the number of ‘1’s in the vector.
• Definition: The Hamming distance between any two vectors c1 = (c01, c11,
…, cn−1,1) and c2 = (c02, c12, …, cn−1,2), d(c1, c2), is the number of component
positions in which the two vectors differ.
– For instance, if c1 = (0011010) and c2 = (1011100), then d(c1, c2) = 3
• According to the above definitions, it can be verified that:
– d(ci , cj ) = w(ci  cj )
• This minimum value of the distance, evaluated over all the codewords, of
the code is called the minimum distance of the code:
– dmin = min { d(ci , cj); ci , cj  Cb; ci ≠ cj }

Universidade do Minho
Escola de Engenharia 39
Minimum Distance of a BC
• Since, in general, block codes are designed to be linear, the addition of any
two code vectors is another code vector,
• Any codeword can be seen as the addition of at least 2 other codewords,
• Hamming distance is the number of positions in which 2 vectors differ,
• The weight of the sum of 2 vectors is the Hamming distance between these 2
vectors
•  then the weight of a codeword is at the same time the distance between 2
other vectors of that code,
•  then the minimum value of the weight evaluated over all the codewords of
a code, excepting the all-zero vector, is the minimum distance of the code
• Therefore, the minimum distance of a linear block code Cb(n, k) is the
minimum value of the weight of the non-zero codewords of that code – see
previous examples

Universidade do Minho
Escola de Engenharia 40
Minimum Distance and H matrix
• Theorem:
• Consider a linear block code Cb(n, k) completely determined by its parity
check matrix H.
• For each codeword of Hamming weight pH, there exist pH columns of the
parity check matrix H that when added together result in the all-zero
vector.
• In the same way, it can be said that if the parity check matrix H contains pH
columns that when added give the all-zero vector, then there is in the
code a vector of weight pH
• For a linear block code Cb(n, k) completely determined by its parity check
matrix H, the minimum weight or minimum distance of this code is equal
to the minimum number of columns of that matrix which when added
together result in the all-zero vector 0.

Universidade do Minho
Escola de Engenharia 41
Minimum Distance and H matrix
• Example:
• For the linear block code Cb(7, 4), as seen in previous examples, whose
parity check matrix is of the form:

1 0 0 1 0 1 1
H  0 1 0 1 1 1 0
0 0 1 0 1 1 1

• Determine the minimum distance of this code


• Answer:
• It can be seen that the addition of the first, third and seventh column
results in the all-zero vector 0. Hence, and because the same result cannot
be obtained by the addition of only two columns, the minimum distance
of this code is dmin = 3.

Universidade do Minho
Escola de Engenharia 42
Error-Detection Capability of a BC
• The minimum distance of a code is the minimum number of components
changed by the effect of the noise that converts a code vector into another
vector of the same code.
• If having transmitted the codeword c the noise transforms this vector in the
received vector r, the distance between c and r is the weight of the error
pattern d(c, r) = w(e) = l, that is, the number of positions that change their
value in the original vector c due to the effects of noise.
• If the noise modifies dmin positions, then it is possible in the worst case that a
code vector is transformed into another vector of the same code, so that the
error event is undetectable.
• If the number of positions the noise alters is dmin−1, it is guaranteed that the
codeword cannot be converted into another codeword
•  Error-Detection Capability of a linear block code Cb(n, k) of minimum
distance dmin is dmin − 1

Universidade do Minho
Escola de Engenharia 43
Probability of an Undetected Error
• The error-detection capability of a code can be measured by means of the
probability that the code fails to determine an estimate of the codeword from
the received vector
• The Probability of an undetected error is evaluated using the weight
distribution function of the code.
• Since a detection failure happens when the error pattern is equal to a non-
zero codeword:

pU ( E )  i 1 Ai p (1  p) n i
n i

• where Ai is the number of codewords of weight i and p is the error probability


for the BSC, for which this analysis is valid.
• When the minimum distance is dmin, the values of A1 to Admin−1 are all zero.

Universidade do Minho
Escola de Engenharia 44
Error-Correction Capability of a BC
• The same considerations are used to prove that:

 d min  1
t
 2 
• The code is able to successfully decode any error pattern of weight
t , where [ _ ] means the largest integer number no greater than _
• The word or code vector error probability is:

n i
pwe  i t 1   p (1  p ) n i
n

i 

Universidade do Minho
Escola de Engenharia 45
Error Correction / Detection
• Summary:

d min  l  1 only detection

d min  2t  1 only correction

d min  t  l  1 (l  t ) detection and correction

Universidade do Minho
Escola de Engenharia 46
Hamming codes
• In 1950 R. Hamming introduced a code family:
– Length n = 2m − 1
– Number of message bits k = 2m − m − 1
– Number of parity check bits n − k = m
– Error-correction capability t = 1, (dmin = 3)
– For any positive integer m ≥ 3

• H = [Im Q]:
– Im is a square matrix of size m × m and the sub-matrix Q consists of the 2m −
m − 1 columns formed with vectors of weight 2 or more.

• Examples of Hamming codes: (7,4) , (15,11), (31,26) ,


(2n-k - 1, k)

Universidade do Minho
Escola de Engenharia 47
Hamming codes
• The generator matrix can be constructed using the
following expression for linear block codes of
systematic form:
– G = [QT I2m−m−1]
• In H, the sum of 3 columns can result in the all-zero
vector, and it is not possible for the sum of 2 columns
to give the same result, and so the minimum
distance of the code is dmin = 3.
• This means that t = 1 and l = 2

Universidade do Minho
Escola de Engenharia 48
Hamming codes
• There are 2m − 1 correctable error patterns and
there exist 2m cosets, so that the number of
possible correctable error patterns is the same as
the number of different cosets (syndrome
vectors).

• The codes with this characteristic are called


perfect codes.

Universidade do Minho
Escola de Engenharia 49
Cyclic Codes
• Cyclic codes are an important class of linear block
codes
• Easily implemented using shift registers.
• A given linear block code is said to be cyclic if for
each of its code vectors the ith cyclic rotation is
also a code vector of the same code
• Being a linear block code, the sum of any two
code vectors of a cyclic code is also a code vector.

Universidade do Minho
Escola de Engenharia 50
Definitions
• Cyclic codes can be represented by polynomials.
• A polynomial representation c(X) of a code vector
c = (c0, c1,..., cn−1) is then of the form:
– c(X) = c0 + c1 X + ·· ·+ cn−1 Xn−1
• Operations with polynomials defined over a given
field are the same as usual.
• In the case of polynomials defined over the binary
field GF(2), the operations are addition and
multiplication modulo 2.

Universidade do Minho
Escola de Engenharia 51
Definitions
• Addition:
– c1(X) = c01 + c11X + ·· ·+cn−1,1Xn−1
– c2(X) = c02 + c12X + ·· ·+cn−1,2Xn−1

– c1(X)  c2(X) = c01  c02 + (c11  c12) X + ·· ·+(cn−1,1 


cn−1,2) Xn−1

• Multiplication
– c1(X) • c2(X) = c01 • c02 + (c01 • c12  c02 • c11) X +· ·
·+(cn−1,1 • cn−1,2) X2(n−1)

Universidade do Minho
Escola de Engenharia 52
Definitions
• Addition and multiplication of polynomials obey
the commutative, associative and distributive
laws.
• A polynomial for a code vector of n components is
a polynomial of degree n − 1 or less.
• Codewords of a given cyclic code Ccyc(n, k) will be
equivalently referred to as code vectors or code
polynomials.

Universidade do Minho
Escola de Engenharia 53
Example
• Cyclic Code (7,3)

• C1 = 1 0 1 1 1 0 0
• C2 = 1 1 1 0 0 1 0
• C3 = 0 1 1 1 0 0 1

• - Determine the remaining codewords


Universidade do Minho
Escola de Engenharia 54
Definitions
• The polynomial expression for the i-position right-
shift rotated polynomial c(i)(X) of the original code
polynomial c(X) is equal to:
– c(i)(X) = Xi c(X) mod (Xn + 1)
– mod is the modulo operation, calculated by taking the
remainder of the division of Xi c(X) and Xn + 1.
– The non-zero minimum-degree code polynomial of a
given cyclic code Ccyc(n, k) is unique
– In the non-zero minimum-degree polynomial of a given
Ccyc(n, k), g0 = 1.

Universidade do Minho
Escola de Engenharia 55
Generator Polynomial of a Cyclic Code
• In a linear Ccyc(n,k), there is a unique non-zero
minimum-degree code polynomial, and any other
code polynomial is a multiple of this polynomial. g(X)
Generator
– g(X) = 1 + g1X + ·· ·+gn-k−1Xn-k−1 + Xn-k Polynomial.
• The non-zero minimum-degree polynomial is of
degree n - k and any other code polynomial of the
linear Ccyc(n,k) is of degree n − 1 or less
– c(X) = m(X).g(X) = (m0 + m1X + ·· ·+mk−1Xk−1). g(X)
– where mi , i = 0, 1, 2, . . . , k − 1, are the bits of the
message vector to be encoded

Universidade do Minho
Escola de Engenharia 56
Generator Polynomial of a Cyclic Code
• There are two important relationships between
the generator polynomial g(X) and the
polynomial Xn + 1:
– if g(X) is a generator polynomial of a given linear
Ccyc(n, k), then g(X) is a factor of Xn + 1,
– if a polynomial of degree n−k is a factor of Xn + 1, then
this polynomial generates a linear Ccyc(n, k).
• Any polynomial factor of Xn + 1 can generate a
linear Ccyc(n, k).

Universidade do Minho
Escola de Engenharia 57
Cyclic Codes in Systematic Form
• Given a polynomial that fits the conditions for being
the generator polynomial of a linear Ccyc(n, k), and if
the message polynomial is of the form:
– m(X) = m0 + m1X +· · ·+mk−1Xk−1
• The systematic version of the linear Ccyc(n, k) can be
obtained by performing the following operations:
– The polynomial Xn−k.m(X) = m0Xn−k + m1Xn−k+1 + ·· ·+mk−1Xn−1
is first formed
– then divided by the generator polynomial g(X):

Universidade do Minho
Escola de Engenharia 58
Cyclic Codes in Systematic Form
• The result is:
– Xn−k .m(X) = q(X).g(X) + p(X)
• p(X) is the remainder polynomial of the division, which has
degree n−k−1 or less, since degree of g(X) is n−k
• Reordering last equation:
– Xn−k m(X) - p(X) = q(X).g(X) ----> Factor of g(X)
• This procedure allows the code polynomial to
adopt the systematic form!!
• When expressed as a code vector is equal to:
– c = (p0, p1, . . . , pn−k−1, m0, m1, . . . , mk−1)

Universidade do Minho
Escola de Engenharia 59
Generator Matrix of a Cyclic Code
• As seen previous, a linear Ccyc(n, k) generated by
the generator polynomial:
– g(X) = 1 + g1X + ·· ·+gn-k−1Xn-k−1 + Xn-k
• is spanned by the k code polynomials:
– g(X), X.g(X), …, Xn−k.g(X)
– which can be represented as row vectors of a
generator matrix of dimension k × n:

Universidade do Minho
Escola de Engenharia 60
Generator Matrix of a Cyclic Code
• Example:
– For the linear Ccyc(7, 4) generated by the polynomial
g(X) = 1 + X + X3, determine G and then convert it into a
systematic generator matrix.
• Resolution:

replacing the third row replacing the fourth row


by the addition of the first by the addition of the first,
and third rows, second and fourth rows,

– This last modified matrix G’’ generates the same code


as that of the generator matrix G.
Universidade do Minho
Escola de Engenharia 61
Syndrome Calculation
• As defined for block codes, the received vector,
which is the transmitted vector containing
possible errors, is r = (r0, r1, ..., rn−1). This is a
vector with elements which can also have a
polynomial representation:
– r (X) = r0 + r1X + r2X2 + ·· ·+rn−1Xn−1
• Dividing this polynomial by g(X) gives:
– r (X) = q(X).g(X) + S(X)
– the remainder of this division is a polynomial of degree
n − k − 1 or less.

Universidade do Minho
Escola de Engenharia 62
Syndrome Calculation
• Since a code polynomial is a multiple of g(X), then
if the remainder of the division is zero, the
received polynomial is a code polynomial.
• If the division has a non-zero polynomial as the
remainder, then the procedure detects a
polynomial that does not belong to the code
• The syndrome vector is again a vector of n − k
components that are at the same time the
coefficients of the polynomial:
– S(X) = s0 + s1X + ·· ·+sn−k−1Xn−k−1.

Universidade do Minho
Escola de Engenharia 63
Decoding of Cyclic Codes
• A table S → e identifying the relationship
between the syndromes and the error patterns is
constructed
• Syndrome polynomial is evaluated for the
received polynomial r (X)
– dividing this polynomial by the generator polynomial
g(X) to obtain the syndrome polynomial.
• The constructed table allows us to identify the
error pattern that corresponds to the calculated
syndrome.

Universidade do Minho
Escola de Engenharia 64
Cyclic Codes Circuits
• Circuit to multiply m(x).G(x)

• Multiplication ends when the last input bit cross


shift-register. It is necessary to continue shifting
with a number of “0” equal to the number of
levels
Universidade do Minho
Escola de Engenharia 65
Cyclic Codes Circuits
• Circuit to divide y(x):G(x)

• Number of levels = degree of g(x)


• After n shifts the quocient is at the output and …
• … the remainder is stored at the register
Universidade do Minho
Escola de Engenharia 66
Cyclic Codes Circuits
• Example:
• A(x) =x5+x3+x+1
• B(x) = x4+x2+x+1
• A(x).B(x) = ?

Universidade do Minho
Escola de Engenharia 67
Cyclic Codes Circuits
• Example:
• C(x) = x8+ x6+ x2+ x+1
• D(x) =x5+x2+x+1
• C(x) ÷ D(x) = ?

Remainder: x4 + x2 + x

Universidade do Minho
Escola de Engenharia 68
Cyclic Codes Circuits
• Systematic Encoder

• During the first k bits both switches are in A – Position


• During the n - k parity bits the switches are in B – Position
• While the lower switch is in A, the k information bits go directly to the output
• In B, the contents of the shift-register (parity bits) go to the output

Universidade do Minho
Escola de Engenharia 69
Cyclic Codes Circuits
• Syndrome Calculator

• To evaluate the syndrome we only need to divide


the received word by G(x). This circuit is the same
of that we used to divide two polynomials.

Universidade do Minho
Escola de Engenharia 70
Reading Material
• S. Lin and D. J. Costello. Error Control Coding. Prentice-
Hall, Upper Saddle River, NJ, 2nd edition, 2004 (ISBN 0-
13-017973-6)
• Sílvio A. Abrantes. Códigos Correctores de Erros em
Comunicações Digitais, FEUP Edições, Porto, 2010
(ISBN 978-972-752-127-2)
• Simon Haykin. Communication Systems, McMaster
Univ, 4th Edition, 2004. (ISBN: 978-0-471-17869-9)

Universidade do Minho
Escola de Engenharia 71
Reading Material

Universidade do Minho
Escola de Engenharia 72

You might also like