24
1 Channel Coding Introduction : Channel coding is an error-control technique used for providing robust data transmission through imperfect channels by adding redundancy to the data. In information theory and coding theory with applications in computer science and telecommunication, error detection and correction or error control are techniques that enable reliable delivery of digital data over unreliable communication channels. Many communication channels are subject to channel noise, and thus errors may be introduced during transmission from the source to a receiver. Error detection techniques allow detecting such errors, while error correction enables reconstruction of the original data Error detection is the detection of errors caused by noise or other impairments during transmission from the transmitter to the receiver. Error correction is the detection of errors and reconstruction of the original, error- free data. Error detection and correction (EDC) EDC can be implemented in the following ways. Increase signal power Decrease signal noise Retransmission(ARQ) Forward Error Correction Digital signals use FEC : 1. Block Codes 2. Convolutional Codes The general idea for achieving error detection and correction is to add some redundancy (i.e., some extra data) to a message, which receivers can use to check consistency of the delivered message, and to recover data determined to be erroneous. Error correction may generally be realized in two different ways: Automatic repeat request (ARQ) (sometimes also referred to as backward error correction): This is an error control technique whereby an error detection scheme is combined with requests for retransmission of erroneous data. Every block of data received is checked using the error detection code used, and if the check fails, retransmission of the data is requested this may be done repeatedly, until the data can be verified.

