DATV: added LDPC max bit flip control and future soft LDPC control. Updated documentation

This commit is contained in:
f4exb 2021-02-27 12:51:32 +01:00
parent d39b5d793e
commit 75b08c0dee
15 changed files with 149 additions and 36 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

View File

@ -281,6 +281,8 @@ void DATVDemodGUI::displaySettings()
ui->chkHardMetric->setChecked(m_settings.m_hardMetric); ui->chkHardMetric->setChecked(m_settings.m_hardMetric);
ui->chkFastlock->setChecked(m_settings.m_fastLock); ui->chkFastlock->setChecked(m_settings.m_fastLock);
ui->chkViterbi->setChecked(m_settings.m_viterbi); ui->chkViterbi->setChecked(m_settings.m_viterbi);
ui->softLDPC->setChecked(m_settings.m_softLDPC);
ui->maxBitflips->setValue(m_settings.m_maxBitflips);
if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S) if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S)
{ {
@ -288,10 +290,15 @@ void DATVDemodGUI::displaySettings()
ui->chkHardMetric->setEnabled(true); ui->chkHardMetric->setEnabled(true);
ui->chkFastlock->setEnabled(true); ui->chkFastlock->setEnabled(true);
ui->chkViterbi->setEnabled(true); ui->chkViterbi->setEnabled(true);
ui->softLDPC->setEnabled(false);
ui->maxBitflips->setEnabled(false);
ui->chkAllowDrift->setStyleSheet("QCheckBox { color: white }"); ui->chkAllowDrift->setStyleSheet("QCheckBox { color: white }");
ui->chkHardMetric->setStyleSheet("QCheckBox { color: white }"); ui->chkHardMetric->setStyleSheet("QCheckBox { color: white }");
ui->chkFastlock->setStyleSheet("QCheckBox { color: white }"); ui->chkFastlock->setStyleSheet("QCheckBox { color: white }");
ui->chkViterbi->setStyleSheet("QCheckBox { color: white }"); ui->chkViterbi->setStyleSheet("QCheckBox { color: white }");
ui->softLDPC->setStyleSheet("QCheckBox { color: gray }");
ui->maxBitflips->setStyleSheet("QSpinBox { color: gray }");
ui->maxBitflipsLabel->setStyleSheet("QLabel { color: gray }");
} }
else else
{ {
@ -299,10 +306,15 @@ void DATVDemodGUI::displaySettings()
ui->chkHardMetric->setEnabled(false); ui->chkHardMetric->setEnabled(false);
ui->chkFastlock->setEnabled(false); ui->chkFastlock->setEnabled(false);
ui->chkViterbi->setEnabled(false); ui->chkViterbi->setEnabled(false);
ui->softLDPC->setEnabled(true);
ui->maxBitflips->setEnabled(true);
ui->chkAllowDrift->setStyleSheet("QCheckBox { color: gray }"); ui->chkAllowDrift->setStyleSheet("QCheckBox { color: gray }");
ui->chkHardMetric->setStyleSheet("QCheckBox { color: gray }"); ui->chkHardMetric->setStyleSheet("QCheckBox { color: gray }");
ui->chkFastlock->setStyleSheet("QCheckBox { color: gray }"); ui->chkFastlock->setStyleSheet("QCheckBox { color: gray }");
ui->chkViterbi->setStyleSheet("QCheckBox { color: gray }"); ui->chkViterbi->setStyleSheet("QCheckBox { color: gray }");
ui->softLDPC->setStyleSheet("QCheckBox { color: white }");
ui->maxBitflips->setStyleSheet("QSpinBox { color: white }");
ui->maxBitflipsLabel->setStyleSheet("QLabel { color: white }");
} }
if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S) { if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S) {
@ -508,10 +520,15 @@ void DATVDemodGUI::on_cmbStandard_currentIndexChanged(int index)
ui->chkHardMetric->setEnabled(true); ui->chkHardMetric->setEnabled(true);
ui->chkFastlock->setEnabled(true); ui->chkFastlock->setEnabled(true);
ui->chkViterbi->setEnabled(true); ui->chkViterbi->setEnabled(true);
ui->softLDPC->setEnabled(false);
ui->maxBitflips->setEnabled(false);
ui->chkAllowDrift->setStyleSheet("QCheckBox { color: white }"); ui->chkAllowDrift->setStyleSheet("QCheckBox { color: white }");
ui->chkHardMetric->setStyleSheet("QCheckBox { color: white }"); ui->chkHardMetric->setStyleSheet("QCheckBox { color: white }");
ui->chkFastlock->setStyleSheet("QCheckBox { color: white }"); ui->chkFastlock->setStyleSheet("QCheckBox { color: white }");
ui->chkViterbi->setStyleSheet("QCheckBox { color: white }"); ui->chkViterbi->setStyleSheet("QCheckBox { color: white }");
ui->softLDPC->setStyleSheet("QCheckBox { color: gray }");
ui->maxBitflips->setStyleSheet("QSpinBox { color: gray }");
ui->maxBitflipsLabel->setStyleSheet("QLabel { color: gray }");
} }
else else
{ {
@ -519,10 +536,15 @@ void DATVDemodGUI::on_cmbStandard_currentIndexChanged(int index)
ui->chkHardMetric->setEnabled(false); ui->chkHardMetric->setEnabled(false);
ui->chkFastlock->setEnabled(false); ui->chkFastlock->setEnabled(false);
ui->chkViterbi->setEnabled(false); ui->chkViterbi->setEnabled(false);
ui->softLDPC->setEnabled(true);
ui->maxBitflips->setEnabled(true);
ui->chkAllowDrift->setStyleSheet("QCheckBox { color: gray }"); ui->chkAllowDrift->setStyleSheet("QCheckBox { color: gray }");
ui->chkHardMetric->setStyleSheet("QCheckBox { color: gray }"); ui->chkHardMetric->setStyleSheet("QCheckBox { color: gray }");
ui->chkFastlock->setStyleSheet("QCheckBox { color: gray }"); ui->chkFastlock->setStyleSheet("QCheckBox { color: gray }");
ui->chkViterbi->setStyleSheet("QCheckBox { color: gray }"); ui->chkViterbi->setStyleSheet("QCheckBox { color: gray }");
ui->softLDPC->setStyleSheet("QCheckBox { color: white }");
ui->maxBitflips->setStyleSheet("QSpinBox { color: white }");
ui->maxBitflipsLabel->setStyleSheet("QLabel { color: white }");
} }
if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S) { if (m_settings.m_standard == DATVDemodSettings::dvb_version::DVB_S) {
@ -560,6 +582,18 @@ void DATVDemodGUI::on_cmbFEC_currentIndexChanged(const QString &arg1)
applySettings(); applySettings();
} }
void DATVDemodGUI::on_softLDPC_clicked()
{
m_settings.m_softLDPC = ui->softLDPC->isChecked();
applySettings();
}
void DATVDemodGUI::on_maxBitflips_valueChanged(int value)
{
m_settings.m_maxBitflips = value;
applySettings();
}
void DATVDemodGUI::on_chkViterbi_clicked() void DATVDemodGUI::on_chkViterbi_clicked()
{ {
m_settings.m_viterbi = ui->chkViterbi->isChecked(); m_settings.m_viterbi = ui->chkViterbi->isChecked();

View File

@ -67,6 +67,8 @@ private slots:
void on_cmbStandard_currentIndexChanged(int index); void on_cmbStandard_currentIndexChanged(int index);
void on_cmbModulation_currentIndexChanged(const QString &arg1); void on_cmbModulation_currentIndexChanged(const QString &arg1);
void on_cmbFEC_currentIndexChanged(const QString &arg1); void on_cmbFEC_currentIndexChanged(const QString &arg1);
void on_softLDPC_clicked();
void on_maxBitflips_valueChanged(int value);
void on_chkViterbi_clicked(); void on_chkViterbi_clicked();
void on_chkHardMetric_clicked(); void on_chkHardMetric_clicked();
void on_resetDefaults_clicked(); void on_resetDefaults_clicked();

View File

@ -216,7 +216,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>496</width> <width>496</width>
<height>250</height> <height>281</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
@ -225,12 +225,6 @@
<height>250</height> <height>250</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>496</width>
<height>250</height>
</size>
</property>
<property name="title"> <property name="title">
<string>DATV Settings</string> <string>DATV Settings</string>
</property> </property>
@ -286,7 +280,7 @@
<x>230</x> <x>230</x>
<y>20</y> <y>20</y>
<width>261</width> <width>261</width>
<height>221</height> <height>251</height>
</rect> </rect>
</property> </property>
<property name="frameShape"> <property name="frameShape">
@ -451,7 +445,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>120</y> <y>120</y>
<width>111</width> <width>121</width>
<height>20</height> <height>20</height>
</rect> </rect>
</property> </property>
@ -524,7 +518,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>70</x> <x>70</x>
<y>200</y> <y>230</y>
<width>181</width> <width>181</width>
<height>20</height> <height>20</height>
</rect> </rect>
@ -540,7 +534,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>180</y> <y>210</y>
<width>111</width> <width>111</width>
<height>16</height> <height>16</height>
</rect> </rect>
@ -594,7 +588,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>130</x> <x>130</x>
<y>180</y> <y>210</y>
<width>121</width> <width>121</width>
<height>16</height> <height>16</height>
</rect> </rect>
@ -610,7 +604,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>200</y> <y>230</y>
<width>61</width> <width>61</width>
<height>15</height> <height>15</height>
</rect> </rect>
@ -623,7 +617,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>150</y> <y>180</y>
<width>91</width> <width>91</width>
<height>22</height> <height>22</height>
</rect> </rect>
@ -651,7 +645,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>140</x> <x>140</x>
<y>150</y> <y>180</y>
<width>41</width> <width>41</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -673,7 +667,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>106</x> <x>106</x>
<y>150</y> <y>180</y>
<width>28</width> <width>28</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -686,7 +680,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>180</x> <x>180</x>
<y>150</y> <y>180</y>
<width>28</width> <width>28</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -699,7 +693,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>210</x> <x>210</x>
<y>150</y> <y>180</y>
<width>41</width> <width>41</width>
<height>23</height> <height>23</height>
</rect> </rect>
@ -730,13 +724,67 @@
<string>...</string> <string>...</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="softLDPC">
<property name="geometry">
<rect>
<x>10</x>
<y>150</y>
<width>111</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>Soft LDPC decoder (LDPC tool)</string>
</property>
<property name="text">
<string>SOFT LDPC</string>
</property>
</widget>
<widget class="QLabel" name="maxBitflipsLabel">
<property name="geometry">
<rect>
<x>140</x>
<y>150</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>MAX BFL</string>
</property>
</widget>
<widget class="QSpinBox" name="maxBitflips">
<property name="geometry">
<rect>
<x>200</x>
<y>150</y>
<width>51</width>
<height>20</height>
</rect>
</property>
<property name="toolTip">
<string>LDPC maximum bitflips (hard decoder)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>500</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="horizontalLayoutWidget"> <widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>10</x>
<y>310</y> <y>350</y>
<width>481</width> <width>481</width>
<height>33</height> <height>33</height>
</rect> </rect>
@ -828,16 +876,13 @@
<widget class="QWidget" name="horizontalLayoutWidget_2"> <widget class="QWidget" name="horizontalLayoutWidget_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>10</x>
<y>250</y> <y>290</y>
<width>481</width> <width>481</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="merLayout"> <layout class="QHBoxLayout" name="merLayout">
<property name="leftMargin">
<number>6</number>
</property>
<item> <item>
<widget class="QLabel" name="merLabel"> <widget class="QLabel" name="merLabel">
<property name="text"> <property name="text">
@ -891,16 +936,13 @@
<widget class="QWidget" name="horizontalLayoutWidget_3"> <widget class="QWidget" name="horizontalLayoutWidget_3">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>10</x>
<y>280</y> <y>320</y>
<width>481</width> <width>481</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="cnrLayout"> <layout class="QHBoxLayout" name="cnrLayout">
<property name="leftMargin">
<number>6</number>
</property>
<item> <item>
<widget class="QLabel" name="cnrLabel"> <widget class="QLabel" name="cnrLabel">
<property name="text"> <property name="text">

View File

@ -42,6 +42,8 @@ void DATVDemodSettings::resetToDefaults()
m_standard = DVB_S; m_standard = DVB_S;
m_modulation = BPSK; m_modulation = BPSK;
m_fec = FEC12; m_fec = FEC12;
m_softLDPC = false;
m_maxBitflips = 0;
m_symbolRate = 250000; m_symbolRate = 250000;
m_notchFilters = 0; m_notchFilters = 0;
m_allowDrift = false; m_allowDrift = false;
@ -103,6 +105,8 @@ QByteArray DATVDemodSettings::serialize() const
s.writeU32(29, m_reverseAPIPort); s.writeU32(29, m_reverseAPIPort);
s.writeU32(30, m_reverseAPIDeviceIndex); s.writeU32(30, m_reverseAPIDeviceIndex);
s.writeU32(31, m_reverseAPIChannelIndex); s.writeU32(31, m_reverseAPIChannelIndex);
s.writeBool(32, m_softLDPC);
s.writeS32(33, m_maxBitflips);
return s.final(); return s.final();
} }
@ -185,6 +189,9 @@ bool DATVDemodSettings::deserialize(const QByteArray& data)
d.readU32(31, &utmp, 0); d.readU32(31, &utmp, 0);
m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp; m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp;
d.readBool(32, &m_softLDPC, false);
d.readS32(33, &m_maxBitflips, 0);
validateSystemConfiguration(); validateSystemConfiguration();
return true; return true;
@ -209,6 +216,8 @@ void DATVDemodSettings::debug(const QString& msg) const
<< " m_rollOff: " << m_rollOff << " m_rollOff: " << m_rollOff
<< " m_viterbi: " << m_viterbi << " m_viterbi: " << m_viterbi
<< " m_fec: " << m_fec << " m_fec: " << m_fec
<< " m_softLDPC: " << m_softLDPC
<< " m_maxBitflips: " << m_maxBitflips
<< " m_modulation: " << m_modulation << " m_modulation: " << m_modulation
<< " m_standard: " << m_standard << " m_standard: " << m_standard
<< " m_notchFilters: " << m_notchFilters << " m_notchFilters: " << m_notchFilters
@ -229,6 +238,8 @@ bool DATVDemodSettings::isDifferent(const DATVDemodSettings& other)
|| (m_rollOff != other.m_rollOff) || (m_rollOff != other.m_rollOff)
|| (m_viterbi != other.m_viterbi) || (m_viterbi != other.m_viterbi)
|| (m_fec != other.m_fec) || (m_fec != other.m_fec)
|| (m_softLDPC != other.m_softLDPC)
|| (m_maxBitflips != other.m_maxBitflips)
|| (m_modulation != other.m_modulation) || (m_modulation != other.m_modulation)
|| (m_standard != other.m_standard) || (m_standard != other.m_standard)
|| (m_notchFilters != other.m_notchFilters) || (m_notchFilters != other.m_notchFilters)

