You are on page 1of 65

Error Control Coding

The Structured Sequences


(Block Codes, cyclic codes, Convolutional
Codes, Turbo and other important codes)

Commercial advantages of Coding


Coding gains can give more than 10 dB
performance improvement.
VLSI and DSP chips are cheaper than higher
power transmitters, bigger antennas

Concept of redundancy
Systematic generation and addition of redundant bits to the
message bits, at the transmitter, such that transmission errors
can be minimized by performing an inverse operation, at the
receiver. e.g. Triple repetition codes,
Data bit 0 - replaced by the code 000

Data bit 1 - replaced by the code 111


Lower error rate should be obtained for same transmitted
power i.e. n coded bits should carry same power as was
carried by k uncoded bits.
It endorses the Shannons Power-BW tradeoff i.e. for same
BER power saving is possible at the expense of more
bandwidth as needed in redundant bit transmission.

Code vectors, Hamming Distance


n-bit codeword can be represented as a code
vector in a n-dimensional vector space. Each
unit weight vector represents a unique
dimension/direction.
001
011
111

101

000
100

110

010

Only 2k are valid code vectors out of 2n


total possible unique vectors.
The distance between two code vectors is
measured as the weight of the resultant
when mod-2 addition is done on these
vectors.
The minimum distance between all
possible pairs of valid code vectors is
called the hamming distance (dmin).

Error control capability , Code rate


Detect up to t errors
dmin >= t+1
Correct up to t errors
dmin >= 2t+1
Code Rate (Rc)
Rc = k/n

A good code should have


High dmin and Rc should be close to 1.

Triple repetition codes


If probability of transmission error of a
channel is x per bit and Triple repetition
codes are used. Calculate the
probability that the received word will
be in error when
(a) it is used for error correction
(b) It is used for error detection

Pwe,uncoded = x
- With triple repetition code
Pwe,detection = P(3,3) = x3
Pwe,correction = P(2,3) + P(3,3) = 3x2 -2x3
- For any channel with x<<1
Pwe,uncoded > Pwe,correction > Pwe,detection
- The cost is paid in terms of reduction in
bit rate.

FEC and BEC systems


In FEC systems the receiver processes every
received data packet. (sometimes it may
introduce more errors instead of correcting an
existing error).
BEC systems uses error detecting codes and
retransmission of packet is requested for error
correction. An ARQ protocol is used for this
purpose

Performance of FEC system


Eb represents average energy per message
bit for uncoded transmission then b = Eb/N0
and message BER (Pube) = BER by channel =
Q(sqrt(2*b))
For comparison the message bit energy in
coded system should remain same thus
energy per code bit should be c =RcEb/N0
and BER by channel ()= Q(sqrt(2*Rc*b))

If a code can correct up to t errors in a word


then considering word error due to t+1 errors
can be given by Pwe=nCt+1t+1(Ignoring (1-) term and
error patterns t+2 to n)

Since in n bit code word there exists t+1 error


bits thus message bit error per uncorrected
code word = (k/n)(t+1)
When N words are transmitted then total
number of erroneous message bits = (k/n)
(t+1)NPwe
Pbe= [(k/n)(t+1)NPwe]/Nk = n-1Ctt+1

Pbe= n-1Ctt+1 = n-1Ct [Q(sqrt(2*Rcb))]t+1


On approximating the Q function by exponential function it can
be seen that Pbe involve e-(t+1)Rcb and e-b respectively for coded
and uncoded cases.
Thus (t+1)Rc>1 for better performance of FEC system. Also the
1 or 2 bit error correcting code words should have relatively
higher Rc.
By plotting Pbe for both cases (coded and uncoded) it can be
observed that coding is beneficial for a reasonably high value of
b.
For moderate value it might be better to increase power with
uncoded transmission. For low value coding will make the
situation worse. (Ex 13.1.1)

BEC System
Error Detecting codes
Horizontal Redundancy Check (HRC)
Vertical Redundancy check (VLR)
Cyclic Redundancy Check (CRC)
Checksum

Automatic Repeat Request (ARQ)


Stop and wait
Go Back to n
Selective repeat/reject

ARQ Techniques

Performance of ARQ
As far as Pbe is concerned (which depends upon
undetected errors) the expression for BEC remains
same as for FEC but with dmin=t+1.
Clearly, BEC seems advantageous in terms of Pbe
but we need to consider loss due to retransmission.
Probability of retransmission p=1-[P(0,n)+Pwe]
p=1- (1-)n = n (ignoring Pwe and other terms of (1-)n expansion)
Find average number of transmitted words per
accepted word and the throughput efficiency for srej?

