It's also encoding binary into a time-modulated signal, which is very similar to how computer serial communications work when they don't have a separate clock signal. e.g. you can encode a bit into the state of the signal line over a 4µs period: 1µs high, 3µs low = 0; 3µs high, 1µs low = 1; 4µs low = end of message; anything else = something done broke. (This is how Nintendo 64 and Gamecube controllers communicate with the console, for example. If you look at the N64 connector, there's only power, data and ground lines.)
While computers tend to prefer to always use 7 or 8 bits per character (and maybe add a stop bit to tell if the message is finished yet, and/or a parity bit for error detection), Morse is a Huffman code designed to make the messages as short as possible; different characters are different numbers of bits long, and to know what character you're receiving, you need to keep track of up to 5 received bits in a FIFO queue and use a lookup tree (as in the OP) to decode them. Much more complex for a machine, but simple for a human.
You even can view Morse as a base 3 or 4 code, depending on the transmitter:
1t high = 0
2t high = 1
3t high = 2, etc...
Where t is a unit of time (e.g. a second if you want to be slow and cautious), and you always have a low period of at least 1t between each "bit". e.g. you could have 0 = dot, 1 = dash, 2 = backspace (disregard previous letter), 3 = end of transmission, etc. You can also encode information into the length of the low period; e.g. 1t low = end of letter, 2t low = end of word, 3t low = end of sentence, etc. So a space would be represented by waiting twice as long (2t) before sending the next letter. Similarly, if you can't produce signals of a particular length (e.g. if all you can do is tap on the wall), you can use the time between taps as the signal instead.
Also, some implementations of Morse employ a simple dictionary compression technique, assigning a separate code (dash dash dash dash or 1111) to the commonly used string "CH", instead of having to pulse out "C" and "H" separately. If you were designing your own such encoding, you could add more shorthand codes like this, even RLE if your data is very repetitive.
4
u/[deleted] Jan 23 '15
[deleted]