2011-02-17

Morse Code Reader

I wanted to make a Morse code reading application for some time now. Here's my first attempt, it listens to the signal through the phone's mic and translates it to text:



I'm sure there are all kinds of advanced signal processing techniques that I should be using, but for now I went with the simplest, most naive approach. And it sort of works, except when it doesn't. What I do is I keep an exponential moving average of the signal's volume and I decide that the signal is currently "high" when the average is above a threshold and "low" when it's below it. The threshold is set based on recent peak volume. Then I try to decide what the length of a dot and a dash is, interpret the input accordingly, and finally translate the dots and dashes to letters. The application adapts to changing volume and speed within reasonable limits (it should work up to about 40 WPM).



I was hesitant about putting the application on Android Market, as I only tested it on my phone and it quite often fails at translating Morse code. Then again, it's not like I have anything to lose by getting 1-star reviews and insulting comments, so why not.

Here's a Market link.

14 comments:

  1. It works pretty well, congratulations.

    73 from Denis, F6GKQ

    ReplyDelete
  2. wow. this is excelent. ever thought about doing one that detect light?

    ReplyDelete
  3. Hi, I tried your app but it does crash at opening on an archos 43 tablet

    ReplyDelete
  4. Thanks very much! It works but two simple menu options would really help. One is to set or freeze the signal's volume level. This way I could transmit a few codes and set the red line near the mid line way above the floor noise. This mains between breaks or user pauses it will not start decoding background noise. Second, a menu option to set the pulse with of a dah and a dit. This way a newb and have long dahs and dits when and the decode will still work. This could just be a learn option menu where the it asks for a dah and then asks for a dit and records the pulse duration +/- a bit of time based on scale. These to changes should make this a dead on Morse code decode app.

    ReplyDelete
  5. Hi !

    Works very well with Samsung Galaxy SIII
    Can you write same app to IOS ???

    Regards from Portugal.

    ReplyDelete
  6. Hello!

    I like this program. It works very well on my Galaxy S3 smartphone. However, when the noise level is high, the threshold is set abit too low resulting to no decoding. It would be very useful to make it possible to set the threshold manually.

    Thanks!

    ReplyDelete

  7. Hi, I'm currently studying audio recognition in real time on android, I wonder what kind of libraries worked your application, and if you applied some filters on reading your audios.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Works very well on my smartphone, can't wait for Windows or Mac
    de YB1KIZ, 73

    ReplyDelete
  10. Hi Jacek, I've been asked by a fellow radio ham in New Zealand to try out your morse reading app and provide them with some feedback on it.
    I too have written one, and was very interested to see what the differences might be.
    I'm most impressed with your apps decoding, and particularly the sensitivity of the mic. I have had to put a 'gain' control slider on mine to boost the level.
    I know it's some time since you created this app, but would you be willing to share what you did, so I might improve mine?
    Please see http://qsl.net/g0hyn/G0HYN-Reader/G0HYN-Reader.html
    Many thanks, Robbie (G0HYN)

    ReplyDelete
  11. When will it be available on iOS?

    ReplyDelete
  12. Hi , This is very good app. I need to understand , how decoding is hapening, can you please provide sample code.

    ReplyDelete
  13. Couldn't get it work at all. I tried all kinds of volume settings, locations, just about everything I could think of. No Joy

    ReplyDelete