Throughput efficiency Rc` = (k/n)(1-p)


Transmission bit rate = message bit rate/Rc`
In BEC Rc` plays same role as Rc in case of
FEC thus simply by doing this substitution all
the expressions developed for FEC can be
used.
Find the expression for Rc` for other sliding
window protocols?

Classification of codes
Error detecting/correcting.
Systematic/nonsystematic
Binary/nonbinary
Block (includes cyclic codes)/convolutional
Recursive/nonrecursive

Linear Block codes (n,k)


Linearity Property
All zero vector must be a valid code
vector
Sum of any two valid code vectors
produces another valid code vector.

Advantage of linearity?

Requirement for Systematic codes


[X] = [M | C]
If G be the generator matrix such that
X=M*G
then G must be given as [Ik | P].
What should be the dimensions of X, M, C
and P?

The contents of P will produce the


redundant bits for a given message, thus
governs the hamming distance and error
correcting capability of generated code.
Can we generate a block code for a
specified hamming distance?
Can we generate a block code for a
specified hamming distance with a
constraint on n and k??

Till date, no such method is proposed by any


researcher. (surprised?? But there are reasons.)
A large number of good block codes have been
proposed using hit and trial method.
Hamming codes have single bit error correction
capability i.e. dmin =3, q>=3 and n=2q-1 (why?? It
will be clear very soon).
The parity matrix for generation of Hamming
codes should contain all q-bit words with two or
more than two 1s arranged in any order.

(7,4) Systematic Hamming code


The codewords for P = [101; 111; 110; 011]
M
0000
0001
0010
0011
0100
0101
0110
0111

C
000
011
110
101
111
100
001
010

W(x)
0
3
3
4
4
3
3
4

M
1000
1001
1010
1011
1100
1101
1110
1111

C
101
110
011
000
010
001
100
111

W(x)
3
4
4
3
3
4
4
7

Syndrome Decoding
HT

P
Iq

Xi*HT = (0 0 0 . . . . .0)1xq
If there is any error then Yi = Xi + Ei
The operation Yi*HT will generate a non zero
(1xq) vector called syndrome (S).

The Receiver already posses a syndrome


table. The generated syndrome (from
previous operation) is searched in it to find
the corresponding error vector can be
obtained.
This error vector is added with Yi to get Xi.
as Yi + Ei = Xi + Ei + Ei = Xi .
How does the receiver already has a
syndrome table?

S = Y*HT = E*HT
All possible error patterns E are already known
(depending upon error correcting capability of
code) and HT is also a known quantity.
Hence, If a code is to correct up to t errors per
word then
2q 1 >= n + nC2 + nC3 . . . . . . + nCt
(Total no. of syndromes - 1) >= (possible error patterns)

Syndrome table
(S)
000
101
111
110
011
100
010
001

(E)
0000000
1000000
0100000
0010000
0001000
0000100
0000010
0000001

To accommodate the
syndrome table the
decoder needs to
store (q+n)*2q bits.
Larger is the table
size more time will
be required to find
error vector thus
decoding delay will
be increased.

Drawbacks of block codes


The Syndrome decoding requires,
2q 1 >= n + nC2 + nC3 . . . . . . + nCt
q*Log (2) >= log{ nCi}; 0<=i<=t ; base =2
n k = n*(1-k/n) = log { nCi}

1 Rc = (1/n)*log { nCi}
Rc should be close to unity in order to minimize overhead but
it requires n>>1 which in turn requires more memory space
and decoding time.

If every cyclic shift of a valid code


vector produces another valid code
vector then it is known as cyclic code.

(7,4) Cyclic code example


M
0000
0001
0010
0011
0100
0101
0110
0111

C
000
011
110
101
111
100
001
010

W(x)
0
3
3
4
4
3
3
4

M
1000
1001
1010
1011
1100
1101
1110
1111

C
101
110
011
000
010
001
100
111

W(x)
3
4
4
3
3
4
4
7

Generation of cyclic codes


The cyclic shift of a codeword:
X(p) = xn-1pn-1+xn-2pn-2+..+x1p+x0

X(p) = p*X(p) + xn-1*(pn+1)

X = (xn-1 xn-2 .. x1 x0)


then
X =(xn-2 .. x1 x0 xn-1)

Theorem: If G(p) is a factor of (pn+1) having degree=q


then the multiplication of QM(p)*G(p) will generate a
cyclic code; where QM(p) is any k-bit message though
X(p) so generated may not be used as the codeword
for the message QM(p).
Hamming codes, BCH codes,
Golay codes etc. are
examples of cyclic codes.

If there are more than one factor of (pn+1) having


