In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam -...

21
1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit message block and generates an n-bit code word. Thus, codewords are produced on a block-by-block basis. Buffering is needed. In some applications, message bits come in serially rather than in large blocks. Block code Encoder m 1 c 1 m 2 c 2 m 1 m 2 c 1 c 2 WY Tam - EIE POLYU Conv.2 Convolutional Codes A convolutional encoder generates redundant bits by using modulo-2 convolutions . In a convolutional code, the block of n code digits generated by the encoder in a time unit depends not only the block of k message digit with that time unit, but also the preceding N-1 block of message digits. Usually the values of k and n are small. (the redundant bits are generated by using modulo-2 convolutions.) Convolutional Encoder m 1 m 2 c 1 m 1 m 2 c 2 c 1 c 2

Transcript of In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam -...

Page 1: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

1

WY Tam - EIE POLYU Conv.1

Convolutional Codes

In block coding, the encoder accepts a k-bit message blockand generates an n-bit code word. Thus, codewords areproduced on a block-by-block basis.– Buffering is needed.

In some applications, message bits come in serially ratherthan in large blocks.

Block codeEncoder

m1c1m2

c2

m1m2 c1c2

WY Tam - EIE POLYU Conv.2

Convolutional Codes

A convolutional encoder generates redundant bits by usingmodulo-2 convolutions.

In a convolutional code, the block of n code digits generatedby the encoder in a time unit depends not only the block of kmessage digit with that time unit, but also the preceding N-1block of message digits. Usually the values of k and n aresmall. (the redundant bits are generated by using modulo-2convolutions.)

ConvolutionalEncoder

m1 m2c1

m1m2c2

c1≠c2

Page 2: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

2

WY Tam - EIE POLYU Conv.3

Code rate

For a convolutional encoder with n modulo-adder and MFlip-flop, an L-bit message produces

