From 9812ed3a2666bd50cf9009861028043a584e1ce4 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Sun, 11 Oct 2026 13:58:11 +0100 Subject: [PATCH] Add 1.7MHz and 10MHz DVB-T2 --- plugins/channelrx/demoddvb/dvbdemodbaseband.cpp | 2 +- plugins/channelrx/demoddvb/dvbdemodgui.cpp | 12 ++++++------ plugins/channelrx/demoddvb/dvbdemodgui.h | 2 +- plugins/channelrx/demoddvb/dvbdemodgui.ui | 17 ++++++++++++++++- plugins/channelrx/demoddvb/dvbdemodsettings.cpp | 12 ++++++++++-- plugins/channelrx/demoddvb/dvbdemodsettings.h | 15 +++++++++++++-- plugins/channelrx/demoddvb/dvbdemodsink.cpp | 12 +++++++----- plugins/channelrx/demoddvb/readme.md | 5 ++++- plugins/feature/mcpserver/bandguide.md | 4 ++-- 9 files changed, 60 insertions(+), 21 deletions(-) diff --git a/plugins/channelrx/demoddvb/dvbdemodbaseband.cpp b/plugins/channelrx/demoddvb/dvbdemodbaseband.cpp index 1e28c66a2..dbb3c51e2 100644 --- a/plugins/channelrx/demoddvb/dvbdemodbaseband.cpp +++ b/plugins/channelrx/demoddvb/dvbdemodbaseband.cpp @@ -256,7 +256,7 @@ void DVBDemodBaseband::setChannelization() // The symbol rate automatic: all the baseband, as it's not known how wide the signal is int sampleRate = DVBDemodSettings::isSatellite(m_settings.m_standard) ? (m_settings.m_symbolRate > 0 ? 2 * m_settings.m_symbolRate : m_channelizer->getBasebandSampleRate()) - : (int) std::round(dvbt::sampleRate(m_settings.m_bandwidth)); + : (int) std::round(DVBDemodSettings::terrestrialSampleRate(m_settings.m_bandwidth)); if (sampleRate <= 0) { return; // The baseband's rate isn't known yet diff --git a/plugins/channelrx/demoddvb/dvbdemodgui.cpp b/plugins/channelrx/demoddvb/dvbdemodgui.cpp index 64622258b..a00dfdf36 100644 --- a/plugins/channelrx/demoddvb/dvbdemodgui.cpp +++ b/plugins/channelrx/demoddvb/dvbdemodgui.cpp @@ -17,6 +17,7 @@ /////////////////////////////////////////////////////////////////////////////////// #include +#include #include #include @@ -69,7 +70,7 @@ #include #endif -const int DVBDemodGUI::m_bandwidths[3] = {8000000, 7000000, 6000000}; +const int DVBDemodGUI::m_bandwidths[6] = {10000000, 8000000, 7000000, 6000000, 5000000, 1700000}; // As the list DVBDemodGUI* DVBDemodGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) { @@ -183,7 +184,7 @@ void DVBDemodGUI::on_deltaFrequency_changed(qint64 value) void DVBDemodGUI::on_bandwidth_currentIndexChanged(int index) { - if ((index < 0) || (index > 2)) { + if ((index < 0) || (index >= (int) std::size(m_bandwidths))) { return; } @@ -1670,7 +1671,7 @@ void DVBDemodGUI::displaySettings() ui->deltaFrequency->setValue(m_settings.m_inputFrequencyOffset); int bandwidthIndex = 0; - for (int i = 0; i < 3; i++) + for (int i = 0; i < (int) std::size(m_bandwidths); i++) { if (m_bandwidths[i] == m_settings.m_bandwidth) { bandwidthIndex = i; @@ -2171,8 +2172,7 @@ void DVBDemodGUI::displayStatus() // The channel marker shows the occupied bandwidth: 7.61 MHz in 8, or 7.77 MHz for DVB-T2's extended carrier mode, or // (1 + roll-off) times the symbol rate const bool extended = (status.m_standard == 2) && status.m_t2.m_l1Valid && status.m_t2.m_pre.m_bwtExt; - const int markerBandwidth = DVBDemodSettings::isSatellite(m_settings.m_standard) ? m_settings.occupiedBandwidth(std::max(0.0, status.m_autoSymbolRate)) - : (int) (m_settings.m_bandwidth * (extended ? 0.9714 : 0.951)); + const int markerBandwidth = m_settings.occupiedBandwidth(std::max(0.0, status.m_autoSymbolRate), extended); if (markerBandwidth != m_channelMarker.getBandwidth()) { m_channelMarker.setBandwidth(markerBandwidth); @@ -2257,7 +2257,7 @@ void DVBDemodGUI::displayStatus() void DVBDemodGUI::displayScopeExtras(const DVBDemodSink::Status& status, double mer, double iterations, uint64_t errors) { ui->scope->setImpulseResponse(status.m_impulseDb, status.m_impulseResolution, status.m_impulseGuard, - dvbt::sampleRate(m_settings.m_bandwidth)); + DVBDemodSettings::terrestrialSampleRate(m_settings.m_bandwidth)); const bool sameCount = (status.m_standard == m_lastErrorStandard) && (errors >= m_lastErrorCount); const int newErrors = sameCount ? (int) std::min(errors - m_lastErrorCount, 1000000) : 0; m_lastErrorCount = errors; diff --git a/plugins/channelrx/demoddvb/dvbdemodgui.h b/plugins/channelrx/demoddvb/dvbdemodgui.h index d66b56c39..7ac9acd20 100644 --- a/plugins/channelrx/demoddvb/dvbdemodgui.h +++ b/plugins/channelrx/demoddvb/dvbdemodgui.h @@ -78,7 +78,7 @@ public slots: void channelMarkerHighlightedByCursor(); private: - static const int m_bandwidths[3]; + static const int m_bandwidths[6]; //! EN 300 468's polarisations static QString polarisationName(int polarisation); diff --git a/plugins/channelrx/demoddvb/dvbdemodgui.ui b/plugins/channelrx/demoddvb/dvbdemodgui.ui index 1395d3a6e..b410da2b4 100644 --- a/plugins/channelrx/demoddvb/dvbdemodgui.ui +++ b/plugins/channelrx/demoddvb/dvbdemodgui.ui @@ -174,8 +174,13 @@ - Channel bandwidth. The channel sample rate is best at 8/7 times this, e.g. 64/7 MS/s for 8 MHz. Other rates are resampled + Channel bandwidth. The channel sample rate is best at 8/7 times this, e.g. 64/7 MS/s for 8 MHz (131/71 MS/s for 1.7 MHz). 10 and 1.7 MHz are DVB-T2's alone. Other rates are resampled + + + 10 MHz + + 8 MHz @@ -191,6 +196,16 @@ 6 MHz + + + 5 MHz + + + + + 1.7 MHz + + diff --git a/plugins/channelrx/demoddvb/dvbdemodsettings.cpp b/plugins/channelrx/demoddvb/dvbdemodsettings.cpp index 00f0ea0de..7ac582a98 100644 --- a/plugins/channelrx/demoddvb/dvbdemodsettings.cpp +++ b/plugins/channelrx/demoddvb/dvbdemodsettings.cpp @@ -24,6 +24,8 @@ #include "util/simpleserializer.h" #include "settings/serializable.h" +#include "modemdvb/dvbt2.h" + #include "dvbdemodsettings.h" QByteArray DVBDemodSettings::serializeSchedule(const QList& schedule) @@ -185,13 +187,19 @@ void DVBDemodSettings::resetToDefaults() m_scanTo = 0; } -int DVBDemodSettings::occupiedBandwidth(double symbolRate) const +double DVBDemodSettings::terrestrialSampleRate(int bandwidth) +{ + return dvbt2::sampleRate(bandwidth); +} + +int DVBDemodSettings::occupiedBandwidth(double symbolRate, bool extended) const { if (isSatellite(m_standard)) { return (int) ((m_symbolRate > 0 ? m_symbolRate : symbolRate) * (1.0 + (m_rollOff > 0 ? m_rollOff : 35) / 100.0)); } - return (int) (m_bandwidth * 0.951); // 7.61 MHz in 8 + // The carriers of 8K's 8192 (6817, or 6913 extended): the same share of the sample rate in every FFT size + return (int) (terrestrialSampleRate(m_bandwidth) * (extended ? 6913.0 : 6817.0) / 8192.0); } QByteArray DVBDemodSettings::serialize() const diff --git a/plugins/channelrx/demoddvb/dvbdemodsettings.h b/plugins/channelrx/demoddvb/dvbdemodsettings.h index 3df2f5f1d..dace36d68 100644 --- a/plugins/channelrx/demoddvb/dvbdemodsettings.h +++ b/plugins/channelrx/demoddvb/dvbdemodsettings.h @@ -155,7 +155,16 @@ struct DVBDemodSettings static QByteArray serializeSchedule(const QList& schedule); static QByteArray serializeSeries(const QList& series); static QList deserializeSeries(const QByteArray& data); - static bool isValidBandwidth(int bandwidth) { return (bandwidth == 8000000) || (bandwidth == 7000000) || (bandwidth == 6000000); } + //! DVB-T's 5 to 8 MHz (5 MHz in EN 300 744 annex G), and DVB-T2's 1.7 MHz (as used for T2-Lite) and 10 MHz (for + //! professional use) too + static bool isValidBandwidth(int bandwidth) { + return (bandwidth == 10000000) || (bandwidth == 8000000) || (bandwidth == 7000000) || (bandwidth == 6000000) + || (bandwidth == 5000000) || (bandwidth == 1700000); + } + static bool hasDVBT(int bandwidth) { return (bandwidth != 1700000) && (bandwidth != 10000000); } + //! The terrestrial receivers' sample rate for a bandwidth: 8/7 times it, but 131/71 MS/s for 1.7 MHz (EN 302 755 + //! table 65) + static double terrestrialSampleRate(int bandwidth); static bool isValidStandard(int standard) { return (standard >= StandardAutoTerrestrial) && (standard <= StandardDVBS2); } static bool isSatellite(int standard) { return standard >= StandardAutoSatellite; } //! 0 for automatic (measured from the signal) @@ -175,7 +184,9 @@ struct DVBDemodSettings static bool isValidFreesatRegion(int region) { return (region >= 0) && (region <= 65535); } //! The channel's bandwidth: the terrestrial channel's, or (1 + roll-off) times the symbol rate //! Of the symbol rate set, or symbolRate (as found, when automatic): 0 if neither's known - int occupiedBandwidth(double symbolRate = 0.0) const; + //! Of the signal: the symbol rate times 1 + roll-off, or the terrestrial carriers' span (7.61 MHz in 8 MHz, 7.77 MHz + //! in DVB-T2's extended carrier mode) + int occupiedBandwidth(double symbolRate = 0.0, bool extended = false) const; static bool isValidEPGReport(int epgReport) { return (epgReport >= 0) && (epgReport <= 2); } static QList deserializeSchedule(const QByteArray& data); }; diff --git a/plugins/channelrx/demoddvb/dvbdemodsink.cpp b/plugins/channelrx/demoddvb/dvbdemodsink.cpp index 9725ea5c2..ea82921fd 100644 --- a/plugins/channelrx/demoddvb/dvbdemodsink.cpp +++ b/plugins/channelrx/demoddvb/dvbdemodsink.cpp @@ -50,7 +50,7 @@ DVBDemodSink::Status::Status() : QString DVBDemodSink::Status::stateText(int bandwidth) const { if (!m_sampleRateOK) { - return QString("Needs %1 MS/s+").arg((m_requiredRate > 0.0 ? m_requiredRate : m_minRateRatio * dvbt::sampleRate(bandwidth)) / 1e6, 0, 'f', 2); + return QString("Needs %1 MS/s+").arg((m_requiredRate > 0.0 ? m_requiredRate : m_minRateRatio * S::terrestrialSampleRate(bandwidth)) / 1e6, 0, 'f', 2); } if (isSatellite() && (m_autoSymbolRate < 0.0)) { @@ -517,10 +517,12 @@ void DVBDemodSink::processBuffer() return; } - // Automatically, both receivers search until one locks, then only it runs, until it has lost lock for a while + // Automatically, both receivers search until one locks, then only it runs, until it has lost lock for a while. + // DVB-T has no 1.7 MHz channels: DVB-T2's alone then const int standard = m_settings.m_standard; const bool autoStandard = standard == S::StandardAutoTerrestrial; - const bool feedT = (standard == S::StandardDVBT) || (autoStandard && (m_active != S::StandardDVBT2)); + const bool feedT = S::hasDVBT(m_settings.m_bandwidth) + && ((standard == S::StandardDVBT) || (autoStandard && (m_active != S::StandardDVBT2))); const bool feedT2 = (standard == S::StandardDVBT2) || (standard == S::StandardDVBT2Lite) || (autoStandard && (m_active != S::StandardDVBT)); dvbt::Receiver::Status tStatus; dvbt2::Receiver::Status t2Status; @@ -1287,8 +1289,8 @@ void DVBDemodSink::applyChannelSettings(int channelSampleRate, int channelFreque } else { - // The receiver resamples to 8 * bandwidth / 7, if the rate is different - double required = dvbt::sampleRate(m_settings.m_bandwidth); + // The receivers resample to 8 * bandwidth / 7 (131/71 MS/s for 1.7 MHz), if the rate is different + double required = S::terrestrialSampleRate(m_settings.m_bandwidth); double ratio = required > 0.0 ? channelSampleRate / required : 0.0; ok = (ratio >= m_minRateRatio) && (ratio <= m_maxRateRatio); requiredRate = m_minRateRatio * required; diff --git a/plugins/channelrx/demoddvb/readme.md b/plugins/channelrx/demoddvb/readme.md index a44731a5a..2ec8a8ad2 100644 --- a/plugins/channelrx/demoddvb/readme.md +++ b/plugins/channelrx/demoddvb/readme.md @@ -137,7 +137,10 @@ for DVB-S and S2, up to about a third of the symbol rate.

