Communications Toolbox    
arithenco

Encode a sequence of symbols using arithmetic coding

Syntax

Description

code = arithenco(seq,counts) generates the binary arithmetic code corresponding to the sequence of symbols specified in the vector seq. The vector counts represents the source's statistics by listing the number of times each symbol of the source's alphabet occurs in a test data set.

Examples

This example illustrates the compression that arithmetic coding can accomplish in some situations. A source has a two-symbol alphabet and produces a test data set in which 99% of the symbols are 1s. Encoding 1000 symbols from this source produces a code vector having many fewer than 1000 elements. The actual number of elements in code varies, depending on the particular random sequence contained in seq.

The output is

Algorithm

This function uses the algorithm described in [1].

See Also

arithdeco

References

[1]  Sayood, Khalid, Introduction to Data Compression, San Francisco, Morgan Kaufmann, 2000.


  arithdeco awgn