bits )( MLn +

Adder 1 Adder n

Output

Input Flip-flop 1 Flip-flop M

MLn

MLnLr

>>≈

+=

1)(

Q

WY Tam - EIE POLYU Conv.4

Constraint length

Constraint length K is the number of shifts over which asingle message can influence the encoder output

K = M + 1

Adder 1 Adder n

Output

Input Flip-flop 1 Flip-flop M

Page 3: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

3

WY Tam - EIE POLYU Conv.5

Example

For n=2, K=3An 1000 bit message sequence produces a coded outputsequence of 2(1000+2) bits. The code rate is

2/120001000

)21000(21000

=≈+

=r

Output

Input

WY Tam - EIE POLYU Conv.6

Example

A convolutional code with rate k/n can be implemented byusing k separate shift register and n adders

Example:

An L-bit message produces3(M/2+L/2) bits.

Therefore,

Output

Input

32

)2/2/2(3≈

+=

LLr

Page 4: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

4

WY Tam - EIE POLYU Conv.7

Impulse Response and Generator polynomial

Impulse response– response of a path to a symbol 1 applied to its inputExample: Impulse response of path 1 is (1,1,1)

Impulse response of path 2 is (1,0,1)

Output

Input

Path 1Path 2

WY Tam - EIE POLYU Conv.8

Impulse Response and Generator polynomial

The impulse response can be represented by a polynomialExample: (1,0,1,1) can be written as

Example: (1,1,1) can be written as g(1)(D)=1+D+D2

(1,0,1) can be written as g(2)(D)=1+D2

11101 3232 DDDDD ++=⋅+⋅+⋅+

Output

Input

Path 1Path 2

Page 5: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

5

WY Tam - EIE POLYU Conv.9

Impulse Response and Generator polynomial

For the message sequence (10011), we havem(D)=1+D3 +D4

As the convolution in the time domain is transformed intomultiplication in D-domain

The output of path 1 is c(1)(D)= g(1)(D) m(D)= (1+D+D2)(1+D3 +D4)

= 1+D+D2+D3 +D6

= 1111001

WY Tam - EIE POLYU Conv.10

Impulse Response and Generator polynomialThe output of path 2 isc(2)(D)= g(2)(D) m(D)= (1+D2)(1+D3 +D4)

= 1+D2+D3 +D4 +D5 +D6

= 1011111

Finally, multiplexing the two output sequence of path 1(1111001) and path 2 (1011111) gives

c = (11,10,11,11,01,01,11)

Note: for the shift register to be restored to its zero initialstate, a terminating sequence of K-1=2 zeros is appended tothe last input bit of the message. These zeros is called thetail of the message.

Page 6: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

6

WY Tam - EIE POLYU Conv.11

State diagram

A Convolutional encoder can be specified by the statediagram.Example: (n=2,k=1,M=2) convolutional encoderThe state of this encoder is the content of the 2-stage shiftregister.

State: S0: 00 S1: 10 S2: 01 S3: 11

Example: Suppose input is 1 and the original state is S1,the output would be 10 and the new state become S3

Output

Input

Path 1Path 2

1 1 0

10

WY Tam - EIE POLYU Conv.12

State diagramOriginal Input Output new State state 00 0 00 00

10 0 01 01 01 0 01 00 11 0 00 01 00 1 11 10

10 1 10 11 01 1 10 10 11 1 11 11

S0

S1S2

S3

S0

S1

S2

S3

Input=1Input=0

00

11

1000

01

11

10

01

State diagram

Page 7: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

7

WY Tam - EIE POLYU Conv.13

Trellis diagram

To show the time evolution of the coded sequence, a trellisdiagram is used.– Trellis diagram is obtained directly from the state

diagram by including, from left-to-right, the dimension oftime

S0 S0

S1

00

S0

S1S2

S3Input=1Input=0

11

1000

01

10

01

S0

S1

S2

S3

00 00

11 11

10

01

S0

S1

S2

S3

Input=101Output=110110

10

11

WY Tam - EIE POLYU Conv.14

Decoding

Since there is a one-to-one corresponding between m and c,

To reducing the probability of decoding error, themaximum-likelihood principle is used to decode thereceived sequence r into a code sequence c which maximizesthe likelihood function p(r|c) or log[p(r|c)].

ChannelEncoder

c r

noise

c'm m'

ccmm == ' ifonly and if '

known

Channel Decoder

Unknown

Page 8: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

8

WY Tam - EIE POLYU Conv.15

Maximum-likelihood Decoding

Assume that a codeword c=(c0,c1,…,cN)is transmitted through a binary symmetricchannel and the received sequence isr = (r0,r1,…,rN)

Maximum-likelihood decoding is obtained by choosing thenearest codeword to the received sequence in Hammingdistance which maximum the likelihood function.

1 1

0 0

pp

p−1

p−1

BAABcrpcrP

crpcrPN

iii

ii

N

i

loglog)log( )|(log)|(log

)|()|(

0

0

+==⇒

Π=

∑−

Q

WY Tam - EIE POLYU Conv.16

Maximum-likelihood Decoding

Assume d(r,c)=d, the likelihood functionbecomes

As Nlog(1-p) is a constant for all c and p<1/2 in practice, themaximum-likelihood decding rule becomechoose the estimate c’ that minimizes the Hammingdistance between the r and c

1 1

0 0

pp

p−1

p−1

)1log(1

log

)1log()(log

)|(log)|(log0

pNp

pd

pdNpd

crpcrPN

iii

−+

=

−−+=

= ∑−

11

log <

− pp

Page 9: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

9

WY Tam - EIE POLYU Conv.17

Viterbi algorithm

To decode the received sequence r, it is compared with eachpossible transmitted code vector c, and the particular oneclosest to r is chosen as the correct transmitted code vector.

Min{d(r,c)} for all possible c

Viterbi decoderThe Viterbi decoder chooses that path through the trellis ofthe code which has a minimum Hamming distance from thereceived sequence.

∑=i

ii crdcrd ),(),(

WY Tam - EIE POLYU Conv.18

Example

Suppose m=10111then c = (11,01,10,10,11,00,01)r = (11,01,11,10,11,00,01)

Time Received Trellis diagram ds m’word

0 11 S0 2 0S1 0 1

Output

Input

Path 1Path 2

0011

Initial state must be 00Two possible paths from S0

∑=

1

0),(

iii crd

Estimated message

Page 10: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

10

WY Tam - EIE POLYU Conv.19

Example r = (11,01,11,10,11,00,01)

Time Received Trellis diagram ds m’word

1 10 S0 3 00S1 3 01S2 0 10S3 2 11

2 11 S0 1 100S1 1 101S2 4 010S3 2 111

0011 11

00

00

S0

S1S2

S3

11

1000

01

10

01

11

01

10

0011 11

00

01

10

00 ds=501 ds=1

0111

WY Tam - EIE POLYU Conv.20

Example r = (11,01,11,10,11,00,01)

Finally, we haveS0

S1

S2

S3

c’=(10,01,10,10,11,00,01)m’ =(1011100)

11

01

00

S0

S1S2

S3

11

1000

01

10

01

11

10 10

11 00

00

1),(13

0=∑

=iii crd

Page 11: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

11

WY Tam - EIE POLYU Conv.21

Error Probability

PBlock

– probability of a transmitted codeword does notcorrespond to the decoded codeword

PBit

– probability of a transmitted information bit is incorrect

ChannelEncoder

Decoderc r

noise

c'

)'( ccPPBlock ≠=

