You are on page 1of 38

Chapter 8

Reliability
and
Channel Coding

1
The Three Main Sources of Transmission Errors
•  Noise
–  Thermal / white noise
•  Interference
–  electromagnetic radiation emitted from devices such as electric motors
–  background cosmic radiation can cause noise that can disturb radio transmissions and
signals traveling across wires
•  Cosmit radiation consists of energetic charged particles, such as protons and Helium ions, moving
through space
•  When these particles enter the Earth's atmosphere they collide with, and disrupt, atoms in our
atmosphere, producing secondary, less intense, radiation
•  Distortion
–  All physical systems distort signals
–  As a pulse travels along an optical fiber, the pulse disperses
–  Wires have properties of capacitance and inductance
•  that block signals at some frequencies while admitting signals at other frequencies
–  Placing a wire near a large metal object can change the set of frequencies that can
pass through the wire
•  Metal objects can block some frequencies of radio waves, while passing others
•  Attenuation
–  As a signal passes across a medium, the signal becomes weaker
•  signals on wires or optical fibers become weaker over long distances, just as a radio signal
becomes weaker with distance
Ways to Improve Noise
•  Increase the signal-to-noise ratio (either by increasing the
signal or lowering noise if possible)
–  Physical transmission system is always susceptible to errors
–  It may not be possible to change the signal-to-noise ratio
•  Mechanisms like shielded wiring can help lower noise
•  Increase capacity by reducing BER
–  Reducing noise improves SNR and thus BER
Types of Error
•  An error occurs when a bit is altered between
transmission and reception
•  Single bit errors
–  only one bit altered Higher data rate
à more errors
–  caused by white noise
•  Burst errors
–  contiguous sequence of B bits in which first last and any
number of intermediate bits in error
–  caused by impulse noise or by fading in wireless
–  effect greater at higher data rates
•  Erasure
•  Sometimes a signal is neither clearly 1 nor clearly 0, but falls in an
ambiguous region, which is known as an erasure

If Data rate is 10 Mbps and the signal is 1usec / 0.1 usec


lost for only 1usec, how many bit errors occur? = 10 bits!
Types of Error

Bursts of errors due to


impulse noise:
Effect of Transmission Errors on Data
•  For a burst error, the burst size, or length, is defined as the
number of bits from the start of the corruption to the end of
the corruption

6
Two Strategies for Handling Channel
Errors
•  A variety of mathematical techniques have been developed
that overcome errors during transmission and increase
reliability
–  Known collectively as channel coding
•  The techniques can be divided into two broad categories:
–  Forward Error Correction (FEC) mechanisms
–  Automatic Repeat reQuest (ARQ) mechanism
•  In either case we are adding overhead
–  There is always a tradeoff - adding redundancy vs. error detection
•  What is the impact of channel error?
ARQ Mechanism
•  Not appropriate for wireless applications
–  bit error rate is high causing lots of retransmissions
–  when propagation delay long (satellite) compared with frame
transmission time, resulting in retransmission of frame in error
plus many subsequent frames
Block and Convolutional Error Codes
•  The two types of FEC techniques satisfy separate needs:
•  Block Error Codes
–  It divides the data to be sent into a set of blocks
–  It attaches extra information known as redundancy to each block
–  The encoding for a given block of bits depends only on the bits
themselves, not on bits that were sent earlier
–  They are memoryless in the sense that the encoding mechanism
does not carry state information from one block of data to the next
•  Convolutional Error Codes
–  It treats data as a series of bits, and computes a code over a
continuous series
–  Thus, the code computed for a set of bits depends on the current
input and some of the previous bits in the stream
–  Convolutional codes are said to be codes with memory

9
Error Correction Motivation
•  Errors can be detected and corrected
–  Error correction is more complex
•  Correction of detected errors usually requires data
block to be retransmitted
•  Instead need to correct errors on basis of bits received
Error Correction Basic Idea
•  Adds redundancy to transmitted message
•  Can deduce original despite some errors
–  Errors are detected using error-detecting code
–  Error-detecting code added by transmitter
–  Error-detecting code are recalculated and checked by receiver

–  map k bit input onto an n bit codeword


–  each distinctly different
–  When error occurs the receiver tries to guess which codeword
sent was (e.g., teh à the)
Error Detection

Error Correction with


Row and Column
(RAC) Parity
Redundancy Check
1- Vertical Redundancy Check (VRC)
- Parity Check
2- Longitudinal Redundancy Check (LRC)
3- Cyclic Redundancy Check
Error Detection – Parity Check

