wireless networks ch3
TRANSCRIPT
-
7/30/2019 Wireless Networks Ch3
1/37
Ali BAZZI
Chapter 3
Channel Coding
-
7/30/2019 Wireless Networks Ch3
2/37
2
Introduction Block Codes Cyclic Codes CRC (Cyclic Redundancy Check) Convolutional Codes Interleaving Information Capacity Theorem Turbo Codes ARQ (Automatic Repeat Request)
Stop-and-wait ARQ
Go-back-N ARQ Selective-repeat ARQ
-
7/30/2019 Wireless Networks Ch3
3/37
3
Information to
be transmitted Sourcecoding
Channel
codingModulation Transmitter
ChannelInformation
received Sourcedecoding
Channel
decodingDemodulation Receiver
Introduction
Channel
coding
Channel
decoding
-
7/30/2019 Wireless Networks Ch3
4/37
4
The key idea of FEC is to transmit enoughredundant data to allow receiver to recoverfrom errors all by itself. No senderretransmission required.
The major categories of FEC codes are Block codes, Cyclic codes, Reed-Solomon codes (Not covered here), Convolutional codes, and
Turbo codes, etc.
-
7/30/2019 Wireless Networks Ch3
5/37
5
Information is divided into blocks of length k rparity bits or check bits are added to each block
(total length n = k + r),.
Code rateR = k/n Decoder looks for codeword closest to receivedvector (code vector + error vector) Tradeoffs between
Efficiency Reliability Encoding/Decoding complexity
-
7/30/2019 Wireless Networks Ch3
6/37
6
The uncoded k data bits be represented by the m vector:m=(m1, m2, , mk)
The corresponding codeword be represented by the n-bit c
vector:
c=(c1, c
2, c
k, c
k+1, , c
n-1, c
n)
Each parity bit consists of weighted modulo 2 sum of the databits represented by symbol.
=
=
=
=
=
++++
knknnn
kkkkkk
kk
pmpmpmc
pmpmpmc
mc
mc
mc
...
...
...
...
2211
)1()1(22)1(111
22
11
-
7/30/2019 Wireless Networks Ch3
7/37
7
Linear Block CodeThe block length Cof the Linear Block Code is
C= m G
where m is the information codeword block length, Gis the
generator matrix.
G= [Ik|P]k n,
wherepi= Remainder of [xn-k+i-1/g(x)] fori=1, 2, .., k, and I
is unit matrix.
The parity check matrixH= [PT| In-k], where P
T is the transpose of the matrix p.
-
7/30/2019 Wireless Networks Ch3
8/37
8
Example : Find linear block code encoderG if code generatorpolynomialg(x)=1+x+x3 for a (7, 4) code.
We have n = Total number of bits = 7, k = Number of information bits = 4,
r = Number of parity bits = n - k = 3.
[ ] ,
100
010
001
|2
1
==
kp
p
p
PIG
where
kixg
xofmainderp
ikn
i ,,2,1,)(
Re1
=
=
+
-
7/30/2019 Wireless Networks Ch3
9/37
9
[ ]11011
Re3
3
1 +=
++
= xxx
xp
[ ]0111
Re2
3
4
2+=
++
= xxxx
xp
[ ]11111
Re2
3
5
3++=
++
= xxxx
xp
[ ]10111Re2
3
6
4 +=
++
= xxx
xp
=
0001101
0010111
0100011
1000110
G
-
7/30/2019 Wireless Networks Ch3
10/37
10
e HT = e HTe ) * HT =c HT
e be the received message where c is the correct code and e is the error
Block Codes: Linear Block Codes
Let x = c
Compute S = x * HT =( c
If S is 0 then message is correct else there are errors in it, from common known error
patterns the correct message can be decoded.
The parity check matrix H is used to detect errors in the received code by using the fact
that c * HT = 0 ( null vector)
Generator
matrix
G
Code
Vector
C
Message
vector
m
Paritycheck
matrix
HT
Code
Vector
C
Null
vector
0
Operations of the generator matrix and the parity check matrix
-
7/30/2019 Wireless Networks Ch3
11/37
11
Consider a (7,4) linear block code, given by G as
Then,
Form = [1 0 1 1] and c = mG = [1 0 1 1 0 0 1].
If there is no error, the received vectorx=c, and s=cHT=[0, 0,0]
=
0001011
0010101
0100110
1000111
G
=
1011001
1101010
1110100
H
-
7/30/2019 Wireless Networks Ch3
12/37
12
Let c suffer an error such that the received vectorx=c e
=[ 1 0 1 1 0 0 1 ] [ 0 0 1 0 0 0 0 ]
=[ 1 0 0 1 0 0 1 ].
Then,
s=xHT
=
=(eHT)
[ ] ]101[
001
010
100
011
101
110
111
1001001 =
-
7/30/2019 Wireless Networks Ch3
13/37
13
Cyclic Codes
It is a block code which uses a shift register to perform encoding anddecoding
The code word with n bits is expressed as
c(x)=c1xn-1
+c2xn-2+cn
where each ci is either a 1 or 0.
c(x) = m(x) xn-k+ cp(x)
where cp(x) = remainder from dividing m(x) xn-kby generator g(x)
if the received signal is c(x) + e(x) where e(x) is the error.
To check if received signal is error free, the remainder from dividing
c(x) + e(x) by g(x) is obtained(syndrome). If this is 0 then the receivedsignal is considered error free else error pattern is detected from
known error syndromes.
-
7/30/2019 Wireless Networks Ch3
14/37
14
Example : Find the codewords c(x) if m(x)=1+x+x2 and g(x)=1+x+x3
for (7,4) cyclic code.
We have n = Total number of bits = 7, k = Number of information bits = 4,
r = Number of parity bits = n - k = 3.
xxx
xxxrem
xgxxmremxc
kn
p
=
++
++
=
=
1
)()()(
3
345
Then,543
)()()( xxxxxcxxmxc pkn
+++=+=
-
7/30/2019 Wireless Networks Ch3
15/37
15
Cyclic redundancy Code (CRC) is an error-checking code. The transmitter appends an extra n-bit sequence to every
frame called Frame Check Sequence (FCS). The FCS holdsredundant information about the frame that helps the receivers
detect errors in the frame.
CRC is based on polynomial manipulation using moduloarithmetic. Blocks of input bit as coefficient-sets forpolynomials is called message polynomial. Polynomial withconstant coefficients is called the generator polynomial.
-
7/30/2019 Wireless Networks Ch3
16/37
16
Generator polynomial is divided into the messagepolynomial, giving quotient and remainder, the coefficientsof the remainder form the bits of final CRC.
Define:M The original frame (k bits) to be transmitted before
adding the
Frame Check Sequence (FCS).F The resulting FCS of n bits to be added to M (usually
n=8, 16, 32).
T The cascading of M and F.
P The predefined CRC generating polynomial with
pattern of n+1 bits.The main idea in CRC algorithm is that the FCS isgenerated so that the remainder of T/P is zero.
-
7/30/2019 Wireless Networks Ch3
17/37
17
The CRC creation process is defined as follows: Get the block of raw message Left shift the raw message by n bits and then divide it by
p
Get the remainder R as FCS Append the R to the raw message . The result is the
frame to be transmitted.
CRC is checked using the following process: Receive the frame Divide it by P Check the remainder. If the remainder is not zero, then
there is an error in the frame.
-
7/30/2019 Wireless Networks Ch3
18/37
18
Code Generator polynomial
g(x)
Parity check
bits
CRC-12 1+x+x
2
+x
3
+x
11
+x
12
12CRC-16 1+x2+x15+x16 16
CRC-CCITT 1+x5+x15+x16 16
-
7/30/2019 Wireless Networks Ch3
19/37
19
Encoding of information stream rather thaninformation blocks
Value of certain information symbol also affectsthe encoding of nextMinformation symbols,
i.e., memoryM Easy implementation using shift registerAssuming kinputs and n outputs
Decoding is mostly performed by the ViterbiAlgorithm (not covered here)
-
7/30/2019 Wireless Networks Ch3
20/37
20
Input Output
Input: 1 1 1 0 0 0
Output: 11 01 10 01 11 00
Input: 1 0 1 0 0 0
Output: 11 10 00 10 11 00
D1 D2
Di -- Register
x
y1
y2
c
-
7/30/2019 Wireless Networks Ch3
21/37
21
01/001/1
11/1 11/0
11
10/1
00/0
00
10 0110/0
00/1
-
7/30/2019 Wireless Networks Ch3
22/37
22
00
1100
10
0111
11
0010
01
1001
00
1111
10
01
00
11
0001
01
1010
11
00
01
10
01
10
11
00
1
0
1 1 0 0 1
10 11 11 01 11
First inputFirst output
-
7/30/2019 Wireless Networks Ch3
23/37
23
00 0000 0000 0000 0000 0000
10 10 10 10 10 10
01 01 01 01 01 01
11 11 11 11 11 11
11
10
11
11
01
11 0 0 1
10 10 10
01 01 0101 01 01
11 11 1111
11
10 10 10
00 00 00
-
7/30/2019 Wireless Networks Ch3
24/37
24
a1, a2, a3, a4, a5, a6, a7, a8, a9, Input Data
a1, a2, a3, a4
a5, a6, a7, a8
a9, a10, a11, a12
a13, a14, a15, a16
Write
ReadInterleaving
a1, a5, a9, a13, a2, a6, a10, a14, a3, Transmitting
Data
a1, a2, a3, a4
a5, a6, a7, a8
a9, a10, a11, a12
a13, a14, a15, a16
Read
W
riteDe-Interleaving
a1, a2, a3, a4, a5, a6, a7, a8, a9, Output Data
-
7/30/2019 Wireless Networks Ch3
25/37
25
0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,Transmitting
Data
0, 1, 0, 0
0, 1, 0, 00, 1, 0, 0
1, 0, 0, 0
Read
WriteDe-Interleaving
0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, Output Data
Burst error
Discrete error
-
7/30/2019 Wireless Networks Ch3
26/37
26
The information capacity (or channel capacity)Cof a continuous channel with bandwidthBHertz can be perturbed by additive Gaussianwhite noise of power spectral densityN0/2,provided bandwidthB satisfies
wherePis the average transmitted powerP =EbRb(for an ideal system,Rb = C).
Eb isthe transmitted energy per bit,Rb is transmission rate.
ondbitsBN
PBC sec/1log
0
2
+=
-
7/30/2019 Wireless Networks Ch3
27/37
27
0 10 20 30Eb/N0 dB
Region for whichRbC
Rb/B
-1.6
Shannon Limit
Capacity boundaryRb=C
1
10
20
0.1
-
7/30/2019 Wireless Networks Ch3
28/37
28
A brief historic of turbo codes :The turbo code concept was first introduced by C. Berrou in
1993. Today, Turbo Codes are considered as the mostefficient coding schemes for FEC.
Scheme with known components (simple convolutional orblock codes, interleaver, soft-decision decoder, etc.)
Performance close to the Shannon Limit (Eb/N0 = -1.6 db ifRb0) at modest complexity!
Turbo codes have been proposed for low-power applicationssuch as deep-space and satellite communications, as well as
for interference limited applications such as third generationcellular, personal communication services, ad hoc and sensornetworks.
-
7/30/2019 Wireless Networks Ch3
29/37
29
Convolutional Encoder
1
Interleaving
Convolutional Encoder
2
Data
Source
XX
Y
Y1
Y2(Y1, Y2)
X: Information
Yi: Redundancy Information
-
7/30/2019 Wireless Networks Ch3
30/37
30
Convolutional
Decoder 1
Convolutional
Decoder 2Interleaving
Interleaver
De-interleaving
De-interleavingX
Y1
Y2
X
X: Decoded Information
-
7/30/2019 Wireless Networks Ch3
31/37
31
Source Transmitter Channel Receiver Destination
Encoder
Transmit
Controller Modulation Demodulation Decoder
Transmit
Controller
Acknowledge
-
7/30/2019 Wireless Networks Ch3
32/37
32
Transmitting
Data
1 32 3Time
Received Data 1 2 3 Time
ACK
ACK
NAK
Output Data 1 2 3 Time
Error
Retransmission
ACK: Acknowledge
NAK: Negative ACK
-
7/30/2019 Wireless Networks Ch3
33/37
33
Stop-And-Wait ARQ (SAW ARQ)
Throughput:
S = (1/T) * (k/n) = [(1- Pb)n / (1 + D * Rb/ n) ] *
(k/n)
where T is the average transmission time in terms of a block duration
T = (1 + D * Rb/ n) * PACK+ 2 * (1 + D * Rb/ n) * PACK* (1- PACK)
+ 3 * (1 + D * Rb/ n) * PACK* (1- PACK)2 + ..
= (1+ D * Rb/n) * PACK i * (1-PACK)i-1
= (1+ D * Rb/n) * PACK/[1-(1-PACK)]2
= (1 + D * Rb/ n) / PACK
where n = number of bits in a block, k = number of information bits in a
block, D = round trip delay, Rb= bit rate, Pb = BER of the channel, and
PACK= (1- Pb)n
=1i
-
7/30/2019 Wireless Networks Ch3
34/37
34
Transmitting
Data
1Time
Received Data
Output DataTime
Error
Go-back 3
2 3 4 5 3 44 5 6 7 5
1 Time2 3 44 5Error
Go-back 5
1 2 3 44 5
-
7/30/2019 Wireless Networks Ch3
35/37
35
Throughput
S = (1/T) * (k/n)
= [(1- Pb)n / ((1- Pb)
n + N * (1-(1- Pb)n ) )]* (k/n)
whereT = 1 * PACK+ (N+1) * PACK* (1- PACK) +2 * (N+1) * PACK*
(1- PACK)2 + .
= PACK+PACK* [(1-PACK)+(1-PACK)2 +(1-PACK)
3+]+
PACK[N * (1-PACK)+2 * N * (1-PACK)2
+3 * N * (1-PACK)3
+]= PACK+PACK*[(1-PACK)/PACK + N * (1-PACK)/PACK
2
= 1 + (N * [1 - (1- Pb)n ])/ (1- Pb)
n
Go-Back-N ARQ (GBN ARQ)
-
7/30/2019 Wireless Networks Ch3
36/37
36
Transmitting
Data
1Time
Received Data
Error
Retransmission
2 3 4 5 3 6 7 8 9 7
1 Time2 4 3 6 8 7Error
Retransmission
5 9
Buffer 1Time
2 4 3 6 8 75 9
Output Data 1Time
2 43 6 875 9
-
7/30/2019 Wireless Networks Ch3
37/37
37
Selective-Repeat ARQ (SR ARQ)
Throughput
S = (1/T) * (k/n)
= (1- Pb)n * (k/n)
whereT = 1 * PACK+ 2 * PACK* (1- PACK) + 3 * PACK* (1- PACK)
2
+ .
= PACK i * (1-PACK)i-1
= PACK/[1-(1-PACK)]2
= 1/(1- Pb)n
=1i