Closed febs closed 3 years ago
I have thought about it but in order to do this properly and go beyond the traditional threshold approach that does not work very well unless you have a calibrated strong signal to process you have to resort to machine learning and this is not a small undertaking. I think I have come across some works that have been done in this area but I don't have the pointers right now (to be added later). One can also dig into speech recognition which could be used in a similar approach.
The works I came across was Mauri Niininen's (AG1LE). I don't have the original pointers but there seems to be more recent ones:
Maybe this can be useful
http://ag1le.blogspot.com/2013/09/new-morse-decoder-part-1.html
and more recently: http://ag1le.blogspot.com/2020/04/new-real-time-deep-learning-morse.html
The proposed technique is derived from Handwritten Text Recognition (HTR). In the recent years Transformers have superseded LSTM.
In the latter article:
Moreover, the proposed transformer approach is designed to work at character level, instead at the commonly used word level in translation or speech recognition applications. By using such design we are not restricted to any predefined fixed vocabulary, so we are able to recognize outof-vocabulary (OOV) words, i.e. never seen during training.
This is very interesting for Morse code decoding.
I have explored a bit more the subject and Mauri's AG1LE work. Actually I found his older work: https://github.com/ag1le/RNN-Morse quite interesting. Although less elaborate than the more recent developments it seems to take into account the "music" of the Morse code that is the "dit"` and "dah" lengths and the various forms of silence. Morse alphabet is not quite like handwriting so I am not sure the best approach is to reapply HCR methods directly on it. Any proficient human CW "decoder" will tell you that the "music of the code" is very important. So not taking this into account at the very first step might be detrimental to the rest of the chain. The "dit", "dah" and various silence separators input could then be taken as stimuli of the next network. It has probably more to do with automatic score transcription of music than handwritten character recognition. As a first step these stimuli lines could be used to make a powerful "intelligent" CW "filter" that reconstructs the modulation.
Edit: Transformers are a no-go: too few examples for time series and indeed they seem more adapted to Natural Language Processing (NLP) with a definite number of discrete input values.
After 10 days of intensive work there is no progress. Hence this issue is closed
Reopening as some progress was made. Soon I will publish some research Jupyter notebooks on a new repo. This could be the base of some "production grade" audio based utility then make the way into SDRangel as a feature plugin. But this is a long, long way...
My conclusions at this point are:
Note on typical machine learning acronyms:
Some food for thought here: https://github.com/f4exb/morseangel This is only in Jupyter Notebooks so at research stage. The RNN-Morse-chars_dual
notebook looks promising but I still have the lack of knowledge to properly extract the final data.
Eventually something that seems to work fairly well: https://github.com/f4exb/morseangel/blob/main/notebooks/RNN-Morse-chars_single-ord36e96.ipynb Training needs to be done progressively and with a rather low learning rate from the start. This model is fairly hard to train because its sweet spot seems to be very narrow. The effective number of samples per dit is increased to 7.69 (decimation 96) which allows some more tolerance.
MorseAngel is now an autonomous audio based application. It uses PyQt5 for the GUI and has the same theme as SDRangel. I think there is no point in integrating it with SDRangel. It is very easy to pipe in the audio coming out of SDRangel at best a mention can be made in the Wiki. At the moment this is not working satisfactorily but can show some intermittent successful decodes. Development will continue (contributors welcome!) in the MorseAngel project.
Edit: Wiki page here
New link (I guess the wiki page was renamed which gave it a new URL): https://github.com/f4exb/sdrangel/wiki/Decoding-Morse-code-from-audio
I think I stumbled upon some morse code transmissions while listening with SDRangel (it was around 7MHz) and I though it would be super cool if the software could automatically translate that into text for me.
Thanks,