Thursday, July 17, 2014

New Morse Decoder - part 5

Multichannel CW decoder for FLDIGI

I have been working on the Bayesian Morse decoder for a while.  The latest effort was focused on making it possible to automatically detect all CW signals in the audio band and spin up a new instance of the Bayesian decoder for each detected signal.

Figure 1. shows a running version implemented on top of FLDIGI  version 3.21.77.  The waterfall shows 9 CW signals from 400Hz to 1200 Hz. The software utilizes the FLDIGI Signal Browser user interface and you can set the signal threshold using the slider bar below the signal browser window. The user interface works very much like the PSK or RTTY browser.

Figure 1. Multichannel CW decoder for FLDIGI
The audio file in this demo was created using Octave script  below

Fs = 8000; % Fs is sampling frequency - 8 Khz
Ts = 10*Fs; % Total sample time is 10 seconds

% create 9 different parallel morse sessions - 10 seconds each at 20-35 WPM speed
%         TEXT           audio file  noiselevel Hz    speed WPM 
x1=morse('CQ TEST DE AG1LE','cw1.wav', 20,1200,Fs,20, Ts);
x2=morse('TEST DE SP3RQ CQ','cw2.wav', 15, 1100,Fs,35, Ts);
x3=morse('DE W3RQS CQ TEST','cw3.wav', 20,  1000,Fs,30, Ts);
x4=morse('SM0LXW CQ TEST DE','cw4.wav',15,   900,Fs, 25, Ts);
x5=morse('CQ TEST DE HS1DX','cw5.wav', 20,    800,Fs, 20, Ts);
x6=morse('TEST DE JA1DX CQ','cw6.wav', 10,      700,Fs, 20, Ts);
x7=morse('DE JA2ATA CQ TEST','cw7.wav',20,      600,Fs, 20, Ts);
x8=morse('UA2HH CQ TEST DE','cw8.wav', 15,      500,Fs, 20, Ts);
x9=morse('CQ TEST DE CT1CX','cw9.wav', 20,      400,Fs, 20, Ts);

% weighted sum - merge all the audio streams together 
% 9 signals arranged in frequency order 1200Hz ... 400Hz
y = 0.1*x1 + 0.1*x2 + 0.1*x3 + 0.1*x4 + 0.1*x5 + 0.1*x6 + 0.1*x7 + 0.1*x8 + 0.1*x9;

% write to cwcombo.wav file 

I have saved the full sources of this experimental FLDIGI version in Github:  FLDIGI source
UPDATE July 20, 2014: I rebased this using Source Forge latest branch  - new version is here: fldigi-3.22.0CN.tar.gz

Let me know if you are interested in testing this software.  I would be interested in getting feedback on scalability, any performance problems as well as how well the CW decoder works with real life signals.

