Tuesday, December 31, 2013

New Morse Decoder - Part 3

New Bayesian Morse Decoder 

In my previous blog entry I shared the first test results using Bayesian CW decoder integrated to FLDIGI.  As I indicated the software has still bugs but when it works the accuracy improvement compared to the legacy FLDIGI decoder was pretty impressive.  I was testing again tonight as ham bands were full of CW stations working in ARRL Straight Key Night.  I made also many audio file captures to be used as  additional testing material.

However,  as my alpha testers have also noticed the current decoder is very sensitive to proper audio signal settings.  In order to analyze this problem a bit more details I re-implemented FLDIGI audio processing chain from audio file playback to the decoder (including the FFT filtering in CW.CXX) in a standalone version of the Bayesian Morse Decoder.  It was easier to run a series of tests by just varying command line variables and WAV audio files  and capture the results for analysis & plotting the data.

After running a series of tests I compared the signal amplitude against decoder errors and found a very sharp non-linear behavior related to speed estimation algorithm.  By increasing signal volume by only 0.06% I was able to re-produce this event that alpha testers found and also capture the dynamic behavior of various parameters, including <spdhat>  that I used below to plot the speed estimate over time.

Figure 1. below shows that initially the speed tracking is trying to find the correct speed (in this case 40 WPM) but fairly soon it goes down below the lower limit 10 WPM  and is not able to recover from this error situation. This is similar behavior that alpha testers have seen.
Figure 1.  Speed estimator bug

I  scaled down the signal strength by only 0.06% and now the speed estimator works much better.   In Figure 2. below  the speed tracking fluctuates between 13 and 48 WPM until it settles to about 38 WPM.   Despite this tracking behavior the decoder produces  correct results from a noisy test file.

Figure 2.  Normal speed estimator behavior




I am very thankful for those brave hams who took this first  (broken) alpha release and provided me not only good  feedback but also some WAV file examples  that I have been able to use to track down these problems.

I have also converted all the files from C  to C++  to make it easier to re-integrate to FLDIGI.  I will continue cleaning up the code and keep working to improve the speed estimator.  Once I have the next alpha release ready for another set of tests I will announce it in the fldigi mailing lists and eham.net CW forum.

73 and Happy New Year

Mauri  AG1LE



Tuesday, December 24, 2013

New Morse Decoder - Part 2

New Bayesian Morse Decoder 


In my previous post I shared initial results of the new Bayesian Morse Decoder.  I have worked a bit more on this topic to integrate the decoder software to FLDIGI v3.21.75.   Dave  W1HKJ provided me some space on his web server so I posted full source code including all changes and new source files related to Bayesian Morse decoder in here.

To demonstrate the Bayesian decoding capability I tuned my KX3  on W1AW frequency 3.58105 Mhz  at 8:00 PM EST today and let two identical FLDIGI copies of the same v3.21.75 software running from the same audio source.  I have a SignaLink USB connected between KX3  and my ThinkPad laptop running Linux Mint OS.

On Fig 1. below  I have the legacy SOM decoder on the left side and the new Bayesian decoder on the right .  The legacy decoder makes a lot of errors and CW bulletin is not really readable.  On the right side I have enabled Bayesian decoder and you can actually read the bulletin, though the lack of proper word spaces make this still a bit difficult to read. In any case Bayesian decoder provides significant accuracy improvement with real life noisy CW signals.

Figure 1.  FLDIGI running legacy and Bayesian Morse decoder





If you choose to  compile FLDIGI from the sources yourself  please see Figure 2. below.  When you go to menu item Configure / Modems / CW / General  and click the tick box "Bayes decoding"  that will enable the new Bayesian decoder (and disables legacy decoder).  You will also notice that CW RX speed indicator  (Fig 1. bottom left corner of FLDIGI window)  will change more rapidly - this is a feature of the new decoder.  It evaluates the instantaneous speed continuously and uses this information as part of the decoding process.

Figure 2.  Enabling Bayesian decoder. 



I would be interested in getting your feedback and suggestions how to improve this software.  Current version is buggy  and it does crash occasionally.  Also, I still have not found the root cause of the problem that causes approximately 3% base error rate.

There are number of improvement areas that need work. For example noise estimator ("noise.c") does not seem to be able to keep track of the real noise level. This noise power information is later used by Kalman filters  ("kalfil.c") in estimating likelihood of keystate given the observed signals. Bayesian inference is then used in updating posterior conditional probabilities for each new path in ("probp.c"). I am getting intermittent overflows in this section of the code. Any help in this area would be very welcome.

However,  given the visible improvement in the decoding accuracy at least during certain conditions  (when you have the signal level correct, not too much noise etc.) I am now posting this for alpha testing with hopes that I could get some more eyes to look at the code and find those bugs.

Happy Holidays!

73
Mauri AG1LE  




Popular Posts