•  Basic idea
–  Errors are detected using error-detecting code
–  Error-detecting code added by transmitter
–  error-detecting code are recalculated and checked by receiver
•  Parity bit
–  Odd (odd parity)
•  If it had an even number of ones, the parity bit is set to a one, otherwise
it is set to a zero
•  (P=0 if odd ones)à always odd number of ones in the frame
•  Asynchronous applications and Standard in PC memory
–  Even (even parity)
•  Synchronous applications
F(1110001)à
odd parity 1 111 000 1
Parity Bit + Data Block
Error Detection – Parity Check
An Example Block Error Code:
Single Parity Checking

If even number of 1s à Even parity =0

15
Error Detection Basic Mechanism

•  for block of k bits transmitter


•  Represented by (n,k) encoding scheme
–  k dataword length
–  n codeword
–  r added bits

Example: 8-bit data + single parity


What is the minimum number of bità 2^9 (512) possibilities / only 2^8
bits we should add? (255=256-1) valid code words
(excluding all-zero)
Redundancy Check
•  Longitudinal Redundancy Check (LRC)
–  Organize data into a table and create a parity for each column

11100111 11011101 00111001 10101001

11100111
11011101
00111001
10101001
10101010

11100111 11011101 00111001 10101001 10101010


Original Data LRC
Hamming Distance:
A Measure of a Code's Strength
•  No channel coding scheme is ideal!
–  changing enough bits will always transform to a valid codeword
•  What is the minimum number of bits of a valid codeword that
must be changed to produce another valid codeword?
–  To answer the question, engineers use a measure known as the
Hamming distance
–  Given two strings of n bits each, the Hamming distance is defined as
the number of differences

18
Hamming Distance:
A Measure of a Code's Strength
•  Hardware implementation
–  One way to compute the Hamming distance consists of taking the
exclusive or (xor) between two strings
–  Then, counting the number of 1 bits in the answer
•  For example, consider the Hamming distance between
strings 110 and 011
–  The xor of the two strings is:

which contains two 1s


–  Therefore, the Hamming distance between 011 and 101 is 2

19
The Tradeoff Between Error Detection
and Overhead
•  A large value of dmin is desirable
–  because the code is immune to more bit errors, if fewer than dmin bits
are changed, the code can detect that error(s) occurred
•  The maximum number of bit errors that can be detected:

•  A code with a higher value of dmin sends more redundant


information than an error code with a lower value of dmin
•  Code rate that gives the ratio of a dataword size to the
codeword size

20
Error Detection and Correction

•  Relation between Hamming •  To guarantee the detection of


Distance and Error up to e errors in all cases, the
–  When a codeword is corrupted minimum Hamming distance
during transmission, the in a block code must be
Hamming distance between the dmin = e + 1 à e= dmin -1
sent and received codewords is
the number of bits affected by the •  To guarantee the maximum t
error correctable errors in all cases

–  Ex : if the codeword 00000 is sent ⎢ d − 1⎥


t = ⎢ min ⎥
and 01101 is received, 3 bits are ⎣ 2 ⎦
in error and the Hamming
distance between the two is d
(00000, 01101) = 3
Cyclic Redundancy Codes (CRC)
•  Term cyclic is derived from a property of the codewords:
–  A circular shift of the bits of any codeword produces another one
•  A (n=7, k=4) CRC by Hamming

22
transmits n bits which is exactly divisible by
CRC generator and checker some number (predetermined divisor)
receiver divides frame by that number

n-k bit
k + (n-k) bits
predetermined n-k+1 bit
divisor

n-k bit

Refer to your notes for examples!


Cyclic Redundancy Codes (CRC)

CRC is the remainder!

24
CRC generator and checker

•  Example : Division in CRC Encoder

predetermined divisor
CRC generator and checker

•  At the Receiver:
–  Example : Division in CRC Decoder

Known
divisor
Another CRC Example

Message: 1010001101
Pattern (divisor): 110101

Transmit: 1010001101 + 01110

Step through to calculate the


remainder!
http://www.macs.hw.ac.uk/~pjbk/nets/crc/
Cyclic Redundancy Codes (CRC)
Mathematical Representation

•  Let M(x) be the message polynomial


•  Let P(x) be the generator polynomial (divisor)
–  P(x) is fixed for a given CRC scheme
–  P(x) is known both by sender and receiver
•  Create a block polynomial F(x) based on M(x) and P(x)
such that F(x) is divisible by P(x)

