DJ1YFK's Ham Radio Stuff


All kinds of things too precious not to share, in short articles. Constantly under construction or destruction. Note that code snippets are usually working minimum examples (often stripped of extra features). If you plan to use and of the code for anything serious, you may want to contact me. It's likely that I can provide you with some updates and good (?) advice.

Fabian KurzHam RadioStuff

Experimental JavaScript Morse Decoder

As a complement to the many practice modes for receiving Morse code at Learn CW Online, I have been investigating ways to implement some kind of sending practice in the browser.

Taking CW input from the mouse key works very well with millisecond resolution (certainly less in reality, but accurate enough), so writing a little decoder for straight key CW only took half an hour including all testing. But I failed to produce a reliable sidetone: Triggering an HTML5 audio-element that plays a OGG file with an infinite sine tone by the play() and pause() methods was the closest I got, but it was too sluggish for anything above 5wpm. Update (2013-01-25): About two years and 14 versions of Firefox later, it seems to work very well with the HTML5 audio.

Feel free to play with it:

Speed: 8WpM


I released the code into the public domain. Do whatever you like with it (it should work with Firefox, Chrome and Safari).

2013-04-12: I just found another implementation of a JavaScript Morse decoder with jQuery on Ben Nadel's blog. It uses the space bar as the input device and has a nice display of the possible characters that could be formed from what has been sent so far (e. g. when entering ".--" it suggests "W", "J", "1") but it lacks a side tone.

2014-07-04: Burak Kanber (@bkanber) created a "online morse code radio" which is basically a chatroom with Morse input:

Added: 14-Jul-2010. Last modified: 04-Jul-2014.

Fabian KurzHam RadioStuff