Kalpana Kalpana (Editor)

Shannon coding

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

In the field of data compression, Shannon coding, named after its creator, Claude Shannon, is a lossless data compression technique for constructing a prefix code based on a set of symbols and their probabilities (estimated or measured). It is suboptimal in the sense that it does not achieve the lowest possible expected code word length like Huffman coding, and never better but sometime equal to the Shannon-Fano coding.

The method was the first of its type, the technique was used to prove Shannon's noiseless coding theorem in his 1948 article "A Mathematical Theory of Communication", and is therefore a centerpiece of the information age.

This coding method gave rise to the field of information theory and without its contribution, the world would not have any of the many successors; for example Shannon-Fano coding, Huffman coding, or arithmetic coding. Much of our day-to-day lives are significantly influenced by digital data and this would not be possible without Shannon coding and its ongoing evolution of its predecessor coding methods.

In Shannon coding, the symbols are arranged in order from most probable to least probable, and assigned codewords by taking the first l i = log p i digits from the binary expansions of the cumulative probabilities k = 1 i 1 p k . Here x denotes the function which rounds x up to the next integer value.

Example

In the table below is shown an example of creating a code scheme for symbols a1-6. li represents a negative power of 2, which is less than or equal to the current probability. The fifth column represents the binary form of the sum. The last column is the bit code of each symbol.

References

Shannon coding Wikipedia