Wireless Communication Network Lab. Chapter 4 Channel Coding and Error Control Chih-Cheng Tseng1EE...
-
Upload
brittany-shaw -
Category
Documents
-
view
226 -
download
1
Transcript of Wireless Communication Network Lab. Chapter 4 Channel Coding and Error Control Chih-Cheng Tseng1EE...
Wireless Communication Network Lab.
Chapter 4Channel Coding and Error Control
Chih-Cheng Tseng 1EE of NIU
Prof. Chih-Cheng Tseng
http://wcnlab.niu.edu.tw
Wireless Communication Network Lab.
Antenna
Transmitter
Receiver
Antenna
Air
Information to be transmitted Source
codingChannel coding Modulation
Source decoding
Channel decoding Demodulation
Information received
Chih-Cheng Tseng 2EE of NIU
Channel Coding in A Wireless Communication Systems
Wireless Communication Network Lab.
Forward Error Corrections (FEC)(正向糾錯 )
3
The key idea of FEC is to transmit enough redundant data to allow receiver to recover from errors all by itself.
No sender retransmission required. The major categories of FEC codes are
• Linear block codes
• Cyclic codes
• CRC codes
• Convolutional codes
• Turbo codes, etc.
EE of NIU Chih-Cheng Tseng
Wireless Communication Network Lab.
Linear Block Codes (1) (線性區塊碼 )
A linear code is an error-correcting code for which any linear combination of codewords is another codeword of the code.
(n,k) linear block codes• k information bits are encoded to an n bits codeword.
• Among 2n different combinations, only 2k combinations are valid codewords.
Let the uncoded k information bits be represented by the vector m = (m1,m2,…,mk).
Let the corresponding codeword be represented by the n-bit vector c = (c1,c2,…,ck,ck+1,…,cn-1,cn).
Chih-Cheng Tseng 4EE of NIU
Wireless Communication Network Lab.
Linear Block Codes (2)
Each parity bit consists of a weighted modulo 2 sum of the data bits represented by symbol.⊕
Example:
where pij (i=1,…k;j=k+1,…,n) is the binary weight of the particular data bit.
1 1
1 1 1( 1) 2 2( 1) ( 1)
1 1 2 2
...
...
...
...
k k
k k k k k k
n n n k kn
c m
c m
c m p m p m p
c m p m p m p
Chih-Cheng Tseng 5EE of NIU
Wireless Communication Network Lab.
EE of NIU Chih-Cheng Tseng 6
Generator matrix G
Code Vector c
Message vector m
Transmitter
Parity check matrix HTCode
Vector cNull
vector 0
Receiver
Air
Operations of The Generator Matrix and The Parity Check Matrix
Wireless Communication Network Lab.
Generator Matrix (生成矩陣 )
The generator matrix G (kn matrix) is made up by concatenating the identity matrix Ik (kk matrix) and the parity matrix P (k(n-k) matrix)
1( )11 12
2( )21 22
( )1 2
1 0 0 ... 0
0 1 0 ... 0[ | ]
...... ...... ... ... ... ...
0 0 0 ... 1
n k
n k
k k n
k n kk k
pp p
pp p
pp p
G I P
Chih-Cheng Tseng 7EE of NIU
Wireless Communication Network Lab.
Representing The Code Vector c
Representing the code vector c as a matrix operation on the uncoded message vector m
For convenience, the code vector is expressed as
• cp=mP is an (n-k)-bit parity check vector
c mG
| p c m c
Chih-Cheng Tseng 8EE of NIU
Wireless Communication Network Lab.
The parity matrix P (k(n-k) matrix) is given by
• pi=rem [xn-k+i-1/g(x)] is the remainder of [xn-k+i-1/g(x)] for i=1, 2, .., k
• g(x) is the generator polynomial (生成多項式 ). All arithmetic is performed using modulo 2
operation.
Parity Matrix (同位矩陣 )
EE of NIU Chih-Cheng Tseng 9
111 12 1( )
221 22 2( )
1 2 ( )
n k
n k
kk k k n k
p p p
p p p
p p p
p
pP
p
Wireless Communication Network Lab.
Modulo 2 Arithmetic
Exclusive-OR operation• Binary addition with no carries
• Binary subtraction with no borrows
EE of NIU Chih-Cheng Tseng 10
Wireless Communication Network Lab. For a (7,4) code, find the generator matrix G if code
generator polynomial g(x)=1+x+x3.• n=7, k=4, n-k=3
• The generator matrix is
Linear Block Codes: Example
EE of NIU Chih-Cheng Tseng 11
1000110
0100011
0010111
0001101
G
3 51 3 2
3 3
4 62 2 4 2
3 3
rem 1 [110] rem 1 [111]1 1
rem [011] rem 1 [101]1 1
x xx x x
x x x x
x xx x x
x x x x
p p
p p
Wireless Communication Network Lab.
Parity Check Matrix (同位檢查矩陣 )
Define a matrix HT as
Parity check matrix H(n-k)×n
• In-k is a (n-k)×(n-k) unit matrix
• PT is the transpose matrix of the parity matrix P
EE of NIU Chih-Cheng Tseng 12
T
n k
PH
I
Tn k H P I
Wireless Communication Network Lab.
Syndrome (症狀 ) s
Syndrome: s=xHT
• x=ce is the received vector, e is the error vector.
• dimension of s is (n-k).
• s=0: the received vector x is correct.
• s0: the received vector x is incorrect and the value of s is the location of the error bit.
EE of NIU Chih-Cheng Tseng 13
( )T T T T T s xH c e H cH eH eH
Tp
n k
p p p
PcH m c
I
mP c c c 0
Wireless Communication Network Lab.
Example
For the (7,4) linear block code, given by G as
For m=[1011] and c=mG=[1011|001], if there is no error, the received vector x=c, and s=cHT=[000]
10001111110100
0100110 1101010
00101011011001
0001011
G H
Chih-Cheng Tseng 14EE of NIU
Wireless Communication Network Lab.
Example
Let c suffer an error such that the received vector x=ce=[ 1 0 1 1 0 0 1 ][ 0 0 1 0 0 0 0 ] =[ 1 0 0 1 0 0 1 ] The syndrome
This indicates error position, giving the corrected vector as [1011001]
EE of NIU Chih-Cheng Tseng 15
111
110
101
1001001 011 [101]
100
010
001
T T
s xH eH
Wireless Communication Network Lab.
Cyclic Codes (1) (循環碼 )
Cyclic codes are relatively easy to encode and decode than most other types of codes.
Most of block codes used in the FEC system are cyclic codes.
It is a block code which uses a shift register to perform encoding and decoding.
Chih-Cheng Tseng 16EE of NIU
Wireless Communication Network Lab.
Cyclic Codes (2)
The codeword with n bits is expressed as
• each coefficient ci (i = 1, 2, …, n) is either a 1 or 0.
The codeword can be expressed by the data polynomial m(x) and the check polynomial cp(x) as
EE of NIU Chih-Cheng Tseng 17
1 21 2( ) n n
nc x c x c x c
( ) ( ) ( )n kpc x m x x c x
Wireless Communication Network Lab.
Cyclic Codes (3)
The check polynomial cp(x) is the remainder from dividing m(x)xn-k by the generator polynomial g(x)
Denoting the error polynomial by e(x), the received signal polynomial or syndrome s(x) is
If there is no error, we have s(x) = 0。
EE of NIU Chih-Cheng Tseng 18
( )( ) rem
( )
n k
p
m x xc x
g x
( ) ( )( ) rem
( )
c x e xs x
g x
Wireless Communication Network Lab.
Example: A (7,4) Cyclic Code
EE of NIU Chih-Cheng Tseng 19
3 4 5( ) ( ) ( )n kpc x m x x c x x x x x
Find the codewords c(x) if m(x)=1+x+x2 and g(x)=1+x+x3
The check polynomial is
Then, the codewords can be found as
5 4 3
3( ) rem
1p
x x xc x x
x x
Wireless Communication Network Lab.
EE of NIU Chih-Cheng Tseng 20
Error Detection
error is inevitable detect using error-detecting code added by transmitter recalculated and checked by receiver still chance of undetected error parity
• parity bit set so character has even (even parity) or odd (odd parity) number of ones
• even number of bit errors goes undetected
Wireless Communication Network Lab.
Cyclic Redundancy Check
one of the most common and powerful checks for block of k bits, transmitter generates an n
bit frame check sequence (FCS) transmits (k+n) bits which are exactly divisible
by some number receiver divides frame by that number
• if no remainder, assume no error
EE of NIU Chih-Cheng Tseng 21
Wireless Communication Network Lab.
Commonly used CRC Polynomial
EE of NIU Chih-Cheng Tseng 22
Code-Parity check bits Generator polynomial g(x)
CRC-12 x12 +x11+x3+x2+x+1
CRC-16 x16 +x15+x2+1
CRC-CCITT x16 +x12+x5+1
CRC-32 x32 +x26+x23+x22+x16 +x12+x11+x10+x8+x7+x5+x4+x2+x+1
Wireless Communication Network Lab.
EE of NIU Chih-Cheng Tseng 23
CRC---Example
101000110100000
1101010110
110101
110101111011110101
111110110101
101100110101
110010110101
111010110101
01110
101000110101110
1101010110
110101
110101111011110101
111110110101
101111110101
110101110101
111010110101
00000
k bits message (M)
FCS (R) OK!!
T=M+R(n+1) bits
n bits
Wireless Communication Network Lab.
Convolutional Code (1)
Most widely used channel code in practical communication systems for real-time error correction, e.g. GSM and IS-95.
The encoded bits depend not only on the current input bits but also on past input bits.• Encoding of information stream rather than information
blocks. Decoding is based on the well-known Viterbi
Algorithm.
Chih-Cheng Tseng 24EE of NIU
Wireless Communication Network Lab.
Convolutional Codes (2)
The constraint length relates the number of bits on which the output depends and is defined as K=M+1• M is the maximum number of stages (memory size) in
any shift register The code rate r is defined as
r = k / n• k is the number of parallel information bits
• n is the number of parallel output encoded bits at one time interval
Chih-Cheng Tseng 25EE of NIU
Wireless Communication Network Lab.
Convolutional Codes: (n=2, k=1, M=2) Encoder
Input Output
Input x: 1 1 1 0 0 0 …
Output y1,y2: 11 01 10 01 11 00 …
Input x: 1 0 1 0 0 0 … Output y1,y2: 11 10 00 10 11 00 …
D1, D2 - Registers
x
y1
y2
c0 011
1 0
0
1 0
1 0
1
1
D1 D2
y1
y2
Chih-Cheng Tseng 26EE of NIU
Wireless Communication Network Lab.
State Diagram
Chih-Cheng Tseng 27EE of NIU
01/001/1
11/1 11/0
11
10/1
00/0
00
10 0110/0
00/1
Wireless Communication Network Lab.
Tree Diagram
Chih-Cheng Tseng 28EE of NIU
00
11
00
10
01
11
11
00
10
01
10
01
00
11
11
10
01
00
11
0001
01
10
10
11
00
01
10
01
10
11
1
0
… 1 1 0 0 1
… 10 11 11 01 11
First inputFirst output
01
Wireless Communication Network Lab.
Trellis Diagram
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
… 11001
…
10 10 10
01 01 0101 01 01
11 11 1111
11
10 10 10
00 00 00
Chih-Cheng Tseng 29EE of NIU
Wireless Communication Network Lab.
Interleaver
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
Rea
dInterleaving
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
Wri
te
De-Interleaving
a1, a2, a3, a4, a5, a6, a7, a8, a9, …Output Data
a1, a5, a9, a13, a2, a6, a10, a14, a3, …Received Data
Through Air
Interleaver tries to prevent burst errors.
Chih-Cheng Tseng 30EE of NIU
Wireless Communication Network Lab.
Example: Occurring 4 Burst Bit Errors
Pros• Disperse the burst
errors into multiple individual errors.
Cons• Additional delay is
required as the sequence needs to be processed block by block.
Notice• Interleaving does not
have error-correcting capability.
EE of NIU Chih-Cheng Tseng 31
0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,…Transmitting Data
0, 1, 0, 0 0, 1, 0, 0 0, 1, 0,
0 1, 0, 0, 0
Read
Wri
teDe-Interleaving
Burst error
0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, …Output Data
Discrete errors
Wireless Communication Network Lab.
Information Capacity Theorem(Shannon Limit)
The information capacity (or channel capacity) C of a continuous channel with bandwidth B Hz can be perturbed by additive white Gaussian noise (AWGN) of power spectral density N0/2, provided bandwidth B satisfies
• P is the average transmitted power P = EbRb (for an ideal system, Rb = C)• Eb is the transmitted energy per bit• Rb is transmission rate (bps)
As long as the transmission rate is less than the channel capacity, there exists a coding scheme that makes the BER approaches to zero.
20
log 1 bps (for AWGN channel)P
C BN B
Chih-Cheng Tseng 32EE of NIU
Wireless Communication Network Lab.
Shannon Limit As the bandwidth B goes infinity, the least SNR to achieve the channel
capacity is -1.6 dB
EE of NIU Chih-Cheng Tseng 33
0 10 20 30Eb/N0 dB
Region for which Rb<C
Region for which Rb>C
Rb/B
-1.6
Shannon Limit
Capacity boundary Rb=C
1
10
20
0.1
For details about the channel capacity and Shannon limit, a good reference can be downloaded at:1. http://www.cteccb.org.tw/pdf/IECQ-49-4.pdf2. http://www.cteccb.org.tw/pdf/IECQ-50-6.pdf
Wireless Communication Network Lab.
Turbo Codes
The turbo code concept was first introduced by C. Berrou in 1993.
Turbo codes are considered as the most efficient coding schemes for FEC.
Scheme with known components (simple convolutional or block codes, interleaver, soft-decision decoder, etc.)
Performance close to the Shannon Limit (Eb/N0 = -1.6 dB if Rb0 or B) than any other codes so far at modest complexity!
EE of NIU Chih-Cheng Tseng 34
Wireless Communication Network Lab.
Turbo Code Encoder
The fundamental turbo code encoder is built using two identical recursive systematic convolutional (RSC) codes with parallel concatenation.
The interleaver makes the input of the encoders uncorrelated.
Chih-Cheng Tseng 35EE of NIU
Convolutional Encoder 1 (RSC 1)
Interleaving
Convolutional Encoder 2 (RSC 2)
Data Source
xx
y
y1
y2
(y1, y2)
Wireless Communication Network Lab.
Turbo Code Decoder
The output of the 2nd RSC decoder is feedbacked to the 1st RSC decoder TURBO
EE of NIU Chih-Cheng Tseng 36
Convolutional Decoder 1
Convolutional Decoder 2
Interleaving
Interleaver
De-interleaving
De-interleavingx
y1
y2
x’x’: Decoded information
Wireless Communication Network Lab.
Automatic Repeat reQuest (ARQ)
ARQ is one of the error-handling mechanisms in data communication.
Three kinds of ARQ schemes• Stop-And-Wait ARQ (SAW ARQ)
• Go-Back-N ARQ (GBN ARQ)
• Selective-Repeat ARQ (SR ARQ)
Chih-Cheng Tseng 37EE of NIU
Wireless Communication Network Lab.
Concept of ARQ
Chih-Cheng Tseng 38EE of NIU
Source Transmitter Channel Receiver
EncoderTransmit Controller Modulation
Destination
Demodulation Decoder Transmit Controller
Acknowledge
Wireless Communication Network Lab.
Stop-And-Wait ARQ (SAW ARQ)
Chih-Cheng Tseng 39EE of NIU
Transmitting Data
1 32 3Time
Received Data
1 2 3Time
AC
K
AC
K
NA
K
Output Data1 2 3
Time
Error
Retransmission
ACK: Acknowledge NAK: Negative ACK
Wireless Communication Network Lab.
Average Tx Time of The SAW ARQ
The average Tx time in terms of a block duration
TSAW = (1+DRb/n)PACK+2(1+DRb/n)PACK(1-PACK)
+3(1+DRb/n)PACK(1-PACK)2+…
= (1+DRb/n)PACK i(1-PACK)i-1
= (1+DRb/n)PACK/[1-(1-PACK)]2 = (1+DRb/n)/PACK
EE of NIU Chih-Cheng Tseng 40
1i
• n is the number of bits in a block
• D is the round trip delay
• Rb is the bit rate
• Pb is the BER of the channel
• PACK(1-Pb)n
Wireless Communication Network Lab.
Throughput of The SAW ARQ
Throughput
SSAW = (1/TSAW)(k/n)
= [(1-Pb)n/(1+DRb/n)] (k/n)
EE of NIU Chih-Cheng Tseng 41
• n is the number of bits in a block
• k is the number of information bits in a block
• Rb is the bit rate
• Pb is the BER of the channel
• D is the round trip delay
Wireless Communication Network Lab.
Go-Back-N ARQ (GBN ARQ)
A special case of the sliding window protocol with the transmit window size of N and receive window size of 1.
EE of NIU Chih-Cheng Tseng 42
Transmitting Data
1Time
Received Data
NA
K
Output Data Time
Error
Go-back 3
2 3 4 5 3 44 5 6 7 5
1Time
2 3 4 5
Error
NA
K
Go-back 5
1 2 3 4
Assume N=3
Wireless Communication Network Lab.
Average Tx Time of The GBN ARQ
The average Tx time in terms of a single block duration is given by
TGBN=1PACK+(N+1)PACK (1- PACK)+ (2N+1)PACK (1-PACK)2+
(3N+1)PACK (1-PACK)3+….
= PACK+PACK[(1-PACK)+(1-PACK)2 +(1-PACK)3+…]+
PACK[N(1-PACK)+2N(1-PACK)2 +3N(1-PACK)3+…]
= PACK+PACK[(1-PACK)/{1-(1-PACK )}+N(1-PACK)/{1-(1-PACK)}2]
= 1+N(1-PACK)/PACK
1+(N[1-(1-Pb)n ])/(1-Pb)n
EE of NIU Chih-Cheng Tseng 43
Wireless Communication Network Lab.
Throughput of The GBN ARQ
Throughput
SGBN=(1/TGBN)(k/n)
= [(1-Pb)n/((1-Pb)n+N(1-(1-Pb)n))](k/n)
EE of NIU Chih-Cheng Tseng 44
Wireless Communication Network Lab.
Selective Repeat ARQ
Chih-Cheng Tseng 45EE of NIU
Transmitting Data
1Time
Received Data
NA
K
Error
Retransmission
2 3 4 5 3 6 7 8 9 7
1Time
2 4 3 6 8 7Error
NA
K
Retransmission
5 9
Buffer 1Time
2 4 3 6 8 75 9
Output Data 1Time
2 4 3 6 8 75 9
Assume window size=5
A general case of the sliding window protocol with the transmit and receive window sizes are greater than 1.
Wireless Communication Network Lab.
Average Tx Time of The SR ARQ
The average Tx time in terms of a single block duration is given by
TSR=1PACK+2PACK(1-PACK)+3PACK (1-PACK)2+….
= PACK i(1-PACK)i-1
= PACK/[1-(1-PACK)]2
= 1/(1-Pb)n
where PACK(1-Pb)n
EE of NIU Chih-Cheng Tseng 46
1i
Wireless Communication Network Lab.
Throughput of The SR ARQ
Throughput
SSR = (1/TSR)(k/n)
= (1- Pb)n(k/n)
EE of NIU Chih-Cheng Tseng 47
Wireless Communication Network Lab.
Homework
P4.1 P4.4 P4.9 P4.10 P4.13
EE of NIU Chih-Cheng Tseng 48