Anda di halaman 1dari 44

Modul #11

TE3223
SISTEM KOMUNIKASI 2

CONVOLUTIONAL
CODE
Program Studi S1 Teknik Telekomunikasi
Departemen
p Teknik Elektro - Sekolah Tinggi
gg Teknologi
g Telkom
Bandung 2007
Convolutional codes

Pada channel coding menggunakan kode konvolusi :


Mengkodekan data stream ke dalam sebuah codeword.
Tidak memerlukan pengubahan data stream kedalam suatu
blok yang ukurannya tetap.

Perbedaan mendasar antara kode blok dan kode


konvolusi dalam mendesain dan mengevaluasi
g :
Block codes didasarkan pada teknik algebra / kombinasi
Convolutional codes didasarkan pada teknik konstruksi

Modul 11 - Siskom 2 - Convolutional Code 2


Convolutional codes - contd
Kode konvolusi di spesifikasikan dengan 3
parameter yaitu (n, k , K ) atau (k / n, K )
Rc = k / n adalah
d l h coding
di rate
t (l
(laju
j pengkodean),
k d )
menyatakan jumlah bit data per per coded bit.
Pada prakteknya dipilih kk=11

K menyatakan constraint length dari encoder


dimana encoder mempunyai K-1 elemen memori
(shift register)

Modul 11 - Siskom 2 - Convolutional Code 3


Block diagram of the DCS

Information Rate 1/n


Modulator
source C
Conv. encoder
d
m = (m1 , m2 ,..., mi ,...) U = G(m)
1442443
= (U1 , U 2 , U 3 ,..., U i ,...)

Ch
Input sequence
144424443

hannel
Codeword sequence

U i = u1i ,...,u ji ,...,u ni


144244 3
Branch word ( n coded bits))

Information Rate 1/n


Demodulator
sink Conv. decoder
= (m 1 , m 2 ,..., m i ,...)
m Z = ( Z1 , Z 2 , Z 3 ,..., Z i ,...))
14442444 3
received sequence

Zi = z1i ,...,z ji ,...,z ni


