next up previous
Next: Redundancy Up: No Title Previous: Sources

Codes

A source code assigns to each (possible) source sequence tex2html_wrap_inline2693 a binary codeword tex2html_wrap_inline2703 with length tex2html_wrap_inline2705 . We want the lengths of the codewords to be as short as possible, however it is required that the source sequence can be reconstructed from its codeword. Here we only consider prefix codes. In a prefix code no codeword is the prefix of any other codeword. Therefore a prefix code is instantaneously uniquely decodable, i.e. when we receive the last digit of a codeword we know that it is the last one.

Example:Consider for source sequences of length T=2 the assignment in the table below.

tabular67

The lengths of the codewords of a binary prefix code satisfy Kraft's inequality (see e.g. Cover and Thomas[1], page 82):

  equation73

Proof:Let tex2html_wrap_inline2715 . A codeword tex2html_wrap_inline2703 has tex2html_wrap_inline2719 descendants at level tex2html_wrap_inline2721 . In a prefix code no two different codewords can have an identical descendant at level tex2html_wrap_inline2721 . Therefore tex2html_wrap_inline2725 . tex2html_wrap_inline2727

Example:For the code tex2html_wrap_inline2729 we obtain the Kraft sum tex2html_wrap_inline2731 .


Ramesh Rao
Fri May 2 08:36:00 PDT 1997