DAB and DAB software: Qt-DAB and friends

dabradio

A note on DAB

DAB, Digital Audio Broadcasting, is the system of choice for digital radio in Europe and Australia. Different from e.g. FM, a transmission contains a (large) number of services, each service being an audio service, a data service or a combination of thoese. The bandwidth taken by a DAB transmission is app 1.5 MHz, and transmissions take place in the former Band III for terrestrial TV, i.e. in the range from 174 .. 230 MHz. In this band, there is room for 39 channels.

DAB is usually transmitted in a Single Frequency Network (SFN), meaning that within a region more than one transmitter transmits the same signal. The advantage is that each of the transmitters is (far) lower power than a single FM transmitter would need to cover a large area. Other than with FM, where interference of transmitters on the same frequency should be avoided, with DAB the receiver can select the strongest signal and just decode that.

The Qt-DAB program

Introduction

Qt-DAB is (being) developed as a DAB decoder, a decoder for use with an SDR device. The program evolved, many people gave feedback and suggestions for extension, and as a result Qt-DAB is kind of a swiss army knife w.r.t. receiving and decoding DAB. It provides an easy interface for connecting other SDR devices, it supports scanning the band, scheduling an operation, setting colors on the widget, muting the audio, saving the audio, showing transmitters received, etc etc.

The services of the ensemble in the currently selected channel are displayed. However, since most people have a number of preferred services, spread over different ensembles in different channels, Qt-DAB supports presets. The order in which the services are presented can be selected in the configuration and control widget.

Apart from the presets, Qt-DAB maintains a list of all services in all ensembles ever found (luckily enough, the list can be cleared). The list tends to be quite long, and - especially when moving around - contains in the end services that are unreachable.

dabradio

Most controls are now moved to the configuration and control widget.

Data of the service(s)

Qt-DAB obviously provides a description of the currently selected service which can be shown if asked for. The widget contains a number of obvious elements, i.e. length of the segments, etc, but also the datarate, which obviouly is important for the sound quality.

For DAB+ audio services, the widget shows three quality indicators, if there are all 100 percent, then audio decoding is fully correct. (As a gadget, the number of (corrected) errors in the Reed-Solomon decoder is presented as well, gives also an indication of the quality of the reception).

dabradio

dabradio

Since an ensemble contains more than just the selected service, Qt-DAB offers a "content" description, an overview of (technical) details of all services within the currently active ensemble. Touching the content button will show a widget with a description of the content of the current ensemble.

dabradio

The configuration widget contains a selector for saving the s-called dynamic labels, i.e. the text component as it appears on the widget.

Scheduling

Qt-DAB supports scheduling where the scheduled time can be to up to one week (of course Qt-DAB should run at the time of the schedule). Schedule options are - next to selecting a service at a given time within the forthcoming week - recording the then selected audio in either a PCM (i.e. ".wav") file ( audiodump) or an AAC file ( framedump), but also saving the dynamic label text in a file dlText, quitting the program, and - a special one - recording the FIC frames into a file.

dabradio

Looking at the spectrum

One of my own interests is the DAB signal. When looking at a spectrum, it is usually very clear whether or not a signal is a DAB signal and even whether or not it is a reasonable DAB signal. The widget for the spectrum shows more, it shows next to the spectrum the constellation of the decoded signal. Since DAB is encoded using two dimensional numbers, the decoded signal can be visualized easily: the picture shows an ideal signal vs a signal normally seen.

dabradio dabradio

The "ideal" signal shows the ideal constellation of the decoded signal, it is easy to see that each quadrant corresponds with 2 bits. The bottom line of the regular widget (right) contains sone numbers, quality indicators of the signal. See the manual for a description.

Transmitter information and DX-ing

As said, DAB is - usually - transmitted in a Single Frequency Network. Each transmitter in such a network transmits an identification code as part of the signal. This TII Transmitter Identification Information data can be made visible, Qt-DAB will show the signal and its decoding if asked for.

dabradio

The picture shows the spectrum of the null part of the DAB frame in which this TII data is encoded. The picture shows 4 groups of 4 elements, the elements forming a 4 out of 8 code. Decoding this data shows the transmitters (0104 and 0103) which makes sense since these are close to where I live.

A database exists, maintained by FMList that contains a list of transmitters worldwide, for each transmitter a.o. a name, a location and the TII data for that transmitter. Thanks to FMList Qt-DAB allows loading and using a copy of the database, with which the name of the transmitter can be shown, together with the distance from the receiving Qt-DAB program and the azimuth. This feature obviously only works when handling the database is part of the configuration.

dabradio

Of course, to be able to compute the distance and the azimuth, the software has to "know" the home position. The home position can be specified in the configuration widet. Obviously, if no location is specified or no database is loaded, no positions will be givem.

Given the name, the distance and the azimuth of the transmitter, for DX-ing it would be helpful to actually see the transmitter(s) on a map. The most recent version of Qt-DAB therefore is equipped with a simple server, that can be used to drive a webbrowser. The main widget of Qt-DAB contains a button, labelled http, when touched will start/stop the server. By default starting the server will invoke a webbrowser, the configuration has a selector for starting the browser manually.

