Foundations of Information Processing: Information and Data Compression
Foundations of Information Processing: Information and Data Compression
Information Processing
Information and
data compression
Consideration 1:
How information can be defined?
1
𝑖𝑖 𝐴𝐴 = log 𝑏𝑏 = − log 𝑏𝑏 𝑃𝑃(𝐴𝐴)
𝑃𝑃(𝐴𝐴)
where
𝑛𝑛
1
𝐻𝐻 𝑋𝑋 = � 𝑝𝑝(𝑥𝑥𝑖𝑖 )log 𝑏𝑏 ( )
𝑝𝑝(𝑥𝑥𝑖𝑖 )
𝑖𝑖=1
𝑛𝑛
1 1 1 1 1 1
𝐻𝐻 𝑋𝑋 = −( log 2 + log 2 )= − ( − + − ) = 1.0
2 2 2 2 2 2
→ One bit is enough to encode: for example, heads (bit 1) and tails (bit 0).
Consideration 1:
Does information contain redundancy?
What is
the most compressed representation
for
the best encoding?
• Lossy compression:
– The original source information is partly lost so it cannot
be restored to its original form.
– The compression ratio is better.
– Is too much information lost?
00011010100001111100010111001111 →
032111145311324
• LZW code:
- Lempel, Ziv, Welch, 1978/1984, Technion, Israel & MIT.
- Most frequent words are saved in the table and given as short
codes as possible.
• Q code:
- Whole sentences are encoded with fixed-length code words.
1 1 1 1 1
0.4 log 2 + 0.2 log 2 + 0.15 lg 2 + 0.15 log 2 + 0.10 log 2
0.4 0.2 0.15 0.15 0.10
= 2.1464 bits/symbol
• This is the best possible compression theoretically.
• Note that without compression to directly encode 5 symbols requires 3
bits/symbol (you cannot directly encode/decode 5 symbols with 2 bits only):
s1 000
s2 001
s3 010
s4 011
s5 100
• 40 times the symbol 𝑠𝑠1 (code 0), 20 times 𝑠𝑠2 (code 000), etc.
• The average length is 40 ∗ 1 + 20 + 15 + 15 + 10 ∗ 3 = 220 bits.
• So only a little bit more than the best possible according to entropy:
100 ∗ 2.1464 => 215 bits (rounding upwards).
• Without compression: 3 ∗ 100 = 300 bits.
11 -23 27 0 0 -27 23
-23 27 0 -6 6 0 -27