The ultimate objective of source coding is to transform the data into a sequence of 0s and 1s that is indistinguishable from a fair bit stream, i.e., a sequence of independent and identically distributed (iid) equiprobable bits. Accordingly, most work on channel coding starts with the assumption that the data to be transmitted comes as a fair bit stream. On this web site we provide an implementation of half Huffman coding (halfHC), an algorithm that finds optimal prefix-free source codes that produce 1s with a frequency close to 0.5.



  • halfhc.tar: implementation of halfHC. It is tested in Matlab R2010b. Having the Communications System Toolbox installed is advantageous. Having the Optimization Toolbox installed is partially required. combn.m is provided in halfhc.tar.
  • Quotes.txt: the short English text to test halfHC.