Main Page | Report this Page
 
   
Science Forum Index  »  Compression Forum  »  decode Truncated binary encoding
Page 1 of 1    
Author Message
LiloLilo
Posted: Sat Apr 26, 2008 11:51 am
Guest
Hi,

is the Truncated binary encoding
http://en.wikipedia.org/wiki/Truncated_binary_encoding decodable when the
receiver doesn't know the size of the alphabet n, but only knows the next
power of 2 of n?

Thank you
Stefano Brocchi
Posted: Sat Apr 26, 2008 11:59 pm
Guest
On Apr 26, 6:51 pm, "LiloLilo" <danilobrambi...@tiscali.it> wrote:
Quote:
Hi,

is the Truncated binary encodinghttp://en.wikipedia.org/wiki/Truncated_binary_encodingdecodable when the
receiver doesn't know the size of the alphabet n, but only knows the next
power of 2 of n?

Thank you

Hello,

This shouldn't be possible: if for the decoder all the possible codes
up to the power of two can be used, then there is no way for him to
distinguish a code with less bits from a prefix of a longer code.

An example: on the last example of the wiki page, 0 can be encoded
with two bits because we know there are no codes with prefix 00, as
the encoder knows there are 7 symbols in the alphabet. If the decoder
does not know n, then for him 00 could just be a prefix on a three-bit
symbol.

Greetings
Stefano
LiloLilo
Posted: Sun Apr 27, 2008 6:59 am
Guest
OK. This makes Truncated binary encoding userful only for quite long
sequences of words, because then I need to add one more word at the
beginning of the transmission with value of n, or almost the value of u =
2^k - 3 which is always 1 bit shorter then n.
For example, if I have a very short sequence of words, say 4 words, with an
alpabeth of n = 10, using standard binary I would need 16 bits. Using
Truncated binary encoding I would need 3 bits to transmit u, then from 3 to
4 bits to transmit each of the 4 words, and this makes quite always a longer
stream.

"Stefano Brocchi" <stefano.brocchi@researchandtechnology.net> wrote in
message
news:4458a1ca-6ec3-42be-98ed-2d43cd1c5ae6@34g2000hsf.googlegroups.com...
Quote:
On Apr 26, 6:51 pm, "LiloLilo" <danilobrambi...@tiscali.it> wrote:
Hi,

is the Truncated binary
encodinghttp://en.wikipedia.org/wiki/Truncated_binary_encodingdecodable
when the
receiver doesn't know the size of the alphabet n, but only knows the next
power of 2 of n?

Thank you

Hello,

This shouldn't be possible: if for the decoder all the possible codes
up to the power of two can be used, then there is no way for him to
distinguish a code with less bits from a prefix of a longer code.

An example: on the last example of the wiki page, 0 can be encoded
with two bits because we know there are no codes with prefix 00, as
the encoder knows there are 7 symbols in the alphabet. If the decoder
does not know n, then for him 00 could just be a prefix on a three-bit
symbol.

Greetings
Stefano
Stefano Brocchi
Posted: Sun Apr 27, 2008 11:41 pm
Guest
On Apr 27, 1:59 pm, "LiloLilo" <danilobrambi...@tiscali.it> wrote:
Quote:
OK. This makes Truncated binary encoding userful only for quite long
sequences of words, because then I need to add one more word at the
beginning of the transmission with value of n, or almost the value of u =
2^k - 3 which is always 1 bit shorter then n.
For example, if I have a very short sequence of words, say 4 words, with an
alpabeth of n = 10, using standard binary I would need 16 bits. Using
Truncated binary encoding I would need 3 bits to transmit u, then from 3 to
4 bits to transmit each of the 4 words, and this makes quite always a longer
stream.


Yes, that's right. Another case where it could be useful is where
limitations on the values can be deduced by the context, as in the
case of a series of decreasing integers.

So long,
Stefano
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Thu Jul 24, 2008 5:17 am