Example 2 with Context
x =1 2 3 4 5 4 5 6 7 8 7 8
r = 1 1 1 1 -1 1 1 1 1 -1 1 (residual)
Compression Algorithm
- represent x as x1, r1, r2, ..., r11
- Compress this sequence.
- 3 bits for x1 and less than 11 bits for the rest, for less than 14 bits instead of 35.02 bits.
This algorithm does not use just the frequencies of the symbols, but uses correlation between adjacent symbols.