View File

@ -80,6 +80,8 @@ struct DATVDemodSettings
dvb_version m_standard; dvb_version m_standard;
DATVModulation m_modulation; DATVModulation m_modulation;
DATVCodeRate m_fec; DATVCodeRate m_fec;
bool m_softLDPC;
int m_maxBitflips;
bool m_audioMute; bool m_audioMute;
QString m_audioDeviceName; QString m_audioDeviceName;
int m_symbolRate; int m_symbolRate;

View File

@ -1137,7 +1137,7 @@ void DATVDemodSink::InitDATVS2Framework()
); );
leansdr::s2_fecdec<bool, leansdr::hard_sb> *fecdec = (leansdr::s2_fecdec<bool, leansdr::hard_sb> * ) r_fecdec; leansdr::s2_fecdec<bool, leansdr::hard_sb> *fecdec = (leansdr::s2_fecdec<bool, leansdr::hard_sb> * ) r_fecdec;
fecdec->bitflips=0; fecdec->bitflips=m_settings.m_maxBitflips;
/* /*
fecdec->bitflips = cfg.ldpc_bf; //int TODO fecdec->bitflips = cfg.ldpc_bf; //int TODO
@ -1217,12 +1217,12 @@ void DATVDemodSink::feed(const SampleVector::const_iterator& begin, const Sample
if(m_settings.m_standard==DATVDemodSettings::DVB_S2) if(m_settings.m_standard==DATVDemodSettings::DVB_S2)
{ {
printf("SWITCHING TO DVBS-2\r\n"); qDebug("DATVDemodSink::feed: init DVBS-2");
InitDATVS2Framework(); InitDATVS2Framework();
} }
else else
{ {
printf("SWITCHING TO DVBS\r\n"); qDebug("DATVDemodSink::feed: init DVBS");
InitDATVFramework(); InitDATVFramework();
} }
} }

View File

@ -40,15 +40,23 @@ Power of signal received in the channel (dB)
![DATV Demodulator plugin DATV GUI](../../../doc/img/DATVDemod_pluginDATV.png) ![DATV Demodulator plugin DATV GUI](../../../doc/img/DATVDemod_pluginDATV.png)
<h4>B.3: Output transport stream to UDP</h4> <h4>B.3: MER estimation</h4>
This gauge gives the MER estimation. The averaged value appears on the right.
<h4>B.3: CNR estimation</h4>
This gauge gives the CNR estimation. The averaged value appears on the right.
<h4>B.5: Output transport stream to UDP</h4>
Activate output of transport stream to UDP with 7 TS blocks per UDP frame Activate output of transport stream to UDP with 7 TS blocks per UDP frame
<h4>B.4: UDP address</h4> <h4>B.6: UDP address</h4>
This is the address of the TS UDP This is the address of the TS UDP
<h4>B.5: UDP port</h4> <h4>B.7: UDP port</h4>
This is the port of the TS UDP This is the port of the TS UDP
@ -155,6 +163,20 @@ The mode and rate selection can be done manually but if a discrepancy in the num
The controls specific to DVB-S are disabled and greyed out. These are: Fast Lock, Allow Drift, Hard Metric and Viterbi. The controls specific to DVB-S are disabled and greyed out. These are: Fast Lock, Allow Drift, Hard Metric and Viterbi.
<h5>B.2b.6: DVB-S2 specific - Soft LDPC decoder</h5>
Not implemented yet
<h5>B.2b.7: DVB-S2 specific - LDPC maximum number of bit flips allowed</h5>
May vary between 0 and 500. On strong signals (17 dB SNR or more) you may set it to 0 thus saving processing on occasional bit flips that will not cause significant degradation. When SNR decreases you may set it to a medium value of about 200 allowing bit flips corrections to take place and decoding of signals down to about 10dB MER. A higher value towards the maximum (500) will not make a significant difference and is allowed mostly for experimentation.
If you have enough processing power it is fine to always leave it at 200.
Comparatively:
- with max = 0 you need ~15 dB MER which corresponds to ~16 dB CNR
- with max = 200 you need ~10 dB MER which corresponds to ~13 dB CNR
<h3>C: DATV video stream</h3> <h3>C: DATV video stream</h3>
![DATV Demodulator plugin video GUI](../../../doc/img/DATVDemod_pluginVideo.png) ![DATV Demodulator plugin video GUI](../../../doc/img/DATVDemod_pluginVideo.png)