Arithmetic Coding
Arithmetic Coding
sequences of symbols
A unique identifier or tag is generated for
the sequence to be encoded
This tag is a fraction and it is binary
encoded
The set of tags for representing symbols
are the numbers in the unit interval [0,1)
Number of numbers in the unit interval is
infinite.
Unique tag can be generated for each
sequence.
0.0
a1
0.7
0.49
0.546
a1
a1
a1
0.49
a2
0.8
0.5558
0.539
a2
0.56
a3
1.0
0.0
0.546
a3
0.70
a2
a3
0.56
a2
0.5572
a3
0.56
l ( n ) l ( n 1) (u ( n 1) l ( n 1) ) FX ( xn 1)
u ( n ) l ( n 1) (u ( n 1) l ( n 1) ) FX ( xn )
u (n) l (n)
TX ( x )
2
The only information required by the tag
generation procedure is the cdf of the source,
which can be obtained directly from the probability
model.
P(a3) =0.18
1.
2.
3.
4.
5.
(2)
(4)
(4)
Find the value of x4 for which the interval [0. 00288 x Fx (x4-1),
0. 00288 x Fx (x4)) contains 0.001152 (Residual tag)
Divide the residual tag value by 0. 00288 to get 0.4.
Find the value of x4 for which 0.4 falls in the interval
[Fx(x4-1), Fx(x4) ). It is possible if x4 =1.
1.
2.
3.
4.
5.
t*
Fx (xk)
Update u(k) and l(k)
Continue until the entire sequence has been
decoded.
T x( x )
log(1 / p( x)) 1
Symbol
Fx
, P(a4) =
Tag
In binary
1
log p( x) 1
Code
0.5
.25
.010
01
0.75
.625
.101
101
0.875
.8125
.1101
1101
1.0
.9375
.1111
1111
l ( x)
l ( x)
1
0 Tx ( x) Tx ( x) l ( x )
l ( x) 2
Since
< Fx(x), < Fx(x).
T x( x )
Tx ( x)
l ( x)
l ( x)
Fx(x-1)
1
1
1
2l ( x )
log
1
p( x)
2
1
1
log
p( x)
1
p( x)
1
2
2
p( x)
p( x)
Tx ( x) Fx ( x 1)
2
1
Tx ( x) Fx ( x 1) l ( x )
2
or Tx ( x) Fx ( x 1)
l ( x)
l ( x)
representation of
1
2n
T x( x )
2
H ( X ) lA H ( X )
m