degree q then choose any factor. It will generate a
valid cyclic code but it may not possess optimum
error correcting capability

Systematic cyclic codes


For (n,k) code (q=n-k) the requirement is
X(p) = pq*M(p) + C(p)
Combining with cyclic property
QM(p)*G(p) = pq*M(p) + C(p)
QM(p) = {pq*M(p)}/G(p) + C(p)/G(p)
{pq*M(p)}/G(p) = QM(p) + C(p)/G(p)

Advantages of Cyclic codes


Simplified encoding and decoding.
Easy syndrome calculation S(p) = rem{Y(p)/G(p)}
Ingenious error correcting decoding methods have
been devised for specific cyclic codes. They
eliminate the storage needed for table lookup.
Cyclic Redundancy Codes (CRC), a class of cyclic
codes, has ability to detect burst errors of length q,
all single bit errors, any odd number of errors if
(p+1) is a factor of G(p), Double errors if G(p) has at
least three 1s.

(2,1,2) Convolutional Encoder


n No. of bits in
codeword,
k No. of fresh
input bits used in
generation of code,
L Encoders
memory.

Constraint length = n(L+1); some author says its L.

Code Tree, Code trellis and State Diagram

The generator polynomials

Continuing with same encoder


G1(p) = 1+p+p2 and G2(p) = 1+p2
The message polynomial
M(p) = 1+p+p3+p4+p5+p8 (see prvs slide)
Xj = M(p)*G1(p) = 1+p5+p7+p8+p9+p10
Xj = M(p)* G2(p) = 1+p+p2+p4+p6+p7+p8+p10

Thus Xj =XjXj =11 01 01 00 01 10 ...........


(same result as obtained previously)

The transformation in p-domain simplifies


the problem as it requires multiplication
instead of convolution. (something similar to
Fourier Transform of signals.)
In normal operation Xj can be evaluated as
following operation which is some what
equivalent to convolution (refer slide no. 5)
Xj = mj-i*gi

(mod-2); for 0<=i<=L

Free Distance
Free Distance (df)= [w(X)]min excluding all zero path.
Termination of trellis (to ensure all zero state for next
run and to find min weight non trivial path; = 5 in fig.)

Coding Gain
For a AWGN channel, the decoded error
probability for a convolution code having code
rate Rc = k/n; and free distance = df can be
derived as
Pbe proportional to e-(Rc*df/2)*b
Pbe improves when (Rc*df/2) >1.
By definition, Coding gain = (Rc*df/2) usually
expressed in dB.

Catastrophic error
If a finite number of channel errors causes
an infinite number of decoding errors.
If all generating polynomials Xj, Xj . of
Xj has a common factor then it occurs.
Systematic codes are free from this error
but they have poor error correcting
performance.

Example:G1(p) = 1+p and G2(p) = p+p2 has a


CF (1+p).

Viterbi Decoding

Maximum error correction, but max delay, high storage


and computation requirements

Other Decoding Methods


Sequential Decoding (The output is available
after each step. An increasing threshold is
used.)
(min delay, min error correction capability)

