0% found this document useful (0 votes)
86 views

Dwi Putri Wahyuningsih 2019390004 HW-Tunstall Coding: Initial Code

The document describes creating a 4-bit Tunstall code codebook. It starts with a probability distribution over 4 symbols {A, B, C, D}. It then iteratively combines the symbol with the highest probability with each remaining symbol until only combinations remain, producing the final 4-bit codebook.

Uploaded by

Yuyun Joe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
86 views

Dwi Putri Wahyuningsih 2019390004 HW-Tunstall Coding: Initial Code

The document describes creating a 4-bit Tunstall code codebook. It starts with a probability distribution over 4 symbols {A, B, C, D}. It then iteratively combines the symbol with the highest probability with each remaining symbol until only combinations remain, producing the final 4-bit codebook.

Uploaded by

Yuyun Joe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 4

Dwi Putri Wahyuningsih

2019390004

HW-Tunstall Coding

Y = {A, B, C, D}

P = (0.1, 0.2, 0.3, 0.4)

Create a codebook for 4 bit-Tunstall code.

Initial Code

A 0.1
B 0.2
C 0.3
D 0.4
D has the bigger value, so we remove it from table
First Iteration

A 0.1
B 0.2
C 0.3
AD 0.04
BD 0.08
CD 0.12
DD 0.16
C has the bigger value, so we remove it from table

Second Iteration

A 0.1
B 0.2
AC 0.03
AD 0.04
BC 0.06
BD 0.08
CC 0.09
CD 0.12
DC 0.12
DD 0.16
B has the bigger value, so we remove it from table
Third Iteration

A 0.1
AB 0.02
AC 0.03
AD 0.04
BB 0.04
BC 0.06
BD 0.08
CB 0.06
CC 0.09
CD 0.12
DB 0.08
DC 0.12
DD 0.16
DD has the bigger value, so we remove it from table
Fourth Iteration (Codebook)

A 0000
AB 0001
AC 0010
AD 0011
BB 0100
BC 0101
BD 0110
CC 0111
CD 1000
DB 1001
DC 1010
DD 1011
ADD 1100
BDD 1101
CDD 1110
DDD 1111

You might also like