F ( x) 0
= Q( x) +
P( x) P( x)
Example of CRC
•  Send •  Receive
–  M(x) = 110011 à x5+x4+x+1 (6 bits)
–  P(x) = 11001 à x4+x3+1 (5 bits, n = 4) 11001 1100111001
à 4 bits of redundancy
11001
–  Form xnM(x) à 110011 0000
à x9+x8+x5+x4 11001
–  Divide xnM(x) by P(x) to find C(x)
11001
100001 00000
11001 1100110000
11001 No remainder
10000 à Accept
11001
1001 à C(x)
F ( x) 0
Send the block 110011 1001 = Q( x) +
P( x) P( x)
CRC Example
Message: 1010001101
Pattern (divisor): 110101
Transmit: 1010001101 + 01110
1010001101 + 01110
1010001101

n-k bit
k + (n-k) bits

110101 110101 n-k+1 bit

1010001101 + 01110
n-k bit
00000
01110
Block Code –
Error Detection and Correction
Table1
•  Hamming Distance
–  The Hamming distance between two words is the number of differences
between corresponding bits.
–  Easily found by applying the XOR operation on the two words and count the
number of 1s in the result.
–  Ex : Hamming distance d (000,011) = 2
–  Ex : Hamming distance d (10101, 11110) = 3

•  Minimum Hamming Distance


–  The minimum Hamming distance is the smallest Hamming distance between
all possible pairs in a set of words
–  Ex : Find the minimum Hamming distance of the coding scheme in table 1

Sol: = 2
Block Code –
Error Detection and Correction

•  Minimum Hamming Distance Table2

–  Ex : Find the minimum Hamming distance of the coding scheme in


the table.

–  3 parameters to define the coding scheme


•  Codeword size n
•  Dataword size k
•  The minimum Hamming distance dmin
•  We can call this (Table 2) coding scheme C(5,2) with dmin =3
•  Note : the coding scheme for (Table 1) is C(3,2) with dmin =2
Error Detection
and Correction
•  Example: Give the above coding scheme we experience 1000 bit
errors when transmitting 1Gigbit bits
–  Calculate the bit error rate.
–  Calculate the code rate.

–  What is the coding scheme: C(n,k),What is dmin?


–  How many errors can be detected using the given encoding technique?
–  How many errors can be corrected using the given encoding technique?
–  Assume the received codeword is 00101. What will be the likely original
dataword?
Error Detection
and Correction
•  Example: Give the above coding scheme we experience 1000 bit
errors when transmitting 1Gigbit bits BER: 10^-6
–  Calculate the bit error rate.
–  Calculate the code rate. Code rate = k/n = 2/5

–  What is the coding scheme: C(n,k),What is dmin? C(5,2) with dmin =3


–  How many errors can be detected using the given encoding technique?
–  How many errors can be corrected using the given encoding technique?
–  Assume the received codeword is 00101. What will be the likely original
dataword?
e = dmin -1=3-1=2

t= 1
⎢ d − 1⎥
t = ⎢ min ⎥
⎣ 2 ⎦
Error Detection and Correction
•  The larger the dmin the better
•  The code should be relatively easy to encode/decode
•  We like n-k to be small à reduce bandwidth
•  We like n-k to be large à reduce error rate
•  Assume n=4, k=2 à Code System
rate ½ Performance
•  Given BER, coding can
improve Eb/No
–  Lower Eb/No is required
–  Code gain is the reduction in
dB in Eb/No for a given BER
•  E.g., for BER=10^-6 à
code gain is 2.77 dB
•  Energy per coded bit (Eb) =
½ data bit (Eb)
–  Hence, BER will be 3dB less Channel bit error rate
–  This is because Ebit=2xEdata
•  For very high BER, adding 10^-6
coding requires higher Eb
–  Not due to overhead
Error Correction with Row and Column
(RAC) Parity
•  Imagine an array of 3-rows and 4-columns, with a parity bit
added for each row and for each column
–  this arrangement is known as a Row and Column (RAC) code
•  Example RAC has n= 20, which means that it is a (20, 12) code
•  Total of 20 bits; 12 data bits

Even Parity (P=0 if even 1s)

In cases where two or three bits are changed


an RAC encoding will be able to detect an odd number of errors

37
Error Correction with Row and Column
(RAC) Parity
•  How error correction works? Assume that one of the bits in
the figure below is changed during transmission:
–  When the receiver arranges the bits into an array and parity bits are
recalculated
•  two of the calculations will disagree with the parity bits received
•  a single bit error will cause two calculated parity bits to disagree with the
parity bit received

RAC can only correct single-bit errors


38

You might also like