Skip to content

Commit

Permalink
added threshold selector for tii detection
Browse files Browse the repository at this point in the history
  • Loading branch information
JvanKatwijk committed Oct 11, 2024
1 parent 578445b commit 3e618f6
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 34 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ About Qt-DAB-6.X
-------------------------------------------------------------------------

*Qt-DAB* is software for Linux, Windows, MacOS and Raspberry Pi for listening to terrestrial **Digital Audio Broadcasting (DAB and DAB+)**.
Qt-DAB is continuously under further development, **Qt-DAB-6.X** ,
the stable version of Qt-DAB has - again some new features, not often seen
elsewehere. A good quote indicating what I try to achieve in the continuous development of Qt-DAB software is:

**Qt-DAB-6.X** is the stable version of Qt-DAB, i.e. a version with
a Windows installer (actually, there are three) and a Linux x64 AppImage.
* *It is much easier to add features to reliable software, than it is to add reliability to featureful software.*

Of course, as for previous versions, for *Qt-DAB-6.X*
a Windows installer (actually, there are three) and a Linux x64 AppImage
are available.

![6.5](/Qt_DAB-6.X-1.png?raw=true)
![6.5](/Qt_DAB-6.X-2.png?raw=true)
Expand Down
Binary file modified configuration-and-control.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/manual-6.pdf
Binary file not shown.
64 changes: 39 additions & 25 deletions qt-dab-RC/forms-v7/config-helper.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>544</width>
<height>435</height>
<width>511</width>
<height>407</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -18,7 +18,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
Expand Down Expand Up @@ -70,38 +70,52 @@
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="smallPushButton" name="fontButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The font for displaying the servicenames in the ensemble display can be set here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>font</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="smallPushButton" name="fontButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The font for displaying the servicenames in the ensemble display can be set here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>font</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="fontSizeSelector">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The font size of the service lists (both the ensemble view and the favorites view) can be set.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>15</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QSpinBox" name="fontSizeSelector">
<widget class="smallPushButton" name="fontColorButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The font size of the service lists (both the ensemble view and the favorites view) can be set.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>8</number>
</property>
<property name="maximum">
<number>15</number>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The color used to display the servicenames in the ensemblewidget can be selected here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="value">
<number>10</number>
<property name="text">
<string>font color</string>
</property>
</widget>
</item>
<item>
<widget class="smallPushButton" name="fontColorButton">
<widget class="QSpinBox" name="tiiThreshold_setter">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The color used to display the servicenames in the ensemblewidget can be selected here.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;tii threadhold. The tii threshold is used in the detection of tii values in the NULL periods of the DAB frames. Of course, the lower the value, the more chance there is to get false posivides.&lt;/p&gt;&lt;p&gt;Default value is 4.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>font color</string>
<property name="value">
<number>4</number>
</property>
</widget>
</item>
Expand Down
4 changes: 2 additions & 2 deletions qt-dab-RC/radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ QString h;
}

if (streams. size () > 0) {
for (auto s: streams)
fprintf (stderr, "%s\n", s. toLatin1 (). data ());
for (auto s: streams)
fprintf (stderr, "%s\n", s. toLatin1 (). data ());
configHandler_p -> fill_streamTable (streams);
configHandler_p -> show_streamSelector (true);
k = configHandler_p -> init_streamTable (temp);
Expand Down
1 change: 0 additions & 1 deletion qt-dab-RC/radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ private slots:
void handle_httpButton ();
void setVolume (int);
void handle_snrLabel ();

//
// color handlers
void handle_labelColor ();
Expand Down
8 changes: 8 additions & 0 deletions qt-dab-RC/support/config-handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ static struct {
#else
this -> decoderSelector -> setEnabled (false);
#endif

int v = dabSettings -> value ("tiiThreshold", 4). toInt ();
this -> tiiThreshold_setter -> setValue (v);
connect (tiiThreshold_setter, qOverload<int>(&QSpinBox::valueChanged),
this, &configHandler::handle_tiiThreshold);
set_Colors ();
}

Expand Down Expand Up @@ -874,4 +879,7 @@ bool configHandler::get_dxSelector () {
return dxSelector -> isChecked ();
}

void configHandler::handle_tiiThreshold (int t) {
dabSettings -> setValue ("tiiThreshold", t);
}

1 change: 1 addition & 0 deletions qt-dab-RC/support/config-handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ private slots:
void handle_saveSlides (int);
void handle_decoderSelector (const QString &s);
void handle_saveTransmittersSelector (int);
void handle_tiiThreshold (int);

signals:
void selectDecoder (int);
Expand Down
8 changes: 4 additions & 4 deletions src/ofdm/tii-detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ uint8_t table [] = {

TII_Detector::TII_Detector (uint8_t dabMode,
QSettings *dabSettings,
int16_t depth):
int16_t depth):
params (dabMode),
T_u (params. get_T_u ()),
carriers (params. get_carriers ()),
Expand All @@ -140,7 +140,6 @@ void TII_Detector::setMode (bool b) {
detectMode_new = b;
}


void TII_Detector::reset () {
for (int i = 0; i < T_u; i ++)
theBuffer [i] = Complex (0, 0);
Expand Down Expand Up @@ -195,8 +194,6 @@ int D_table [GROUPSIZE]; // count of indices in C_table with data
float avgTable [NUM_GROUPS];
std::vector<int16_t> theResult;

int tiiThreshold
= dabSettings -> value ("tii-threashold", 4). toInt ();
// we map the "carriers" carriers (complex values) onto
// a collapsed vector of "carriers / 8" length,
// considered to consist of 8 segments of 24 values
Expand All @@ -209,6 +206,8 @@ std::vector<int16_t> theResult;
// may differ, we compute an average for each of the
// NUM_GROUPS GROUPSIZE - value groups.

int tiiThreshold =
dabSettings -> value ("tiiThreshold", 4). toInt ();
while (true) {
memset (avgTable, 0, NUM_GROUPS * sizeof (float));

Expand Down Expand Up @@ -253,6 +252,7 @@ std::vector<int16_t> theResult;

for (int j = 0; j < GROUPSIZE; j ++) {
if ((D_table [j] >= 4) && (C_table [j] > maxTable)) {
// if ((D_table [j] >= 4) && (C_table [j] > maxTable)) {
maxTable = C_table [j];
maxIndex = j;
break;
Expand Down

0 comments on commit 3e618f6

Please sign in to comment.