RECEPTION OF DIGITAL SELECTIVE CALLING ON MF-HF
(2023)

What is Digital Selective Calling or DSC
Digital selective calling or DSC is a standard for transmitting predefined digital messages via the medium-frequency (MF), high-frequency (HF) and very-high-frequency (VHF) maritime radio systems. This program can decode DSC signals on MF and HF. Most used frequencies are 8414.5 kHz and 2187.5 kHz.


The Python program for the reception of Digital Selective Calling on MF-HF.

Simple
This program can be executed with a Raspberry Pi Version 4. It can be used with Windows and Linux!
Connect your PC to the SSB shortwave receiver. Download the file -23hfdscsource.zip- from this website and unzip all files in one directory. Execute the Python program DSCsnoop-v02a.py, if you do not know how, that is explained later.
Press the -START- button, select the desired audio input and the DSC data will be displayed.

Buttons:

-START-
Press this button to start the reception or to stop the reception.

-44100-
This is the sample rate of your audio device. If you have a slow PC, then you can also select 11025 samples/sec., that will reduce the processing power a lot! But then you need to use an audio device that supports this sample rate or you have to use downsampling software like Pulse Audio for Linux.

-400 - 2400-
This is the audio range that is scanned for usable signals. Normally it is set to 400 - 2400 Hz. But if you have some unwanted signals in the spectrum you can select other ranges. For 1500 Hz center frequency you can select 1000 - 2000 Hz or 1200 - 1800 Hz. For a 1500 Hz center frequency, you have to tune the SSB receiver 1500 Hz lower than the DSC frequency. So 8413 kHz for a 8414.5 kHz DSC frequency and 2186 kHz for a DSC frequency of 2187.5 kHz
For a 1700 Hz center frequency you can select 1400 - 2000 Hz. Selection is done by pressing the button, the range is given by the button text.

-Auto Scroll-
Normally activated, the last message is shown on the display.

-DSC log ON-
If OFF, the saving of the DSC data to the files is stopped.

-All Messages-
Almost all messages are test messages. If the reception of All Messages is disabled, the test messages are not decoded anymore.

-Test Mode-
Normally switched off. You can select Level 1 debug messages (orange button) or Level 2 debug messages (red button). But Level 2 will display much useless information.


The spectrum display

The spectrum display
The selected spectrum is displayed. The vertical red lines are the shift frequencies of the DSC signal.
At the left there is a vertical green line. It displays the audio buffer size. If your PC is too slow, it will go up and become red colored.
At the right there is also a vertical green line. It displays the audio level and will become red colored if the audio level is too high.
When a phasing signal is detected, a horizontal orange line is displayed at the bottom. If the Signal to Noise is good, the line will be small, when you have a noisy signal, it will be a wide line. It moves a little around the white marker, that is the locking routine.
And just above the orange line, there is a yellow line, that moves left - right, depending of the bit synchronization being forwards or backwards.


Configuration

Configuration
In the first lines of the Python program you can find various settings. Perhaps that you want to change some of them. Especially the DBcoast and DBship might be interesting for you if you want to choose a data base for Coast and Ship stations. It are not my data bases. They are from the excellent DSC decoder programs MultiPSK (can decode much more) and the great YADD program.
Data bases can be found at

GM4SLV : MF/HF DSC Database:
http://www.yaddnet.org/pages/php/test/mmsi_coast.php
http://www.yaddnet.org/pages/php/mmsi_shipname.php
Rename the data bases to YADDcoast.txt and YADDship.txt.

For more information abour the reception of DSC signals, visit the DSC group website: https://groups.io/g/dsc-list


The file structure

File structure
And of course we want to save the received data in files! There are directories DSCall, DSCminustest and DSCspecial. In the first directory, there is a file with all the DSC messages and that are really many during a day! The second directory contains only the DSC signals without the test messages and that are not so many. The third directory shows only special messages, only distress messages at the moment. But you can edit the Python program so that for example a special MMSI is saved in this directory!
The directory DSCday contains the daily files. They are updated every half hour and can for example be uploaded to your DSC website. You can copy a MMSI and look at the internet what kind of ship it is and where it is.
The directories DSCcoast and DSCship contain files with the Coast and Ship MMSI and how many times they have been logged in a month. The first line is January, the last line December.
And in the latest version, the directory DSCpos is added, it contains the monthly files with received ship positions.


The script that is used to start DSCHFsnoop on a Raspberry Pi

Script to start DSCHFsnoop.py on a Raspberry Pi
Make the script on the desktop and make it executable. You have to edit the script to make it suitable for your own PC of course!
Execute the script and the program starts. But... you can see that also a second program is started here! It is FTPsnoop.py! This can be used to upload files to your website with FTP. Click the link here below to see how that works:

DSC signals on 8414.5 kHz

The text files are uploaded and also converted to .htm files. But you cannot use DSCHFsnoop.py straight away, you have to edit it to set your own FTP login codes.

Downsampling
You can use the program with the Raspberry Pi version 4. The CPU percentage is approximately 25%, so it should also be possible to excecute it with a 3x slower Raspberry Pi version 3. But it might be that you have to downsample the audio stream. Before pressing Start, press the orange "44100" button and the sample rate will be reduced to 11025. Then the CPU percentage is lower than 10% on my Raspberry Pi version 4 and it should certainly be possible to excecute it with a Raspberry Pi version 3. My USB sound device supports a sample rate of 11025. It is a Behringer type UFO202 and even supports a 8000 Hz sampling rate. But if your device does not support it, you can do the downsampling with Pulseaudio. Then you have to install the "Pulse" audio platform on the Raspberry Pi. Pulse is then selected as audio input device and is used for the downsampling of the audio stream. Type the following commands in a terminal window:
sudo apt-get install pulseaudio
sudo apt-get install pavucontrol

Error handling
Every character is transmitted twice, once in the DX position and once 5 characters later in the RX position. And every byte of 10 bits is specially coded. If one bit or more bits of the same "Y" or "B" value is disturbed, it will become an invalid character. This decoder program accepts wrong RX data, but only valid characters.
To eliminate problems with fading, two zero crossings are combined ("YB" and "BY" crossings) for the bit synchronisation.



Click this link to download the ZIP file with the Python programs and other scripts



FTPsnoop.py


You have to edit the first lines with login codes of FTPsnoop.py.

FTPsnoop.py
FTPsnoop.py is started after DSCHFsnoop.py. Every 30 minutes, DSCHFsnoop.py updates the daily text files with DSC messages in the DSCday directory. It saves the file names in the file FTPuploads.txt. FTPsnoop.py checks if this file exists. If it exists, it will upload the files to your FTP site. If you have set HTMLupload=True, then the text files are converted to HTML files and uploaded.


Simple direct conversion receiver that was used to receive the DSC messages on 8414.5 kHz


SOFTWARE

Before you are using this program, you have to install Python. That is very simple. But read first something about Python by clicking the following link:

WHAT IS PYTHON AND HOW DO YOU INSTALL PYTHON

As the source code of Python is written in ASCII, it is very simple to modify the program to you own requirements. Think for example about the size of the screen, the colors etc.

Required Python version:

Required external modules (site-packages for the correct Python version!):


Click this link to download the ZIP file with the Python programs and other scripts



Index PA2OHH