Nick ODell
Nick ODell

Reputation: 25259

How to demodulate (audio) morse code

I have a radio receiver. That radio's sound output goes to my computer. The sound output contains morse code on or about 440 Hz. That morse code could range in speed from 2 to 20 WPM. I sort-of know how to figure out whether the other station is transmitting, but how do I take that transmitting/not transmitting state and turn it into text? I thought there might be a better solution than brute force.

Complicating factors:

Source code

Example output of program so far. It can resolve the audio into keyed/not keyed, but resolving that into dots/dashes is not working.

###########################################################__________________________
_________________________________####################################################
#####################################################################################
#######################################______________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_________________________

Any code/suggestions on the thing that determines transmitting/not transmitting and/or the section that resolves that to morse code would be appreciated.

Upvotes: 4

Views: 2167

Answers (1)

Eugene Ryabtsev
Eugene Ryabtsev

Reputation: 2301

About separating dots from dashes and spaces from each other one idea is to start collecting statistics at the start of conversation and put all "XXms of keyed" events into one array (or something) and all "YY ms of not keyed" into another array (or something). Then you will eventually a histogram probability(t) for keyed and the same for not keyed. These histograms should have some maximums and minimums, visible both to humans and to some algorithms. So, you do some rounding of the curves split them at those minimums to separate dots to the left from dashes to the right, same with maybe more than one minimum with spaces. This approach will really pick well into the conversation, but require no tuning.

Upvotes: 2

Related Questions