m ErrorCorrection

m'

)'( mmPPBit ≠=

WY Tam - EIE POLYU Conv.22

Error Probability

Consider a Binary Symmetric Channel (BSC)

Probability of t errors occur during transmission of a binarycodeword consisting of n bits is

Example: n = 3, t = 1, the patterns for sending 111 are011, 101, 110.

1 1

0 0

pp

p−1

p−1

where )1()((n-t)!t!

n!tn

pptn

tp tnt =

= −

31)!-(31!

3!13

==

Page 12: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

12

WY Tam - EIE POLYU Conv.23

Error Probability

If , 2/)1( min −= de

=

+=

−=

=

e

j

jnj

n

ej

jnjBlock

ppjn

ppjn

P

0

1

)1(1

)1(

WY Tam - EIE POLYU Conv.24

Example

Repetition code of length n = 3.– a linear block code with k = 1 and n = 3.– Codewords are 000 and 111.

• dmin = 3• Correction capability:

If p = 0.01, PBlock= 0.000298. (PBit = Pblock)• 97% of error are corrected.• Error rate has been reduced by 34 times.

12/)1( min =−d

230

1

0

)1(3)1(1

)1(1

pppp

ppCPj

jnjjnBlock

−−−−=

−−= ∑=

Page 13: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

13

WY Tam - EIE POLYU Conv.25

Applications of Channel coding: LBC

Linear Block CodeHamming code have been used in error control of computermemories and long-distance telephony.

Example: In ECC memory, 64 bits data are stored in 72 bit physical memory.

Can correct 1 error bit and detect 2 error bits

WY Tam - EIE POLYU Conv.26

Applications of Channel coding: CRC16 bit CRC-ITU

CRC codes are used to perform error detection in almost allmodern communication systems.Example: detecting errors at the data-link layer and the

transport layer of the Open SystemsInterconnection (OSI) reference model

16 bit CRC-ITU was recommended by ITU (InternationalTelecommunication Union) for many applications.Example: Communication protocols: XYModem, Zmodem

Kermit file-transfer protocols (FTPs) X.25 for packet communication

Page 14: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

14

WY Tam - EIE POLYU Conv.27

In these applications, data-resending approach (ARQ -automatic repeat request) is the simplest way to correcttransmission errors.• Error detection only

Long CRCs are more effective than short ones atdetecting errors, but also introduce more overheadredundancy and implementation complexity.

Applications of Channel coding: CRC

WY Tam - EIE POLYU Conv.28

8 bit CRC-ATMATM (Asynchronous Transfer Mode) is a high-bandwidth,low-delay switching and multiplexing technology for bothpublic and private communication networks– Aimed at users of high-speed data, local-area network

interconnections, imaging and multimedia applications.

Five layers: service layer adaptation layer ATM layer convergence layer physical layer

Applications of Channel coding: CRC

Page 15: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

15

WY Tam - EIE POLYU Conv.29

Employed in the adaptation layer of the ATM(Asynchronous Transfer Mode) protocol

CRC-12Used when the character length is 6 bits

CRC-16Used for 8-bit characters

Applications of Channel coding: CRC

1)( 28 +++= XXXXg

1)( 231112 +++++= XXXXXXg

1)( 21516 +++= XXXXg

WY Tam - EIE POLYU Conv.30

CRC-32IBM Token-ringIBM PC NetworkCSMA/CD Ethernet LANs

Applications of Channel coding: CRC

1

)(

245

78101112

1622232632

+++++

+++++

++++=

XXXXXXXXXXXXXXXg

Page 16: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

16

WY Tam - EIE POLYU Conv.31

Application of Channel Coding: BCH codes

(511,493) BCH codeITU-T Recommendation H.261– Video codec for audiovisual services at p x 64 kbit/s– video coding standard used for video conferencing and

videophone

(40,32) BCH code– used in the ATM (Asynchronous Transfer Mode ) layer of

ATM

1)(

3678

10121518

+++++

+++=

XXXXXXXXXg

WY Tam - EIE POLYU Conv.32

RS (255,233)– recommended by Consultative Committee for Space Data

Systems (CCSDS) for communication channel codingstandard for spacecraft

– Examples• Mars Observer

launched in 1992 and arrived Mars in 1993• Pathfinder lander

launched in 1996 and arrived Mars in 1997• Cassini

launched in 1997 and to arrive Saturn in 2004

Application of Channel Coding: RS codes

Page 17: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

17

WY Tam - EIE POLYU Conv.33

Application of Channel Coding: RS codes

Compact Disc (CD)Source of errors– dust, fingerprints and scratches on the disc– surface roughness

The CD error-control system is designed to handle bursts bymeans of Interleaving and the RS codes (Cross InterleavedRS code)

RS1: RS (28,24) RS2: RS (32,28)Also used for the CD-ROM, CD-I, and the MiniDisc

RS1 RS2Interleaver1.41Mbps 1.88Mbps

WY Tam - EIE POLYU Conv.34

Application of Channel Coding: RS codes

Digital-Video-Disk (DVD)– Increased physical density implies that physical

imperfections affect proportionally more bits– DVD is a true multimedia disc

Therefore, a more powerful error-correction code is needed.

RS1: RS (208,192) RS2: RS (182,172)

Maximum correctable-burst length:CD: 500 bytes (2.4mm)DVD: 2200 bytes (4.6mm)

Page 18: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

18

WY Tam - EIE POLYU Conv.35

Application of Channel Coding: Convolutional codes

Global System for Mobile communications (GSM)Speech coding in GSM

Three classes of speech data bits: Class I - Class III

Bandpassfilter Microphone A/D Speech

Encoder0.3-3.4kHz

ChannelEncoder Modulator

fs=8kHz13 bits

104kbps13kbps 22.8kbps

WY Tam - EIE POLYU Conv.36

Application of Channel Coding: Convolutional codes

Step 1:Class I: block coded with a CRC code

Step 2:Class I and Class II: convolutional coded (r=1/2, K=5)

Class I Class II Class III

Class I Class II Class III

CRC bits (error detection)

Class III

260bits 200ms

456bits

Page 19: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

19

WY Tam - EIE POLYU Conv.37

Application of Channel Coding: Convolutional codes

Data Channel in the GSM systemFive different data channels in the GSM systemExample: 9.6 kbps data transmission

9.6 kbps

240 bits (=12 kbps)

Coding in the terminal equipment (base station)

4 0s to reset the encoder

488 bits

Convolutional code with r=1/2, K=5

WY Tam - EIE POLYU Conv.38

Application of Channel Coding: Convolutional codes

Singaling Channel in the GSM systemMost important data in the network

184 bits

184 bits 40 bits

Block code (Fire code) for detection and correction of burst error

Check bits4 0s to reset the encoder

456 bits

Convolutional code: r=1/2, K=5

Page 20: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

20

WY Tam - EIE POLYU Conv.39

Application of Channel Coding: Convolutional codes

CDMA cellular systems– CDMA: Code-division multiple access– users in the CDMA-based cellular system are

distinguished from each other by a code– IS-95 (standard proposed by North America)

PN code– spread the spectrum of a radio which shares access in a

system by the use of a particular high speed pseduo-random (PN) code.

WY Tam - EIE POLYU Conv.40

Application of Channel Coding: Convolutional codes

– If each radio has its own radio-specific PN code, then allradios, except the one it is desired to receive, look likenoise to all other receivers in the system.

BaseStation

Code 1 Desired receiver

noise

noisenoise

Page 21: In block coding, the encoder accepts a k n block-by …em/dc03pdf/Convolutional Codes.pdf1 WY Tam - EIE POLYU Conv.1 Convolutional Codes In block coding, the encoder accepts a k-bit

21

WY Tam - EIE POLYU Conv.41

Application of Channel Coding: Convolutional codes

Reverse Channel (mobile unit to base station)

Add 8 bitencoder tail 4.4kbps 4.8kbps

ConvolutionalEncoder

r=1/3, K=9

14.4kbpsSymbol

Repetition

Interleaver

28.8kbps

64-ary Modulator

PN chip: 1.2288 Mcps

28.8kbps

4.8kbps