Skip to main content

2 posts tagged with "morse"

View all tags

A Morse decoder that runs in a browser tab

7 min read
UR3PKI
Software Engineer

Audio from the sound card turns into text, and all of it happens in the tab: nothing is uploaded to a server, nothing calls out to somebody else's API. A 14 MB neural network sits next to the page, the ONNX runtime is built into the same bundle, and after the first load the page works with no network at all.

The interesting part is not that it works. The interesting part is how many ways there are to get it wrong, none of which announce themselves with an error.

The Morse tree: a variable-length code a century before Huffman

6 min read
UR3PKI
Software Engineer

Morse code is usually presented as a table: a letter, and beside it the dots and dashes. In that form it looks like an arbitrary list, and all you can do with it is memorise it.

It is in fact a binary tree, and in that form you can see the engineering decision taken in the 1840s: the frequency of a letter sets its depth. E is one dot, T one dash, because those are the commonest letters in English. Q, J and Z sit all the way down on the fourth level. Alfred Vail arrived at this not by theory but by counting: he counted the letters in the type cases of a local newspaper.

A variable-length code, allocated by symbol frequency. A hundred-odd years before Shannon and Huffman explained why that works.