3: BW - Channel bandwidth

-DVB-T and T2 channel bandwidth: 8, 7 or 6 MHz. UK and most of Europe use 8 MHz for UHF channels. +DVB-T and T2 channel bandwidth: 10, 8, 7, 6, 5 or 1.7 MHz. Most of Europe use 8 MHz for UHF channels, and 7 MHz for VHF. +10 MHz (for professional links) and 1.7 MHz (used for T2-Lite, for mobile and digital radio) are DVB-T2 only: the Auto +standard then looks for DVB-T2 only. 1.7 MHz runs at 131/71 MS/s (1.845 MS/s), so devices of 2 MS/s or so can receive it; +the others at 8/7 times the bandwidth (5.71 MS/s for 5 MHz, 11.43 MS/s for 10 MHz).

4: SR - Symbol rate

diff --git a/plugins/feature/mcpserver/bandguide.md b/plugins/feature/mcpserver/bandguide.md index 82683d80c..24c5731a2 100644 --- a/plugins/feature/mcpserver/bandguide.md +++ b/plugins/feature/mcpserver/bandguide.md @@ -29,7 +29,7 @@ Minimum device sample rates: |------|---------|-----| | ADS-B | 2 MS/s | 2 Mchip/s chip rate. Higher rates decode more distant aircraft | | DAB | 2.048 MS/s | Fixed by the standard | -| DVB-T and DVB-T2 | 9.142857 MS/s for 8 MHz channels | 64/7 MS/s is the native rate. Rates from 8.0 to 20 MS/s are resampled, at a CPU cost. An RTL-SDR can't run fast enough | +| DVB-T and DVB-T2 | 9.142857 MS/s for 8 MHz channels | 8/7 times the `bandwidth` is the native rate (64/7 MS/s for 8 MHz; 131/71, about 1.845 MS/s, for DVB-T2's 1.7 MHz). Rates from 0.875 to 2.2 times it are resampled, at a CPU cost. An RTL-SDR can't run fast enough for 5 MHz and over | | DVB-S and DVB-S2 | 1.2 times the symbol rate | The signal is 1 + roll-off times the `symbolRate` wide, and losing a little of its edges costs under 0.3 dB. More leaves room for it being off centre and for the device's filter: 33 MS/s or more for 27.5 MS/s broadcasts (a USRP B210 or similar), 27.6 MS/s or more for 23 MS/s, 1 MS/s for QO-100's 333 or 500 kS/s. Measuring the symbol rate (`symbolRate` 0) needs about 1.7 times, to see the noise floor beside the signal. Use `standard` 4, 5 or 6: `standard` 0 is terrestrial, and needs 8 MS/s for an 8 MHz channel whatever the signal | | Broadcast FM | 240 kS/s | Must exceed the channel RF bandwidth. 256 kS/s is recommended for a 180 kHz channel | @@ -78,7 +78,7 @@ Minimum device sample rates: | Broadcast FM | `BFMDemod` | 87.5 to 108 MHz | Use this rather than `WFMDemod` for broadcast: it decodes stereo and RDS. Stations sit on a 100 kHz raster (87.5, 87.6, 87.7...) everywhere except the Americas, where they are on the odd tenths 200 kHz apart; scan with a 100 kHz step, as a 200 kHz step from 87.5 MHz lands beside every even-tenth station and never on it | | Wideband FM | `WFMDemod` | Various | Plain wideband FM with no RDS | | DAB | `DABDemod` | Band III | Fixed 2.048 MS/s | -| DVB-T and DVB-T2 television | `DVBDemod` | UHF channels 21 to 48 (470 to 694 MHz in Europe) | Channel n is centred on 474 + 8 (n - 21) MHz; a channel shown with a minus (e.g. 30-) is 166.667 kHz lower. Set the channel's `bandwidth` (8000000 in most of Europe). `standard` 0 finds either (3 for the T2-Lite profile); `lowPriority` 1 decodes a hierarchical DVB-T multiplex's low priority stream. Needs a device that runs at 9.142857 MS/s | +| DVB-T and DVB-T2 television | `DVBDemod` | UHF channels 21 to 48 (470 to 694 MHz in Europe) | Channel n is centred on 474 + 8 (n - 21) MHz; a channel shown with a minus (e.g. 30-) is 166.667 kHz lower. Set the channel's `bandwidth` (8000000 in most of Europe; also 10000000, 7000000, 6000000, 5000000 and 1700000, of which 10 and 1.7 MHz are DVB-T2 only). `standard` 0 finds either (3 for the T2-Lite profile); `lowPriority` 1 decodes a hierarchical DVB-T multiplex's low priority stream. Needs a device that runs at 9.142857 MS/s | | DVB-S and DVB-S2 satellite television | `DVBDemod` | Ku band 10.7 to 12.75 GHz, received through an LNB at 950 to 2150 MHz (Sky Q wideband LNB: 290 to 2340 MHz) | Turn on the device's transverter mode with the delta set to the LNB's local oscillator (9750000000 universal low band, 10600000000 high band, 10410000000 Sky Q) so the centre frequency is the downlink's. The LNB needs 13 V (vertical) or 18 V (horizontal), and a 22 kHz tone for a universal LNB's high band, from a power inserter; SDRangel can't supply or switch them. `standard` 4 finds either (5 DVB-S, 6 DVB-S2), with `symbolRate` set (or 0 to measure it from the strongest signal in the channel, which then takes the whole baseband: keep the device rate within 64 times the symbol rate): Astra 2 (28.2 E) HD multiplexes are 23000000 DVB-S2 8PSK, SD ones 22000000 or 27500000 DVB-S. QO-100's wideband transponder (10491 to 10499 MHz) carries amateur DVB-S2 at 333000 or 500000 (also 125000 to 2000000) | | AM broadcast | `AMDemod` | LW, MW, SW bands | |