Channel Codingsite.iugaza.edu.ps/abdos/files/CHANNEL-CODING.pdf · 2012. 5. 24. · Go-Back-N ARQ is a more efficient use of a connection than Stop-and-wait ARQ, since unlike waiting

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

  • 1

    Channel Coding

    Introduction :

    Channel coding is an error-control technique used for providing robust data transmission

    through imperfect channels by adding redundancy to the data.

    In information theory and coding theory with applications in computer science and

    telecommunication, error detection and correction or error control are techniques that

    enable reliable delivery of digital data over unreliable communication channels. Many

    communication channels are subject to channel noise, and thus errors may be introduced

    during transmission from the source to a receiver. Error detection techniques allow

    detecting such errors, while error correction enables reconstruction of the original data

    Error detection is the detection of errors caused by noise or other impairments during transmission from the transmitter to the receiver.

    Error correction is the detection of errors and reconstruction of the original, error-free data.

    Error detection and correction (EDC)

    EDC can be implemented in the following ways.

    Increase signal power

    Decrease signal noise

    Retransmission(ARQ)

    Forward Error Correction

    Digital signals use FEC :

    1. Block Codes

    2. Convolutional Codes

    The general idea for achieving error detection and correction is to add some redundancy

    (i.e., some extra data) to a message, which receivers can use to check consistency of the

    delivered message, and to recover data determined to be erroneous.

    Error correction may generally be realized in two different ways:

    Automatic repeat request (ARQ) (sometimes also referred to as backward error correction): This is an error control technique whereby an error detection scheme is combined with requests for retransmission of erroneous data. Every block of data received is checked using the error detection code used, and if the check fails, retransmission of the data is requested – this may be done repeatedly, until the data can be verified.

  • 2

    Forward error correction (FEC): The sender encodes the data using an error-correcting code (ECC) prior to transmission. The additional information (redundancy) added by the code is used by the receiver to recover the original data. In general, the reconstructed data is what is deemed the "most likely" original data.

    Automatic Repeat reQuest (ARQ), also known as Automatic Repeat Query, is an

    error-control method for data transmission that uses acknowledgements (messages

    sent by the receiver indicating that it has correctly received a data frame or packet)

    and timeouts (specified periods of time allowed to elapse before an acknowledgment

    is to be received) to achieve reliable data transmission over an unreliable service. If

    the sender does not receive an acknowledgment before the timeout, it usually re-

    transmits the frame/packet until the sender receives an acknowledgment or exceeds a

    predefined number of re-transmissions.

    The types of ARQ protocols include

    Stop-and-wait ARQ Go-Back-N ARQ Selective Repeat ARQ

    Stop-and-wait ARQ

    A stop-and-wait ARQ sender sends one frame at a time , After sending each frame, the

    sender doesn't send any further frames until it receives an acknowledgement (ACK) signal.

    After receiving a good frame, the receiver sends an ACK. If the ACK does not reach the

    sender before a certain time, known as the timeout, the sender sends the same frame again.

    Problem :

    1. It does not support correcting simple error ,that mean if a partial error exists it send

    NACK .

    2. ACK may be damaged or lost , the receiver has two copies of the same frame.

    3. Stop-and-wait ARQ is inefficient compared to other ARQs, because the time

    between packets, if the ACK and the data are received successfully, is twice the

    transit time (assuming the turnaround time can be zero). The throughput on the

    channel is a fraction of what it could be. To solve this problem, one can send more

  • 3

    than one packet at a time with a larger sequence number and use one ACK for a set.

    This is what is done in Go-Back-N ARQ and the Selective Repeat ARQ.

    Go-Back -N ARQ

    ARQ schemes use continuous transmission without waiting for ACK between frames. Upon detecting a frame in error, the receiver sends a NAK for that frame and discards that

    frame and all succeeding frames until that erroneous frame has been correctly received. Following reception of a NAK, the sender completes the transmission of the current frame and retransmits the erroneous frame and all subsequent ones.

    the sender can transmit sequences of frames numbered ,F0,F1,F2,…..F7 , As shown in the below figure since the receiver detects an error on frame F3 it returns NACK3 to the sender and discards both F3 and the succeeding frames F4, F5, and F6, which because of propagation delays have already been transmitted by the sender before it received the

    negative acknowledgment NAK3. Then, the sender retransmits F3 and the sequence of frames

    F 4, F5, and F6, and proceeds to transmit F7 (using the current sequencing) as well as frames

    F0,F1,, using the next sequencing.

  • 4

    Go-Back-N ARQ is a more efficient use of a connection than Stop-and-wait ARQ,

    since unlike waiting for an acknowledgement for each packet, the connection is still

    being utilized as packets are being sent. In other words, during the time that would

    otherwise be spent waiting, more packets are being sent. However, this method also

    results in sending frames multiple times – if any frame was lost or damaged, or the

    ACK acknowledging them was lost or damaged, then that frame and all following

    frames in the window (even if they were received without error) will be re-sent. To

    avoid this, Selective Repeat ARQ can be used

    Selective Repeat ARQ

    To overcome the inefficiency resulting from unnecessarily retransmitting the error-free

    frames, retransmission can be restricted to only those frames that have been detected in error.

    Repeated frames correspond to erroneous or damaged frames that are negatively

    acknowledged as well as frames for which the time-out has expired. Such a procedure is

    referred to as selective-repeat ARQ, which obviously should improve the performance over

    both stop-and-wait and go-back-N schemes.

    The sender transmits a sequence of framesF1,F2,F3, . As illustrated in Figure below, the

    receiver detects an error on the third frame F3 and thus returns a negative acknowledgment

    denoted NAK3 to the sender. However, due to the continuous nature of the protocol, the

    succeeding frames F4, F5, and F6 have already been sent and are in the pipeline by the time

    the sender receives NAK3. Upon receiving NAK3, the sender completes the transmission of

    the current frame (F6) and then retransmits F3 before sending the next frame F7 in the

    sequence. The correctly received but incomplete sequence F 4, F5, F6 must be buffered at the

    receiver, until F3 has been correctly received and inserted in its proper place to complete the

    sequence F3, F4, F5, F6, , which is then delivered. If F3 is correctly received at the first

    retransmission, the buffered sequence is F4, F5, and F6.

  • 5

    Linear Block Codes

    Basic Definitions:

    Block codes are referred to as (n, k) codes. A block of k information bits are coded to become a block of n bits.

    Notation: Notation: An (n, M, d ) - code C is a code such that n - is the length of codewords. M -is the number of codewords. d - is the minimum distance in C

    C1= {00, 01, 10, 11} is a (2,4,1)-code.

    C2= {000, 011, 101, 110} is a (3,4,2)-code

    C3= {00000, 01101, 10110, 11011} is a (5,4,3)-code.

    Linear code: The sum of any two code words is a codeword

    : is a bit-by-bit mod-2 addition without carry (XOR) A B A xor B

    0 0 0

    0 1 1

    1 0 1

    1 1 0

    We can add two binary numbers, X and Y as follows:

    (X) 10110100

    (Y) 00101010 +

    --------

    (Z) 10011110

    The weight of a codeword ci , denoted by w(ci), is the number of of nonzero

    elements in the codeword

    The Hamming distance is the number of disagreements between two binary

    sequences of the same size. It is a measure of how apart binary objects are.

    The Hamming distance between two codewords ci and cj, denoted by d(ci,cj)

    The Hamming distance between sequences 001 and 101 is = 1

    The Hamming distance between sequences 0011001 and 1010100 is = 4

    The minimum hamming distance of a linear block code is equal to the

    minimum hamming weight of the nonzero code vectors.

    The minimum weight of a code, wmin, is the smallest weight of the nonzero

    codewords in the code.

    Theorem: In any linear code, dmin = wmin

    Systematic codes :

    n-k

    check bits

    k

    information bits

    Any linear block code can be put in systematic form

  • 6

    Code rate: is the proportion of the data-stream that is useful (non-redundant).

    That is, if the code rate is k/n, for every k bits of useful information, the coder

    generates totally n bits of data, of which n-k are redundant k

    Rn

    Consider a code consisting of two codewords with Hamming distance dmin.

    How many errors can be detected? Corrected?

    # of errors that can be detected = td= dmin -1

    # of errors that can be corrected = tc = min

    1

    2

    d

    Parity Codes:

    Let us assume that the probability of transmission error is small. That is certainly true with

    our technology today. By small we mean that the probability of a single bit being wrong in a

    message is some small fraction of a percent (as small as possible).

    A parity bit is a bit that is added to ensure that the number of bits with the value one in a

    set of bits is even or odd. Parity bits are used as the simplest form of error detecting code.

    7 bits of data

    (count of 1 bits)

    8 bits including parity

    even odd

    0000000 (0) 00000000 (0) 10000000 (1)

    1010001 (3) 11010001 (4) 01010001 (3)

    1101001 (4) 01101001 (4) 11101001 (5)

    1111111 (7) 11111111 (8) 01111111 (7)

    Error detection

    We use one bit in a bit-string to signal the parity of that string. The sender calculates the

    parity and appends a parity bit to the data (e.g. 1 bit in every byte). The receiver then checks

    that the parity is consistent with the received message. If it is not consistent, then an error

    must have occurred. There are two problems with this :

  • 7

    We can only detect an odd number of errors.

    There could be an error in the parity bit itself

    Errors must be corrected by retransmission.

    The parity bit is only suitable for detecting errors; it cannot correct any errors, as there is no

    way to determine which particular bit is corrupted. The data must be discarded entirely, and

    re-transmitted from scratch.

    Two dimensional parity (Rectangular parity matrix):

    Can we adapt the idea of parity bits (which was cheaper) to not only detect but correct

    errors? Suppose we arrange the stream of bits we want to send in a two dimensional

    MxN array.

    N

    ---------------------

    | 1 1 0 1 .... 0 | 1

    | 0 0 0 1 .... 1 | 1

    M | ... | .

    | ... | .

    |________________|___

    | 1 1 0 0 .... 0 | 1

    We make the same assumption as before, namely that errors are rare, so that the

    chance of two errors occurring the same row or column is extremely low. In this

    scheme, we add a parity sum for each row and column. Now, if an error occurs, we

    detect a parity error in both a row and a column. This allows us to localize the bit

    which is in error, using far fewer bits. Since it is only a bit which is in error, we can

    simply flip the bit to correct the error.

    This suffers from the same problems as with ordinary parity, i.e. that we cannot detect

    even numbers of errors in a row or column. On the other hand it has a huge advantage

    in efficiency compared to the multiple redundancy approach.

    Bounds on M

    Upper Bounds on M and the Hamming Bound:

    The dmin for a particular block code specifies the code’s error correction and

    error detection capabilities as given Say we want to design a code of length n with minimum

    distance dmin Is there a limit (i.e., upperىbound) on the number of code words (i.e., messages

    M we can have? Or say we want to design a code of length N for messages of length k What

    is the maximum error protection (i.e., maximum dmin ) that we can achieve for a code with

    these parameters? Finally, say we want to design a code with messages of length k that is

    capable of t_-bit error correction. What is the smallest code word length n that we

    can use? The answer to these important design questions is given by the parameter

    defined below.

  • 8

    Hamming Bound :

    If the block code of length n is t-bit error correcting code ,then the number of code words,M

    ,must the satisfy the following inequality

    0

    2

    n

    t

    j

    Mn

    j

    Which is an upper bound (the Hamming bound )on the number of code words

    A code for which the previous equality is satisfied is called a perfect code.

    There are only three types of perfect codes (binary repetition codes, the

    hamming codes, and the Golay codes).

    Perfect does not mean “best”!

    — Gilbert bound places an lower bound on the number of code words

    min 1

    0

    2

    n

    d

    j

    Mn

    j

    — It only says there exist a code but it does not tell you how to find it.

    !

    !( )!

    n n

    j j n j

  • Doc11 (تم الإصلاح)CHANNEL CODING109101112131415161718192021222324