On Wed, May 09, 2007 at 03:08:03PM -0700, Andrew Lentvorski wrote: > For a while now, I've wondered whether Morse code would be a better way > to do text messaging than what we have. Especially since Morse code > only takes a single button and did a sane job of Huffman encoding. > ... While Morse code does a good job with a single button, this isn't exactly the same problem as Huffman encoding. Huffman encoding requires that any string of ones and zeros be valid and assumes that ones cost the same amount of time as zeros.
Morse has different constraints, some of which become apparent if we look at the two ways people try to treat Morse as binary: 1. If you consider dots as zeros and dashes as ones, you need to use base 3 instead of binary so you can represent the spaces between letters and between words, e.g. "from me" needs to be ..-.x.-.x---x--xx--x. , not just ..-..-.-------. , which may be ambiguous depending on context. 2. If you consider no carrier (key not pressed) as zero and carrier (key pressed) as one, it is binary, but if you send too many consecutive zeros or ones the receiver won't know precisely how many you intended to send. Morse solves this problem by requiring strings of ones to be only 2 lengths (dots and dashes), and strings of zeros to be only 3 lengths (symbol, letter, and word separators). A textbook description (1957 Bluejackets' Manual) gives nominal lengths, so we can write (approximately) 0 = symbol separator 1 = dot 000 = letter separator 111 = dash 0000000 = word separator Now "from me" or ..-.x.-.x---x--xx--x. becomes 1010111010001011101000111011101110001110111000000011101110001 Despite the length of this string, the empirical evidence is that Morse is fairly close to optimal. (You can quibble about things like O, C, and Y having overly long encodings and M, W, X, and Z too short.) Because dashes are longer than dots, they are avoided to some extent for common letters. Morse is somewhat less compact compared to other encodings in contexts where dashes are just as short as dots, e.g. in puzzle ciphers like "Fractionated Morse" that use Morse as a first step with the base 3 representation (like ..-.x.-.x---x--xx--x.), or in communication if you provide separate dot and dash buttons and transmit them in some way that makes them have equal length. I apologize if my lack of experience with Morse has led me astray. Stewart Strait -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
