Decode binary code using arithmetic decoding
dseq = arithdeco(code,counts,len)
dseq = arithdeco(code,counts,len) decodes
the binary arithmetic code in the vector
recover the corresponding sequence of
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. This function assumes that the data in
produced by the
counts vector so that a one occurs 99% of the time.
counts = [99 1];
Set the sequence length to 1000. Generate a random sequence.
len = 1000; seq = randsrc(1,len,[1 2; .99 .01]);
Arithmetically encode the random sequence then, decode the encoded sequence.
code = arithenco(seq,counts); dseq = arithdeco(code,counts,length(seq));
Verify that the deocoded sequence matches the original sequence.
ans = 1
 Sayood, Khalid, Introduction to Data Compression, San Francisco, Morgan Kaufmann, 2000.