Feedback Decoding (First output is available


after predetermined number of steps (e.g. 3)
(moderate delay, moderate error correction)

Punctured Convolution codes


Transmission efficiency and Coding gain can
be improved by increasing code rate Rc.
The decoding of high code rate convolution
codes is very complicated due to very
complex trellis diagram.
Puncturing technique can be used to
improve the effective code rate without
increasing the complexity of decoder.

Improving code rate to k/n from 1/n


Choose a matrix P of dimension nxk.
It should have n ones and all other elements as
zero.
Consecutive k codewords (corresponding to k
input bits; assuming 1/n encoder) should be
compared with k columns of matrix P.
Wherever there is a zero in matrix P
corresponding bit (may be zero or one) of
corresponding code word should be dropped.

Thus total number of bits that are


transmitted are n for k input bits thus
effective code rate will be k/n.
Same matrix P is used at receiver. Either all
zeros or all ones are inserted at the place of
dropped bits.
Now it can be decoded using a simple
decoder which will treat the puncturing
errors as transmission errors.

RSC Codes

It is a (23,35) RSC encoder with R=1/2


Polynomial for feedback connection: 10011 = 238
Polynomial for check bit connection: 11101 = 358

Turbo Codes
almost all codes are good except those we can think of J. Wolfowitz
Turbo code encoder

Turbo code decoder

Claude Berrou et. Al. Near Shannon limit error correcting coding and decoding, Proc. IEEE Intl. conf. on comm., Geneva, 1993

Hard Vs. Soft decision decoding


The
representation
of
demodulator
o/p (m) >1 bit
corresponds
to soft
decision
decoding.

2dB gain with 3 bit and 2.2 dB with infinite bit representation.

Spread Spectrum Technology


Low power high bandwidth transmission.
Better performance in noisy condition.
Anti jamming feature
Security, etc.

Types of SS techniques
Direct Sequence Spread Spectrum (DS-SS)
e.g. CDMA
Frequency Hopping Spread Spectrum (FHSS)
Time hopping Spread Spectrum (TH-SS)
Hybrid (DS/FH, DS/TH, FH/TH,DS/FH/TH)

Direct Sequence Spread Spectrum (DS-SS)

This figure shows BPSK-DS


transmitter and receiver (multiplication
can be realized by RF-mixers)

spreading

A2 2
A
AA 22PPav
av
PP

av
av
2
2

DS-CDMA is used in WCDMA, cdma2000 and IS-95 systems

Effect of narrowband noise signal

Effect of wideband Interference

Basic principle of CDMA


Assumptions
Polar line coding is used.
All the users are synchronized
All the users produce same power level at the base
station.
Base station has a copy of all chipcodes of its
network
All the codes should be either PN-sequence or
orthogonal codes (preferable) i.e.
Cx*Cy = +1 if x= y
= -1
if x= complement (y)
=0
otherwise.

Algorithm
A unique codeword of same length
{Cx=(c1,c2,c3)} is assigned to each user.
A user transmits its codeword for transmitting
logic 1 and its compliment for 0.
The base station receives the algebraic sum
of chips {D=(d1,d2,)} transmitted by all the
active users.
The BS calculates Sx = Cx(i)*D(i) for all
users.
If it is above +ve (-ve) threshold user x has
transmitted logic 1 (0)

Problem:
There are three users A,B,C in a CDMA network
with corresponding chip sequences Ca = {1,-1,1,1,-1,1}, Cb = {1,1,-1,-1,1,1}, Cc = {1,1,-1,1,1,-1}.
If both the thresholds are set at 0 volts, find the
data decoded by BS when
(i) A transmits logic 1.
(ii) A and B transmit logic 1
(iii) A and C transmit logic 1.

PN - sequences
Uniform distribution and independence.
Period = 2n 1 bits; n= length of shift register
To identify a PN both algorithm (interconnection of
taps) and seed (starting point) must be known.
Seed can change the starting and ending point of a
PN sequence but the contents remains the same.
(this property is used for cell identification in CDMA
mobile systems.)
Walsh codes are known to be orthogonal codes.

Frequency Hopping Transmitter and Receiver


BW Wd

BW Ws

Hopping frequencies are


determined by the code.
This method is applied in
BlueTooth

2 L level modulation
BW Ws

May be slow (two or more


symbols are tx at same fc) or
fast (two or more frequencies
are used to transmit single
symbol)

BW Wd

2k frequencies

Frequency Hopping Spread Spectrum (FH-SS) (ex: tx


of two symbols/chip)
4-level FSK modulation

Hopped frequency
slot determined by
hopping code

2 L levels
2k slots
Wd 2 L f d ( data modulator BW)
Tb

L2

Tc :chip duration

Ws 2 Wd ( total FH spectral width) T : bit duration


b
k

Ts : symbol duration

DS and FH compared
FH is applicable in environments where there
exist tone jammers that can be overcame by
avoiding hopping on those frequencies
DS is applicable for multiple access because it
allows statistical multiplexing (resource
reallocation) to other users (power control)
FH applies usually non-coherent modulation
due to carrier synchronization difficulties ->
modulation method degrades performance

Both methods were first used in military comm,


FH can be advantageous because the
hopping span can be very large (makes
eavesdropping difficult)
DS can be advantageous because spectral
density can be much smaller than
background noise density (transmission is
unnoticed)
By using hybrid systems some benefits can be
combined: The system can have a low
probability of interception and negligible near-far
effect at the same time. (Differentially coherent
modulation is applicable)

FDMA, TDMA and CDMA compared


TDMA and FDMA principle:
TDMA allocates a time instant for a user
FDMA allocates a frequency band for a user
CDMA allocates a code for user

CDMA-system can be synchronous or


asynchronous:
Synchronous CDMA difficult to apply in multipath
channels that destroy code orthogonality
Therefore, in wireless CDMA-systems as in IS95,cdma2000, WCDMA and IEEE 802.11 users
are asynchronous

FDMA, TDMA and CDMA


yield conceptually the same
capacity
However, in wireless
communications CDMA has
improved capacity due to
statistical multiplexing
graceful degradation
Performance can still be
improved by adaptive antennas,
multiuser detection, FEC, and
multi-rate encoding

You might also like