MATLAB: Arithmetic coding, is decimal representation of codeword possible

arithmetic codingcode-efficiencyimage compressionMATLAB

I want to calculate the code efficiency and therefore need the average codeword length, which I want to calculate from the digits of the decimal representation.
Is this possible?
Edit:
Just to be a bit more precise: I got a binary column as an output after encoding with arithmetic coding and would like to know if it is possible to represent this output as decimal instead of binary.

Best Answer

The average codeword length is the number of code words divided by the number of bits of output.
The number of decimal digits is
ceil(numberof bits * log(2)/log(10))
which is approximately bits*0.30103
Related Question