{ 14 4244 3
Demodulator outputs n outputs per Branch word
for Branch word i

Modul 11 - Siskom 2 - Convolutional Code 4


Proses encoder
Inisialisasi memori shift register sebelum proses encoding
dengan mengisi semua shift register dengan bit nol (all-
zero)
Tambahkan bit nol diakhir data bit setelah proses encoding
agar semua isi shift register menjadi nol. Bit nol yang
dit b hk iinii di
ditambahkan disebut
b t tail-zero
t il bit atau
t bit tail
t il

data tail Encoder


code codeword

Laju pengkodean efektif :


L adalah
d l h jumlah
j l hd data
t bit d
dan di
diasumsikan
ik k=1
k 1:
L
Reff = < Rc
n( L + K 1)

Modul 11 - Siskom 2 - Convolutional Code 5


Encoder Konvolusi dengan rate
C
Convolutional
l ti l encoder
d ((rate
t ,
K=3)
K 3)
3 shift-register dimana isi register yang pertama
merupakan data input
k = 1 dan n = 2
Contoh Implementasi
p dengan
g g1 = ((1 1 1)) dan g2 =
(1 0 1)
g1 = (1 1 1)
u1 First coded bit

(Branch word)
Input data bits Output coded bits
m u1 ,u 2
u2 Second coded bit
g2 = (1 0 1)

Modul 11 - Siskom 2 - Convolutional Code 6


Contoh encoder konvolusi dengan rate = 1/2

Misal : Data Input m = (1 0 1)

Output
O t t Output
O t t
(Branch word) (Branch word)
u1 u1
Time Time
u1 u 2 u1 u 2
t1 1 0 0 t2 0 1 0
1 1 1 0
u2 u2

u1 u1
u1 u 2 u1 u 2
t3 1 0 1 t4 0 1 0
0 0 1 0
u2 u2

Modul 11 - Siskom 2 - Convolutional Code 7


Contoh encoder konvolusi rate = ..cont

Time p
Output Time Output
p
(Branch word) (Branch word)

u1 u1
u1 u2 u1 u2
t5 0 0 1 t6 0 0 0
11 0 0
u2 u2

m = (101) Encoder U = (11 10 00 10 11)

Modul 11 - Siskom 2 - Convolutional Code 8


Convolutional Encoder: Example
Contoh Implementasi dengan g1 = (1 0 1) dan g2 = (1 1 1)
Rate Convolutional Encoder
g2 = ((1 1 1)) 1
+
u2

Input Output
101 0 0
u1

+
g1 = (1 0 1)
1

Modul 11 - Siskom 2 - Convolutional Code 9


Convolutional Encoder: Example
Contoh Implementasi dengan g1 = (1 0 1) dan g2 = (1 1 1)
Rate Convolutional Encoder
g2 = (1 1 1)
1
+
u2

Input Output
101 1 0
11
u1

+
g1 = (1 0 1) 0

Modul 11 - Siskom 2 - Convolutional Code 10


Convolutional Encoder: Example
Contoh Implementasi dengan g1 = (1 0 1) dan g2 = (1 1 1)
Rate Convolutional Encoder
g2 = (1 1 1)
0
+
u2

Input Output
101 0 1
1011
u1

+
g1 = (1 0 1) 0

Modul 11 - Siskom 2 - Convolutional Code 11


Convolutional Encoder: Example
Contoh Implementasi dengan g1 = (1 0 1) dan g2 = (1 1 1)
Rate Convolutional Encoder
g2 = (1 1 1)

+
u2

Input Output
101 1 0
001011
u1

+
g1 = (1 0 1)

Modul 11 - Siskom 2 - Convolutional Code 12


Diagram State
Menyatakan perubahan isi / kondisi (state)
( ) dari
memori shift register
Isi memory shift register selanjutnya akan
diprediksi berdasarkan data input yang masuk dan
isi memory saat ini
Terdapat 2 K 1 state
Diagram state juga berisi semua state dan semua
kemungkinan transisi antar state

Modul 11 - Siskom 2 - Convolutional Code 13


State Diagram Representation of
Convolutional Codes
g1 = (1 1 1) 0/00
+
00
Input Output
a
SR0 SR1 1/11
0/11

01 1/00 10
+
c b
g2 = (1 0 1)
0/01
0/10 1/10
11
States (SR0 SR1) d
a 0 0
b 1 0
c 0 1 1/01
Input 0
d 1 1 Input 1

Modul 11 - Siskom 2 - Convolutional Code 14


0/00
Trellis Representation of
a
Convolutional Codes 0/11 1/11
c 1/00 b

0/01
Input 0 0/10 1/10
d
Input 1
Input 0
1/01 Input 1

00 00 00 00 00 00
a (0 0)
11 11 11 11 11 11

b (1 0) 11 11 11 11
00 00 00 00

01 01 01 01 01
c (0 1) 10 10 10 10 10

10 10 10 10

d(1 1) 01 01 01 01

Modul 11 - Siskom 2 - Convolutional Code 15


0/00
Trellis Representation of
a
Convolutional Codes 0/11 1/11
c 1/00 b

0/01
0/10 1/10
Input: 101 Output: 110100 d

Input 0
1/01 Input 1

00 00 00 00 00 00
a (0 0)
11 11 11 11 11 11

b (1 0) 11 11 11 11
00 00 00 00

01 01 01 01 01
c (0 1) 10 10 10 10 10

10 10 10 10

d (1 1) 01 01 01 01

Modul 11 - Siskom 2 - Convolutional Code 16


Representasi Encoder Menggunakan Vektor

Didefinisikan vektor untuk menyatakan encoder konvolusi.


Vektor terdiri dari K element dimana masing masing
vektor menyatakan penjumlahan modulo-2
modulo-2.
Elemen ke i dari masing masing vektor = 1 jika isi
register ke - i tersebut terhubung ke penjumlahan modulo-2.
Sedangkan elemen ke i = 0 jika tidak terhubung ke
penjumlahan modulo-2
Contoh :

u1
g1 = (111)
m u1 u 2
g 2 = (101)
u2

Modul 11 - Siskom 2 - Convolutional Code 17


Representasi Encoder Menggunakan Vektor contd

R
Representasi
t i tterhadap
h d respon iimpuls
l
Respon encoder terhadap sebuah bit 1
Contoh : Branch word
Register
contents u1 u2
Input sequence : 1 0 0 100 1 1
Output sequence : 11 10 11 010 1 0
001 1 1

Input m Output
1 11 10 11
0 00 00 00
1 11 10 11
Modulo 2 sum: 11 10 00 10 11
Modulo-2

Modul 11 - Siskom 2 - Convolutional Code 18


Representasi Encoder Menggunakan Polynomial

Didefinisikan n buah generator polynomial yang masing


masing menyatakan penjumlahan modulo-2.
Masing masing polynomial mempunyai derajat K-1 atau
kurang
Masing masing polynomial juga menyatakan hubungan
shift register yang berhubungan dengan penjumlahan
modulo - 2
Contoh :

g1 ( X ) = g 0(1) + g1(1) . X + g 2(1) . X 2 = 1 + X + X 2


g 2 ( X ) = g 0( 2 ) + g1( 2 ) . X + g 2( 2 ) . X 2 = 1 + X 2
Output
p encoder menjadi
j :

U1(X) = m(X) g1(X) dan U2(X) = m(X) g2(X)

Modul 11 - Siskom 2 - Convolutional Code 19


Representasi Polynomial contd

Untuk lebih detail :


m( X )g1 ( X ) = (1 + X 2 )(1 + X + X 2 ) = 1 + X + X 3 + X 4
m( X )g 2 ( X ) = (1 + X 2 )(1 + X 2 ) = 1 + X 4
m( X )g1 ( X ) = 1 + X + 0. X 2 + X 3 + X 4
m( X )g 2 ( X ) = 1 + 0. X + 0. X 2 + 0. X 3 + X 4
U( X ) = (1,1) + (1,0) X + (0,0) X 2 + (1,0) X 3 + (1,1) X 4
U = 11 10 00 10 11

Modul 11 - Siskom 2 - Convolutional Code 20


Optimum decoding
If the input sequence messages are equally likely, the
optimum decoder which minimizes the probability of error
i th
is the Maximum
M i lik lih d decoder.
likelihood d d

ML decoder, selects a codeword among all the possible


codewords which maximizes the likelihood function

where p (Z | U (m ) ) is the received sequence and Z is one
of the possible codewords: U (m)
codewords
2L
to search!!!
ML ddecoding
di rule:
l
Choose U ( m) if p (Z | U ( m) ) = max(m) p (Z | U ( m ) )
over all U

Modul 11 - Siskom 2 - Convolutional Code 21


Soft and hard decisions
In hard decision:
The demodulator makes a firm or hard decision whether
one or zero is transmitted and provides no other
information for the decoder such that how reliable the
decision is.

Hence, its output is only zero or one (the output is


quantized only to two level) which are called hard-bits
hard-bits .

Decoding based on hard-bits is called the hard-


decision decoding.

Modul 11 - Siskom 2 - Convolutional Code 22


Soft and hard decision-contd

In Soft decision:
The demodulator p
provides the decoder with some
side information together with the decision.
The side information provides the decoder with a
measure of confidence for the decision.
The demodulator outputs which are called soft-
bits, are quantized to more than two levels.
Decoding
D di b basedd on soft-bits,
ft bit iis called
ll d th
the
soft-decision decoding.
On AWGN channels,
channels 2 dB and on fading
channels 6 dB gain are obtained by using
soft-decoding over hard-decoding.

Modul 11 - Siskom 2 - Convolutional Code 23


The Viterbi algorithm

The Viterbi algorithm performs Maximum likelihood


decoding.
It find a path through trellis with the largest metric
(maximum correlation or minimum distance).
It processes the demodulator outputs in an iterative
manner.
At each step in the trellis, it compares the metric of all
paths entering each state
state, and keeps only the path with
the largest metric, called the survivor, together with its
metric.
It proceeds in the trellis by eliminating the least likely
paths.
K 1
It reduces the decoding complexity to L 2 !

Modul 11 - Siskom 2 - Convolutional Code 24


The Viterbi algorithm - contd

Viterbi algorithm:
A
A. D th
Do the ffollowing
ll i sett up:
For a data block of L bits, form the trellis. The trellis has
L+K-1 sections or levels and starts at time t1 and ends
up at time t L + K .
Label all the branches in the trellis with their
corresponding branch metric.
For each state in the trellis at the time ti which is
denoted by S (ti ) {0,1,...,2 }, define a parameter (S (ti ), ti )
K 1

B. Then,
e , do the
e following:
o o g

Modul 11 - Siskom 2 - Convolutional Code 25


The Viterbi algorithm - contd
Sett (0, t1 ) = 0 and
1. S
1 d i = 2.
2. At time ti , compute the partial path metrics for all the
paths entering
p g each state.
3. Set (S (ti ), ti ) equal to the best partial path metric
entering each state at time ti .
Keep the survivor path and delete the dead paths from
the trellis.
4. If i < L + K , increase i by 1 and return to step 2.
C. Start at state zero at time t L + K . Follow the
surviving branches backwards through the trellis.
The path thus defined is unique and correspond
to the ML codeword.

Modul 11 - Siskom 2 - Convolutional Code 26


Maximum Likelihood Decoding of
Convolutional
Co o ut o a Codes
Maximum Likelihood Decoding:
What is the transmitted sequence that will most likely result in the
received
i d sequence att th
the d
decoder
d side?
id ?
Viterbi Decoding of Convolutional Codes:
Maximum likelihood decoding algorithm

An algorithm that finds the closest codeword to a given received sequence


Hard Decision: Closest Minimum Hamming Distance
Soft Decision : Closest Minimum Voltage Separation

Hard Decision:
The receiver makes a firm hard decision whether one or zero is
received
The receiver provides no information to the decoder characterizing
reliability
li bilit off itits d
decision
i i
The input to the decoder is only zero or one
Modul 11 - Siskom 2 - Convolutional Code 27
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01

10 11 01 00 11 10
t
00 1 00 00 00 00 00
a (0 0)
11 11 11 11 11 11
1
b (1 0) 11 11 11 11
00 00 00 00

01 01 01 01 01
c (0 1) 10 10 10 10 10

10 10 10 10

d (1 1) 01 01 01 01

Modul 11 - Siskom 2 - Convolutional Code 28


Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01

10 11 01 00 11 10
t
00 1 00 3 00 00 00 00
a (0 0)
11 11 11 11 11 11
1 1
b (1 0) 11 11 11 11
00 00 00 00

01 01 01 01 01
c (0 1) 10 10 10 10 10
2
10 10 10 10

d (1 1) 01 01 01 01
2
Modul 11 - Siskom 2 - Convolutional Code 29
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01

10 11 01 00 11 10
t 4
1 3 3
00 00 00 00 00 00
a (0 0)
11 11 11 11 11 11
1 4
1
3
b (1 0) 11 11 11 11
00 00 00 00

01 01 1 01 01 01
c (0 1) 10 10 4 10 10 10
2
10 10 10 10

d (1 1) 01 01 01 01
2 3
2
Modul 11 - Siskom 2 - Convolutional Code 30
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01

10 11 01 00 11 10
t
1 3 3
00 00 00 00 00
a (0 0)
11 11 11 11 11
1 1
3
b (1 0) 11 11 11 11
00 00 00 00

01 01 1 01 01 01
c (0 1) 10 10 10 10
2
10 10 10

d (1 1) 01 01 01 01
2 2
Modul 11 - Siskom 2 - Convolutional Code 31
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01

10 11 01 00 11 10
t 3
1 3 3 3
00 00 00 00 00
a (0 0)
11 11 11 11 11
1 5
1
3 1
b (1 0) 11 11 11 11
00 00 00 00

01 01 1 01 4 01 01
c (0 1) 10 10 10 10
3
2
10 10 10

d (1 1) 01 01 01 01
2 2 4
3
Modul 11 - Siskom 2 - Convolutional Code 32
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01
Two Equivalent Paths:
Eliminate one of them at random
10 11 01 00 11 10
t 3
1 3 3 3
00 00 00 00 00
a (0 0)
11 11 11 11
1 1
3 1
b (1 0) 11 11 11 11
00 00 00 00

01 01 1 01 01
c (0 1) 10 10 10
3
2
10 10 10

d (1 1) 01 01 01 01
2 2 3
Modul 11 - Siskom 2 - Convolutional Code 33
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01

10 11 01 00 11 10
t
1 3 3 3
00 00 00 00 00
a (0 0)
11 11 11 11
1 1
3 1
b (1 0) 11 11 11
00 00 00 00

01 01 1 01 01
c (0 1) 10 10 10
3
2
10 10 10

d (1 1) 01 01 01 01
2 2 3
Modul 11 - Siskom 2 - Convolutional Code 34
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01

10 11 01 00 11 10
t 5
1 3 3 3 3
00 00 00 00 00
a (0 0)
11 11 11 11
1 3
1
3 1 5
b (1 0) 11 11 11
00 00 00 00

01 01 1 01 2 01
c (0 1) 10 10 10
3 4
2
10 10 10

d (1 1) 01 01 01 01
2 2 3 2
Modul 11 - Siskom 2 - Convolutional Code 4 35
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01

10 11 01 00 11 10
t
1 3 3 3 3
00 00 00 00
a (0 0)
11 11 11 11
1 3
1
3 1
b (1 0) 11 11 11
00 00 00

01 01 1 01 2 01
c (0 1) 10 10 10
3
2
10 10

d (1 1) 01 01 01
2 2 3 2
Modul 11 - Siskom 2 - Convolutional Code 36
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01

10 11 01 00 11 10
t 4
1 3 3 3 3 3
00 00 00 00
a (0 0)
11 11 11 11
1 3 4
1
3 1 3
b (1 0) 11 11 11
00 00 00

01 01 1 01 2 01 5
c (0 1) 10 10 10
3 2
2
10 10

d (1 1) 01 01 01
2 2 3 2 3
Modul 11 - Siskom 2 - Convolutional Code 4 37
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01

10 11 01 00 11 10
t
1 3 3 3 3 3
00 00 00
a (0 0)
11 11 11
1 3
1
3 1 3
b (1 0) 11 11 11
00 00 00

01 01 1 01 2
c (0 1) 10 10 10
3 2
2
10 10

d (1 1) 01 01
2 2 3 2 3
Modul 11 - Siskom 2 - Convolutional Code 38
Viterbi Decoder Hard Decision
t
Assume received (Hard Decision) vector is 01 11 00 10 11 01
Message (0 1 1 0 1 0) Decoded vector is 01 01 00 10 11 00
10 11 01 00 11 10
t
1 3 3 3 3 3
00 00 00
a (0 0)
11 11 11
1 3
1
3 1 3
b (1 0) 11 11 11
00 00 00

01 01 1 01 2
c (0 1) 10 10 10
3 2
2
10 10

d (1 1) 01 01
2 2 3 2 3
Modul 11 - Siskom 2 - Convolutional Code 39
Latihan soal: Hard decision Viterbi
decoding
m = (10100 ) U = (11 10 00 10 11)
Z = (11 10 11 10 01)

a (0 0) 0/00 0/00 0/00 0/00 0/00


1/11 1/11 1/11
b (1 0) 0/11 0/11 0/11
0/10 1/00

c (0 1) 0/10 0/10
1/01 1/01
0/01 0/01
d(1 1)
t1 t2 t3 t4 t5 t6

Tentukan data kirim ?


Apakah terjadi error data ?

Modul 11 - Siskom 2 - Convolutional Code 40


Free distance of Convolutional codes

Distance properties:
Since a Convolutional encoder generates codewords with
various sizes (as opposite to the block codes), the following
approach is used to find the minimum distance between all
pairs of codewords:
p
Since the code is linear, the minimum distance of the code is
the minimum distance between each of the codewords and the
all-zero codeword.
This is the minimum distance in the set of all arbitrary long
paths along the trellis that diverge and remerge to the all-zero
path.
It is called the minimum free distance or the free distance of the
code, denoted by d free or d f

Modul 11 - Siskom 2 - Convolutional Code 41


Free distance

The path diverging and remerging to Hamming weight


All-zero ppath
all zero path with minimum weight
all-zero of the branch
df =5
0 0 0 0 0
2 2 2
2 2 2
1 0
1 1
1 1
1 1

t1 t 2 t 3 t 4
t 5 t 6

Modul 11 - Siskom 2 - Convolutional Code 42


Hard Decision Vs Soft Decision Performance:
Example
p 1/3 Repetition
p Code
-1
10
Soft Decision Decoding
Hard Decision Decoding
-2
2
10
bability

-3
10
Coded Biit Error Prob

-4
10

-5
10

-6
6
10

-7
10
0 1 2 3 4 5 6 7 8 9
2 2
(dB) 10(a / ) (dB)
SNR = 10*log
Tugas, Dikumpulkan !

Exercise 2

a) Find the maximum likehood path through the trellis diagram !


b) Determine the first 5 decode data bits !

Modul 11 - Siskom 2 - Convolutional Code 44

Anda mungkin juga menyukai