Mauri AG1LE


  1. Hello Mauri, I would like to test the software. I'm not a CW user at all and not able to decode morse by myself. So I totally depend on software to decode CW. I use DM780 from HRD till now but it has difficulties decoding when there are to many signals around. Besides that the signal has to be over 20wpm and strong for a reliable decode. I'm curious how your software will behave? 73, Bas

    1. Do you have ability to compile FLDIGI from the sources? I am using Linux Mint distribution for development and testing. The tools are standard linux development tools. Instructions how to compile from source can be found from

      I have also used DM780 from HRD on my Windows machine and not happy with CW decoder. Is your main workstation Windows based?

      Mauri AG1LE

    2. Hello Mauri, I'll try to find some time to install Linux Mint and compile the source. My main computer is windows based. I guess this is all not working in Windows. 73, Bas

    3. Hi Bas
      I am working to get a Windows release out. I don't have capability to cross-compile so I need some help there. Stay tuned - I will make a new post when experimental Windows release is available for testing.

  2. Hi,

    Great to see this work progressing so quickly.

    There seems to be a missing file from the source code tarball. I tried to compile this on Linux Mint 16 and got the following error:

    cw_rtty/cw.cxx:40:21: fatal error: view_cw.h: No such file or directory
    #include "view_cw.h"

    How can I get this file?

    1. Hi
      Sorry for this - I added missing file to src/ and rebuilt the distribution file. Try downloading again and rebuilding it. I did this and now the missing view_cw.h was in the dist file.

      Mauri AG1LE

  3. Mauri,

    I use both Fldigi and CWSkimmer. Glad to see someone working on a decoder similer to the one CWSkimmer uses.

    I would like to test this, but not interested in compiling the source code. Is the compiled program available?


    1. Hi Larry
      Pre-compiled Windows version is not yet available. I haven't configured Windows compilation but I can check with Dave W1HKJ if he knows anybody who could do it and post it.
      Mauri AG1LE

    2. Larry - not sure if you have seen the follow up post. Pre-compiled Windows version is now available at

  4. Hi,

    I've got it running now and am testing it on real signals. Very neat! One question - I notice some signals high in the passband (say, above 1500 Hz), that I can identify by ear as CW, are not detected and decoded by the Bayesian decoder (in the signal browser window). If I double-click the signal, it is decoded in the main RX window (but still not the signal browser window). Can you think of some reason for this?

    Still need to do more testing... it seems many of the signals I am receiving on 40m now have a poor fist. :-)

    1. I got it. changed fupper to 3000 in view_cw.cxx and now I can decode signals up to 3000 Hz in the passband.

    2. I used flower and fupper to set the limits in method view_cw::findsignals(struct PEAKS *p) in the view_cw.cxx. The maximum is IMAGE_WIDTH which is 4000 Hz in my version. This corresponds with Nyquist frequency (1/2 of sampling frequency 8000 Hz used for FFT for Waterfall display).

    3. >Still need to do more testing... it seems many of the signals I am receiving on 40m now have a poor fist. :-)

      It looks like speed estimator initialization has a bug. I am getting "T T O E ..." sequences and speed indicator "CW Rx 50" under waterfall is stuck on 50 WPM. Let me check the code in initl.cxx. The ilrate[] array contains the initialized values.

    4. qrp-gaijin
      See the updated version - speed estimation bug is fixed in this one.
      Updated code available in W1HKJ website - link updated in the article.

  5. At last, someone working on a skimmer alternative.
    I am willing to give it some testing, willl it complile on an Ubuntu system do you think?
    I'm fairly OK with C, C++ but not so brilliant with linux OS, but I can normally compile stuff ok.

    1. Hi Iain
      I am using Linux Mint 15 for development. You can test compilation fairly quickly.
      - dowload the tar.gz package to a directory
      - tar xvf fldigi-3.21.77.multich.tar.gz
      - cd fldigi-3.21.77
      - ./configure
      - make

      if you get an error your system may miss some required libraries. See for help how to install those libraries.

    2. Hi,
      Installed the latest fltk and it nearly completes the compilation but errors with:

      fileselector/fileselect.cxx:109:16: error: ‘namespace FSEL { }’ redeclared as different kind of symbol
      ./include/fileselect.h:9:7: error: previous declaration of ‘class FSEL’

      Any ideas?

    3. Hi Iain
      I did some search but could not find this bug. I did rebase the software on Dave W1HKJ's request using branch in Source Forge. Updated distribution is in here:

  6. Eveybody - see update: latest version fldigi-3.22.0CN.tar.gz is - this has some bug fixes on speed estimation side, it works better now.

    I am working with Dave, W1HKJ to get Windows binaries as there seems to be demand for those.

  7. A new version with several bugfixes posted in here:

  8. Thanks. I got the 3.22CN version compiled ok, but the link above is broken?

  9. Windows version is now available for testing - see

  10. Hi Mauri,
    glad to see your work on the CW decoding for fldigi. Are there plans to integrate it permanently to the official fldigi versions? Are there plans for a connection to the reverse beacon network, so fldigi with your extension becomes a real alternative to CWSkimmer? I think this would be a significant development, thinking of using a Beagle Bone Black as standalone CW Skimmer...
    If you are in need of support for development (especially targeting this Telnet/ReverseBeaconNetwork topic), just tell me! :)
    Keep it up!

    1. Hi Chris
      I am working with Dave W1HKJ to integrate this functionality to an official FLDIGI version. Dave has posted the latest alpha build in (see fldigi-3.21.83cw-a5_setup.exe for Windows version, sources are in tarball).

      > Are there plans for a connection to the reverse beacon network, so fldigi with your extension becomes a real alternative to CWSkimmer?

      I didn't have any plans for this but this sounds very interesting. Would you be able to help integrating this functionality to FLDIGI? I don't have much knowledge about how ReverseBeaconNetwork works and what kind of APIs would be available. Are there any technical specification what kind of data is required for RBN?

      Mauri AG1LE

    2. Hi Mauri,

      an integration of your development into the official FLDIGI version sounds very promising.
      With or without RBN support, it will be very useful to the Ops.

      To enable CW Skimming functionality we would have to parse the received and decoded CW signals for the typical CW grammar (CQ CQ TEST CALLSIGN and so on) to detect valid transmissions automatically. The gained information (Callsign of the Sender, receive SNR, time, frequency) is either provided via a TELNET interface (classical operation of the original CW Skimmer software), and/or uploaded to the database of the reverse beacon network. Done that, the received stations show up on
      I don't know the exact data format required to send entries to the RBN, but I am pretty sure that the guys of the RBN would fully support such an development, as it is the key to operation on (lightweight) (standalone) Linux based operation systems.

      mny 73,
      Chris DL1COM

    3. Hi Mauri,

      today I compiled fldigi 3.21.83 with your developments. Works like a charm!
      While looking through the source code, I stumbled upon the fact that fldigi is already supporting autospotting in PSK, reporting to So, the algorithms to detect CQ calls and callsigns are already existing! :D
      As you are in contact with W1HKJ, perhaps you may propose him to add the possibility to report spots to the RBN in CW, PSK and RTTY mode. Basically, it is exactly the same thing which he already does when reporting to - only the message format to send spots to the RBN has to be asked from the RBN team :)

      I can't believe I recognized the autospotting functionality before ;)



Popular Posts