dabradio

The column on the right shows the names of the transmitters found as well as their coordinates. The transmitter with the largest distance to the "home" is mentioned separately as is the transmitter that was last touched on the screen.

Looking at the SNR

Another - at least for me - interesting thing is the SNR, the Signal to Noise ratio. Since DAB signal is - in the time domain - special, a segment with an amplitude of (almost) zero and a much larger segment with a decent signal amplitude, computing the SNR is obvious: look at the two components. Qt-DAB will show a widget with the development over time of the SNR if asked for.

dabradio dabradio

The SNR widget gives a view of the development of the SNR over time, especially when experimenting with antenna's.

Scanning

DX-ers want to scan over all - or a selected set - channels. While originally a separate DAB scanner was developed, the functionality was later on built in within the Qt-DAB program.

Qt-DAB supports three scan-"modes",

  1. a scan over the channels in the band that stops whenever a channel with DAB data is encountered;

  2. a single scan over the channels in the selected band. In this mode a record - similar to the content description seen above - is written out;

  3. a continuous scan over the channels in the selected band. In this mode a single line is written for each channel containing DAB data.

  4. The scan mode can be set in the configuration widget. A fragment of the scanoutput of a continious scan is show in the picture.

    dabradio

    Usually it is well known which channels might and which channels will not contain DAB data, already in the dab scanner a provision was made to indicate which channels are to be skipped during the scan. An extra feature provided by QT-DAB is that a user might use different "skip-tables", e.g. one for scanning to the east, and another for scanning to the west.

    The configuration widget contains selectors for setting, defining or modifying skip tables.

    Other DAB software

    While Qt-DAB is the most complete DAB decoder, during the process some other DAB related programs were developed as well:

    1. dabMini as the simple dab decoder for just selecting a service, built from the same set of sources as Qt-DAB;

    2. dab-cmdline as a library providing the functionality for decoding DAB accompanied with a number of example programs showing how to use it to create a command line based program as DAB decoder. The repository, containing the sources and a description how to use is here .

    3. webDAB, a DAB server with a minimal WEB client , sources are here

    4. eti-stuff as a simple program to generate ETI output from a received DAB transmission. The sources can be found here .

    5. channel-scanner as a simple command line driven program to (continuously) scan over specified channels, report on the contents of these channels and - if as option selected - record a number of seconds of the incoming data into a file. The sources can be found here .

    Of course these programs take their input from any of a selection of SDR devices, depending on the configuration. The devices that can be included in the configuration are the devices I have (access to). To make life easy, for Qt-DAB and dabMini an appImage is available for running under x86_64 Linux and and installer is available for installing and running under Windows. For the others, one has to create an executable.

    Sources are - obviously - also available, see the repositories on github ("https://github.com/JvanKatwijk/").

    A DAB library

    To provide some flexibility, the functionality for DAB decoding, is also implemented in a separate library. The library can be build as a dynamic load library, or alternatively, the sources of the library can be included in a program. The use of the library is shown in a number of example programs.

    The library contains just a few functions

    	void DAB_API    *dabInit   (deviceHandler       *,
                                API_struct          *,
                                RingBuffer> *spectrumBuffer,
                                RingBuffer> *iqBuffer,
                                void                *userData);
    
    	void DAB_API    dabExit         (void *);
    	void DAB_API    dabStartProcessing (void *);
    	void DAB_API	dabReset	(void *);
    	void DAB_API	dabStop		(void *);
    	void DAB_API	dabReset_msc		(void *);
    	void DAB_API	dataforAudioService	(void *, const char *, audiodata *, int);
    	void DAB_API	set_audioChannel	(void *, audiodata *);
    

    The library sends data back, using callback functions, passed on in the API\_struct. The ringbuffers passed as parameter - if not specified to be null - are used to pass spectrum data and data to make the constellation of the decoded signal visible.

    The most common example can be configured with any of SDRplay, AIRspy, dabsticks, LimeSDR, Hackrf, Adalm Pluto or file input. The resulting program is then command line based, e.g.

          dab-sdrplay-2 -M 1 -B "BAND III" -C 12C -P "Radio 4" -G 80 -A default
    

    The line shows the invocation of example 2, configured with the SDRplay as SDR device, selecting Mode 1 (which is default), Band III (which is default), channel 12C, service "Radio 4", setting the gain to 80 (range 0 .. 100), and sound device is default.

    Based on user requests, an additional example was created that binds a main program written in Python to a (special, binary version of the) library.

    DAB server and WEB client

    I sometimes run a DAB decoder on a simple (headless) RPI 3, controlling it from my laptop. I was figuring out a way to have the decoder run disconnected from my laptop, allowing establishing a connection when I wanted to adapt a setting (such as selecting another channel or service). Connection preferably from any laptop or tablet that I am using, so a WEB interface seemed logical. The result is webDAB, a small server with a minimal interface, an interface when a channel can be set, a service can be selected, gain for the device can be set and audio gain can be controlled.

    Currently, the DAB server can be configured to run with the SDRplay and RT2832 based DAB sticks. Interfacing to any of the other devices for which dab-cmdline provides an interface is (almost) trivial.