More on the crazy ITA2 encoding…

So, this morning, I was trying to test my understanding of the ITA2 code used in amateur radio teletype communications. I wrote up an encoder, generated some test audio files, and tried decoding them with fldigi. It mostly worked, but I had some difficulty with certain punctuation marks. I was curious what the problem should be, so I dug into the code in fldigi that does this stuff. I found this interesting chunk of code:


#if 0
/*
 * ITA-2 version of the figures case.
 */
static unsigned char figures[32] = {
        '\0',   '3',    '\n',   '-',    ' ',    '\'',   '8',    '7',
        '\r',   '\xb7', '4',    '\a',   ',',    '\xb7', ':',    '(',
        '5',    '+',    ')',    '2',    '\xb7', '6',    '0',    '1',
        '9',    '?',    '\xb7', '\xb7', '.',    '/',    '=',    '\xb7'
};
#endif
#if 1
/*
 * U.S. version of the figures case.
 */
static unsigned char figures[32] = {
        '\0',   '3',    '\n',   '-',    ' ',    '\a',   '8',    '7',
        '\r',   '$',    '4',    '\'',   ',',    '!',    ':',    '(',
        '5',    '"',    ')',    '2',    '#',    '6',    '0',    '1',
        '9',    '?',    '&',    '\xb7', '.',    '/',    ';',    '\xb7'
};
#endif
#if 0
/*
 * A mix of the two. This is what seems to be what people actually use.
 */
static unsigned char figures[32] = {
        '\0',   '3',    '\n',   '-',    ' ',    '\'',   '8',    '7',
        '\r',   '$',    '4',    '\a',   ',',    '!',    ':',    '(',
        '5',    '+',    ')',    '2',    '#',    '6',    '0',    '1',
        '9',    '?',    '&',    '\xb7', '.',    '/',    '=',    '\xb7'
};
#endif

Odd. It seems to differ significantly from the “official” ITA2 code. So, I modified my RTTY encoder to use the same encoding. I also discovered that fldigi implements “unshift-on-space”, regardless of what mode you are in, sending a space drops you back into the letter mode. This caused some things to decode improperly until I fixed it.

Now, it seems to work. If you are bored, you could download this overly long and verbose RTTY message (note, you may have to reverse mark and space frequencies, I’m not sure I got that right yet).

An RTTY message, encoded by my RTTY encoder (2.2M WAV file)