diff --git a/doc/img/DATVDemod_plugin.png b/doc/img/DATVDemod_plugin.png index cd048bfb2..7fc5d75a2 100644 Binary files a/doc/img/DATVDemod_plugin.png and b/doc/img/DATVDemod_plugin.png differ diff --git a/doc/img/DATVDemod_plugin.xcf b/doc/img/DATVDemod_plugin.xcf index 966306ffa..66558097c 100644 Binary files a/doc/img/DATVDemod_plugin.xcf and b/doc/img/DATVDemod_plugin.xcf differ diff --git a/doc/img/DATVDemod_pluginDATV.png b/doc/img/DATVDemod_pluginDATV.png index 22ab56503..1d634007c 100644 Binary files a/doc/img/DATVDemod_pluginDATV.png and b/doc/img/DATVDemod_pluginDATV.png differ diff --git a/doc/img/DATVDemod_pluginDATV.xcf b/doc/img/DATVDemod_pluginDATV.xcf index a7db544bf..6bc102150 100644 Binary files a/doc/img/DATVDemod_pluginDATV.xcf and b/doc/img/DATVDemod_pluginDATV.xcf differ diff --git a/doc/img/DATVDemod_pluginDATV2.png b/doc/img/DATVDemod_pluginDATV2.png index bfb75641a..b8998b11a 100644 Binary files a/doc/img/DATVDemod_pluginDATV2.png and b/doc/img/DATVDemod_pluginDATV2.png differ diff --git a/doc/img/DATVDemod_pluginDATV2.xcf b/doc/img/DATVDemod_pluginDATV2.xcf index 9606321f7..b0c7b0c29 100644 Binary files a/doc/img/DATVDemod_pluginDATV2.xcf and b/doc/img/DATVDemod_pluginDATV2.xcf differ diff --git a/doc/img/DATVDemod_pluginDATV3.png b/doc/img/DATVDemod_pluginDATV3.png index 2c85776bb..ce4ef8389 100644 Binary files a/doc/img/DATVDemod_pluginDATV3.png and b/doc/img/DATVDemod_pluginDATV3.png differ diff --git a/doc/img/DATVDemod_pluginDATV3.xcf b/doc/img/DATVDemod_pluginDATV3.xcf index 602cf95ca..e60403488 100644 Binary files a/doc/img/DATVDemod_pluginDATV3.xcf and b/doc/img/DATVDemod_pluginDATV3.xcf differ diff --git a/plugins/channelrx/demoddatv/datvdemodgui.cpp b/plugins/channelrx/demoddatv/datvdemodgui.cpp index 89287cb56..b33f3b1c2 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.cpp +++ b/plugins/channelrx/demoddatv/datvdemodgui.cpp @@ -281,6 +281,8 @@ void DATVDemodGUI::displaySettings() ui->chkHardMetric->setChecked(m_settings.m_hardMetric); ui->chkFastlock->setChecked(m_settings.m_fastLock); 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) { @@ -288,10 +290,15 @@ void DATVDemodGUI::displaySettings() ui->chkHardMetric->setEnabled(true); ui->chkFastlock->setEnabled(true); ui->chkViterbi->setEnabled(true); + ui->softLDPC->setEnabled(false); + ui->maxBitflips->setEnabled(false); ui->chkAllowDrift->setStyleSheet("QCheckBox { color: white }"); ui->chkHardMetric->setStyleSheet("QCheckBox { color: white }"); ui->chkFastlock->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 { @@ -299,10 +306,15 @@ void DATVDemodGUI::displaySettings() ui->chkHardMetric->setEnabled(false); ui->chkFastlock->setEnabled(false); ui->chkViterbi->setEnabled(false); + ui->softLDPC->setEnabled(true); + ui->maxBitflips->setEnabled(true); ui->chkAllowDrift->setStyleSheet("QCheckBox { color: gray }"); ui->chkHardMetric->setStyleSheet("QCheckBox { color: gray }"); ui->chkFastlock->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) { @@ -508,10 +520,15 @@ void DATVDemodGUI::on_cmbStandard_currentIndexChanged(int index) ui->chkHardMetric->setEnabled(true); ui->chkFastlock->setEnabled(true); ui->chkViterbi->setEnabled(true); + ui->softLDPC->setEnabled(false); + ui->maxBitflips->setEnabled(false); ui->chkAllowDrift->setStyleSheet("QCheckBox { color: white }"); ui->chkHardMetric->setStyleSheet("QCheckBox { color: white }"); ui->chkFastlock->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 { @@ -519,10 +536,15 @@ void DATVDemodGUI::on_cmbStandard_currentIndexChanged(int index) ui->chkHardMetric->setEnabled(false); ui->chkFastlock->setEnabled(false); ui->chkViterbi->setEnabled(false); + ui->softLDPC->setEnabled(true); + ui->maxBitflips->setEnabled(true); ui->chkAllowDrift->setStyleSheet("QCheckBox { color: gray }"); ui->chkHardMetric->setStyleSheet("QCheckBox { color: gray }"); ui->chkFastlock->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) { @@ -560,6 +582,18 @@ void DATVDemodGUI::on_cmbFEC_currentIndexChanged(const QString &arg1) 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() { m_settings.m_viterbi = ui->chkViterbi->isChecked(); diff --git a/plugins/channelrx/demoddatv/datvdemodgui.h b/plugins/channelrx/demoddatv/datvdemodgui.h index bc39ea5c1..6b36646cf 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.h +++ b/plugins/channelrx/demoddatv/datvdemodgui.h @@ -67,6 +67,8 @@ private slots: void on_cmbStandard_currentIndexChanged(int index); void on_cmbModulation_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_chkHardMetric_clicked(); void on_resetDefaults_clicked(); diff --git a/plugins/channelrx/demoddatv/datvdemodgui.ui b/plugins/channelrx/demoddatv/datvdemodgui.ui index cdbc4f65e..36c4f7593 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.ui +++ b/plugins/channelrx/demoddatv/datvdemodgui.ui @@ -216,7 +216,7 @@ 0 0 496 - 250 + 281 @@ -225,12 +225,6 @@ 250 - - - 496 - 250 - - DATV Settings @@ -286,7 +280,7 @@ 230 20 261 - 221 + 251 @@ -451,7 +445,7 @@ 10 120 - 111 + 121 20 @@ -524,7 +518,7 @@ 70 - 200 + 230 181 20 @@ -540,7 +534,7 @@ 10 - 180 + 210 111 16 @@ -594,7 +588,7 @@ 130 - 180 + 210 121 16 @@ -610,7 +604,7 @@ 10 - 200 + 230 61 15 @@ -623,7 +617,7 @@ 10 - 150 + 180 91 22 @@ -651,7 +645,7 @@ 140 - 150 + 180 41 23 @@ -673,7 +667,7 @@ 106 - 150 + 180 28 23 @@ -686,7 +680,7 @@ 180 - 150 + 180 28 23 @@ -699,7 +693,7 @@ 210 - 150 + 180 41 23 @@ -730,13 +724,67 @@ ... + + + + 10 + 150 + 111 + 20 + + + + Soft LDPC decoder (LDPC tool) + + + SOFT LDPC + + + + + + 140 + 150 + 61 + 21 + + + + MAX BFL + + + + + + 200 + 150 + 51 + 20 + + + + LDPC maximum bitflips (hard decoder) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + + + 500 + + + 0 + + - 0 - 310 + 10 + 350 481 33 @@ -828,16 +876,13 @@ - 0 - 250 + 10 + 290 481 31 - - 6 - @@ -891,16 +936,13 @@ - 0 - 280 + 10 + 320 481 31 - - 6 - diff --git a/plugins/channelrx/demoddatv/datvdemodsettings.cpp b/plugins/channelrx/demoddatv/datvdemodsettings.cpp index 2246a63a5..1d0552d63 100644 --- a/plugins/channelrx/demoddatv/datvdemodsettings.cpp +++ b/plugins/channelrx/demoddatv/datvdemodsettings.cpp @@ -42,6 +42,8 @@ void DATVDemodSettings::resetToDefaults() m_standard = DVB_S; m_modulation = BPSK; m_fec = FEC12; + m_softLDPC = false; + m_maxBitflips = 0; m_symbolRate = 250000; m_notchFilters = 0; m_allowDrift = false; @@ -103,6 +105,8 @@ QByteArray DATVDemodSettings::serialize() const s.writeU32(29, m_reverseAPIPort); s.writeU32(30, m_reverseAPIDeviceIndex); s.writeU32(31, m_reverseAPIChannelIndex); + s.writeBool(32, m_softLDPC); + s.writeS32(33, m_maxBitflips); return s.final(); } @@ -185,6 +189,9 @@ bool DATVDemodSettings::deserialize(const QByteArray& data) d.readU32(31, &utmp, 0); m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp; + d.readBool(32, &m_softLDPC, false); + d.readS32(33, &m_maxBitflips, 0); + validateSystemConfiguration(); return true; @@ -209,6 +216,8 @@ void DATVDemodSettings::debug(const QString& msg) const << " m_rollOff: " << m_rollOff << " m_viterbi: " << m_viterbi << " m_fec: " << m_fec + << " m_softLDPC: " << m_softLDPC + << " m_maxBitflips: " << m_maxBitflips << " m_modulation: " << m_modulation << " m_standard: " << m_standard << " m_notchFilters: " << m_notchFilters @@ -229,6 +238,8 @@ bool DATVDemodSettings::isDifferent(const DATVDemodSettings& other) || (m_rollOff != other.m_rollOff) || (m_viterbi != other.m_viterbi) || (m_fec != other.m_fec) + || (m_softLDPC != other.m_softLDPC) + || (m_maxBitflips != other.m_maxBitflips) || (m_modulation != other.m_modulation) || (m_standard != other.m_standard) || (m_notchFilters != other.m_notchFilters) diff --git a/plugins/channelrx/demoddatv/datvdemodsettings.h b/plugins/channelrx/demoddatv/datvdemodsettings.h index 6a6e3fe61..fce8692d6 100644 --- a/plugins/channelrx/demoddatv/datvdemodsettings.h +++ b/plugins/channelrx/demoddatv/datvdemodsettings.h @@ -80,6 +80,8 @@ struct DATVDemodSettings dvb_version m_standard; DATVModulation m_modulation; DATVCodeRate m_fec; + bool m_softLDPC; + int m_maxBitflips; bool m_audioMute; QString m_audioDeviceName; int m_symbolRate; diff --git a/plugins/channelrx/demoddatv/datvdemodsink.cpp b/plugins/channelrx/demoddatv/datvdemodsink.cpp index 77b108d1f..ba25f3857 100644 --- a/plugins/channelrx/demoddatv/datvdemodsink.cpp +++ b/plugins/channelrx/demoddatv/datvdemodsink.cpp @@ -1137,7 +1137,7 @@ void DATVDemodSink::InitDATVS2Framework() ); leansdr::s2_fecdec *fecdec = (leansdr::s2_fecdec * ) r_fecdec; - fecdec->bitflips=0; + fecdec->bitflips=m_settings.m_maxBitflips; /* 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) { - printf("SWITCHING TO DVBS-2\r\n"); + qDebug("DATVDemodSink::feed: init DVBS-2"); InitDATVS2Framework(); } else { - printf("SWITCHING TO DVBS\r\n"); + qDebug("DATVDemodSink::feed: init DVBS"); InitDATVFramework(); } } diff --git a/plugins/channelrx/demoddatv/readme.md b/plugins/channelrx/demoddatv/readme.md index 402601e4d..08acd6665 100644 --- a/plugins/channelrx/demoddatv/readme.md +++ b/plugins/channelrx/demoddatv/readme.md @@ -40,15 +40,23 @@ Power of signal received in the channel (dB) ![DATV Demodulator plugin DATV GUI](../../../doc/img/DATVDemod_pluginDATV.png) -

B.3: Output transport stream to UDP

+

B.3: MER estimation

+ +This gauge gives the MER estimation. The averaged value appears on the right. + +

B.3: CNR estimation

+ +This gauge gives the CNR estimation. The averaged value appears on the right. + +

B.5: Output transport stream to UDP

Activate output of transport stream to UDP with 7 TS blocks per UDP frame -

B.4: UDP address

+

B.6: UDP address

This is the address of the TS UDP -

B.5: UDP port

+

B.7: UDP port

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. +
B.2b.6: DVB-S2 specific - Soft LDPC decoder
+ +Not implemented yet + +
B.2b.7: DVB-S2 specific - LDPC maximum number of bit flips allowed
+ +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 +

C: DATV video stream

![DATV Demodulator plugin video GUI](../../../doc/img/DATVDemod_pluginVideo.png)