MORSE Decoder User Manual

  1. Introduction
  2. Features
  3. Operation
  4. Bugs and annoyances
  5. Copying

1. Introduction
The Morse code decoder is a Receive-only Guest mode for the lhpsdr HPSDR client. The Decoder detects the "dihs" and "dahs" that make a Morse code character from the 48kHz audio output samples stream of the CW Demodulator. The samples stream is processed by a Goertzel tone detector algorithm which produces "mark" or "space" (signal/no signal) outputs and the resulting stream of Morse code "elements" is decoded into an ASCII character for printing to the Text viewer.

2. Features

Goertzel tone detector
The Morse Decoder was designed from the beginning to be simple and efficient, decoding Morse code using mostly integer arithmetic and simple processing methods. It uses an integer-arithmetic Goertzel tone detector algorithm, which measures the level of sound signals from the CW Demodulator's output. This Goertzel tone detector is centered on the BFO frequency selected by the user, usually 600 Hz.

The Mark/Space (key-down - key-up) condition is detected by saving the output of the Goertzel tone detector into a ring buffer, for a period of two Morse code Unit Elements, e.g. for the duration of two "dits". The change from Mark (tone) to Space (no tone) and vice-versa, is decided by summing the saved tone detector outputs, over one Unit Element, into a "leading edge" sum and then summing the following outputs into a "trailing edge" sum, again over one Unit Element. The ratio of the leading edge to the trailing edge sums rises and falls, depending on whether the leading edge or trailing edge sum is the sum of Mark tone or Space tone outputs from the Goertzel detector. This ratio is compared to a reference threshold to determine the Mark or Space condition of the tone from the Receiver. The sum of the leading and trailing edge sums is also used as an indication of signal strength and is used as a kind of "squelch" to minimize spurious character decodes.

Error and noise tolerance
The Decoder has a certain level of tolerance towards operator errors (bad "fist") regarding deviation from the standard duration of the various elements that make up the Morse code. Below is a table of the basic Morse code elements and the range of duration that the Decoder can deal with:

   Morse Element           Duration       Decoder
-------------------------------------------------
       dit                  1 units   1/2-2 units
       dah                  3 units     2-4 units
Inter-elem space            1 units   1/2-2 units
Inter-char space            3 units     2-4 units
Inter-word space          > 5 units     > 4 units

The Morse code characters, punctuation marks and special signals that the Decoder can currently recognize are in the file doc//morse/Morsecode.txt. Extra characters etc can be added to the collection by inserting the hex equivalent of the decoded Morse code character in the decode.c source file before compilation. Please see detailed explanation in that file.

"Waterfall" display with CAT
The Decoder has an FFT-derived "Waterfall" (audio spectrum) display derived from the integer FFT function (IFFT) in lhpsdr. A vertical white line indicates the center frequency of the tone detector. When tuning a signal manually, its trace should be centered on this line for best results.

The Decoder has a limited CAT capability via the Waterfall display in its window. A CW signal can be tuned in by clicking with the left mouse button near its trace in the watefall. The CAT function will scan a small section of the display either side of the mouse pointer, looking for the strongest trace and then tune the receiver so that the signal is centered on the center line.

5. Operation
Before running the Decoder, you may want to customize some settings in the ~/.lhpsdr/morse/morse.config configuration file. There are just three settings, the maximum, minimum and default keying speeds to use. Normally these are max 40wpm, min 10wpm and default 20wpm.

By default the Decoder starts with Morse code speed set to 20 wpm and the detector thresholds set at 50 for the Level ("squelch") and at 2.0 for the Ratio (mark/space detector). These are shown in the three spin-wheel widgets at the right of the scope window. As the Decoder begins to decode Morse coded signals, it estimates the sending speed and adapts to it, indicating the actual speed in the 'Speed' spin-wheel, if the "Auto" check button is enabled. If the Morse transmission is a lot faster or slower than the indicated speed, it may not be decoded correctly and manual changing of the speed setting will be needed to fix the problem. Auto adaptation to incoming Morse speed can be disabled with the "Auto" check button.

Please note that the 'scope' display of the Decoder has three functions, it can display the input signal waveform, the output from the Mark/Space (signal/no-signal) Ratio detector or the Level (squelch) value. The first function is the default and this and the other displays can be selected from the four radio buttons at the right of the Scope display.

Generally the Decoder has a fairly wide tolerance of sending errors (bad fists or noise) but in practice it has proved to be difficult to correctly decode CW signals on the amateur bands, with the main problem appearing to be bad keying habits. Sometimes inter character spacing is too small so two or more characters are taken as one and therefore cannot be decoded correctly. Characters not recognized by the Decoder are indicated by an asterisk * on the screen. Word spacing also seems to be inconsistent with many hams resulting in fragmented or fused words.

Finally a list of all characters, punctuation marks and special signals recognized by the Decoder are listed in the doc/morse/Morsecode.txt file. Additional characters can be entered in two tables in the decode.c source file before compilation, following the instructions in there.

6. Bugs and annoyances

The Morse code decoding algorithm may need further improvements to make it more tolerant to errors and noise and the mark/space detection process may need to be improved to reduce spurious output due to noise interference.

8. Copying This software package is released under the GNU Public License. Please see the COPYING file for more details.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:

August 16 2002.