diff --git a/plugins/channelrx/demodadsb/adsbdemod.cpp b/plugins/channelrx/demodadsb/adsbdemod.cpp index d88ea0933..59ee64744 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.cpp +++ b/plugins/channelrx/demodadsb/adsbdemod.cpp @@ -54,6 +54,7 @@ ADSBDemod::ADSBDemod(DeviceAPI *devieAPI) : ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink), m_deviceAPI(devieAPI), m_basebandSampleRate(0), + m_centerFrequency(0), m_targetAzElValid(false), m_targetAzimuth(0.0f), m_targetElevation(0.0f) @@ -134,16 +135,15 @@ void ADSBDemod::start() { qDebug() << "ADSBDemod::start"; - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } - m_worker->reset(); m_worker->startWork(); m_basebandSink->reset(); m_basebandSink->startWork(); m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + ADSBDemodWorker::MsgConfigureADSBDemodWorker *msg = ADSBDemodWorker::MsgConfigureADSBDemodWorker::create(m_settings, QStringList(), true); m_worker->getInputMessageQueue()->push(msg); } @@ -174,6 +174,7 @@ bool ADSBDemod::handleMessage(const Message& cmd) { DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); // Forward to the sink DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy qDebug() << "ADSBDemod::handleMessage: DSPSignalNotification"; diff --git a/plugins/channelrx/demodadsb/adsbdemod.h b/plugins/channelrx/demodadsb/adsbdemod.h index 313771eb6..bee77c58a 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.h +++ b/plugins/channelrx/demodadsb/adsbdemod.h @@ -188,6 +188,7 @@ private: ADSBDemodBaseband* m_basebandSink; ADSBDemodSettings m_settings; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; bool m_targetAzElValid; float m_targetAzimuth; diff --git a/plugins/channelrx/demodais/aisdemodgui.cpp b/plugins/channelrx/demodais/aisdemodgui.cpp index 37b76143f..2a6b1e786 100644 --- a/plugins/channelrx/demodais/aisdemodgui.cpp +++ b/plugins/channelrx/demodais/aisdemodgui.cpp @@ -575,7 +575,7 @@ void AISDemodGUI::on_rfBW_valueChanged(int value) void AISDemodGUI::on_fmDev_valueChanged(int value) { - ui->fmDevText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value / 10.0, 0, 'f', 1)); m_settings.m_fmDeviation = value * 100.0; applySettings(QStringList({"fmDeviation"})); } @@ -894,7 +894,7 @@ void AISDemodGUI::displaySettings() ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); - ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); ui->thresholdText->setText(QString("%1").arg(m_settings.m_correlationThreshold)); diff --git a/plugins/channelrx/demodais/aisdemodgui.ui b/plugins/channelrx/demodais/aisdemodgui.ui index 19f4c6358..cd6adbcff 100644 --- a/plugins/channelrx/demodais/aisdemodgui.ui +++ b/plugins/channelrx/demodais/aisdemodgui.ui @@ -301,7 +301,7 @@ - Frequency deviation + Peak frequency deviation 10 diff --git a/plugins/channelrx/demodais/aisdemodsettings.h b/plugins/channelrx/demodais/aisdemodsettings.h index 17f9c1499..72fc1db65 100644 --- a/plugins/channelrx/demodais/aisdemodsettings.h +++ b/plugins/channelrx/demodais/aisdemodsettings.h @@ -36,7 +36,7 @@ struct AISDemodSettings qint32 m_baud; qint32 m_inputFrequencyOffset; Real m_rfBandwidth; - Real m_fmDeviation; + Real m_fmDeviation; //!< Peak deviation to give modulation index of 0.5 for 9600 baud Real m_correlationThreshold; QString m_filterMMSI; bool m_udpEnabled; diff --git a/plugins/channelrx/demodais/readme.md b/plugins/channelrx/demodais/readme.md index 4980b29e9..9c52e024f 100644 --- a/plugins/channelrx/demodais/readme.md +++ b/plugins/channelrx/demodais/readme.md @@ -40,7 +40,7 @@ This specifies the bandwidth of a LPF that is applied to the input signal to lim

5: Dev - Frequency deviation

-Adjusts the expected frequency deviation in 0.1 kHz steps from 1 to 6 kHz. Typical values are 4.8 kHz, corresponding to a modulation index of 0.5 at 9,600 baud. +Adjusts the expected peak frequency deviation in 0.1 kHz steps from 1 to 6 kHz. Typical values are 4.8 kHz, corresponding to a modulation index of 0.5 at 9,600 baud.

6: TH - Correlation Threshold

diff --git a/plugins/channelrx/demodam/amdemod.cpp b/plugins/channelrx/demodam/amdemod.cpp index 073fac7b6..fb868b396 100644 --- a/plugins/channelrx/demodam/amdemod.cpp +++ b/plugins/channelrx/demodam/amdemod.cpp @@ -57,6 +57,7 @@ AMDemod::AMDemod(DeviceAPI *deviceAPI) : m_basebandSink(nullptr), m_running(false), m_basebandSampleRate(0), + m_centerFrequency(0), m_lastTs(0) { setObjectName(m_channelId); diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp index f00ee2ea4..34d7d36d7 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp +++ b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp @@ -61,6 +61,7 @@ ChirpChatDemod::ChirpChatDemod(DeviceAPI* deviceAPI) : m_running(false), m_spectrumVis(SDR_RX_SCALEF), m_basebandSampleRate(0), + m_centerFrequency(0), m_lastMsgSignalDb(0.0), m_lastMsgNoiseDb(0.0), m_lastMsgSyncWord(0), @@ -158,13 +159,12 @@ void ChirpChatDemod::start() QObject::connect(m_thread, &QThread::finished, m_basebandSink, &QObject::deleteLater); QObject::connect(m_thread, &QThread::finished, m_thread, &QThread::deleteLater); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } - m_basebandSink->reset(); m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + SpectrumSettings spectrumSettings = m_spectrumVis.getSettings(); spectrumSettings.m_ssb = true; SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); @@ -360,6 +360,7 @@ bool ChirpChatDemod::handleMessage(const Message& cmd) { DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); qDebug() << "ChirpChatDemod::handleMessage: DSPSignalNotification: m_basebandSampleRate: " << m_basebandSampleRate; // Forward to the sink diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemod.h b/plugins/channelrx/demodchirpchat/chirpchatdemod.h index 5bc815d2b..cf97446e8 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemod.h +++ b/plugins/channelrx/demodchirpchat/chirpchatdemod.h @@ -148,6 +148,7 @@ private: ChirpChatDemodSettings m_settings; SpectrumVis m_spectrumVis; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; float m_lastMsgSignalDb; float m_lastMsgNoiseDb; int m_lastMsgSyncWord; diff --git a/plugins/channelrx/demoddatv/datvdemod.cpp b/plugins/channelrx/demoddatv/datvdemod.cpp index 55c2447fe..2e971cb67 100644 --- a/plugins/channelrx/demoddatv/datvdemod.cpp +++ b/plugins/channelrx/demoddatv/datvdemod.cpp @@ -45,7 +45,8 @@ MESSAGE_CLASS_DEFINITION(DATVDemod::MsgConfigureDATVDemod, Message) DATVDemod::DATVDemod(DeviceAPI *deviceAPI) : ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink), m_deviceAPI(deviceAPI), - m_basebandSampleRate(0) + m_basebandSampleRate(0), + m_centerFrequency(0) { qDebug("DATVDemod::DATVDemod"); setObjectName(m_channelId); @@ -115,14 +116,13 @@ void DATVDemod::start() { qDebug("DATVDemod::start"); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } - m_basebandSink->reset(); m_basebandSink->startWork(); m_thread.start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + DATVDemodBaseband::MsgConfigureDATVDemodBaseband *msg = DATVDemodBaseband::MsgConfigureDATVDemodBaseband::create(QStringList(), m_settings, true); m_basebandSink->getInputMessageQueue()->push(msg); } @@ -149,6 +149,7 @@ bool DATVDemod::handleMessage(const Message& cmd) { DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); // store for init at start + m_centerFrequency = notif.getCenterFrequency(); qDebug() << "DATVDemod::handleMessage: DSPSignalNotification" << m_basebandSampleRate; // Forward to the sink diff --git a/plugins/channelrx/demoddatv/datvdemod.h b/plugins/channelrx/demoddatv/datvdemod.h index a898c235d..dbe46e2b8 100644 --- a/plugins/channelrx/demoddatv/datvdemod.h +++ b/plugins/channelrx/demoddatv/datvdemod.h @@ -169,6 +169,7 @@ private: DATVDemodBaseband* m_basebandSink; DATVDemodSettings m_settings; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index c55de76be..54a1ffb77 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -63,6 +63,7 @@ DSDDemod::DSDDemod(DeviceAPI *deviceAPI) : m_deviceAPI(deviceAPI), m_running(false), m_basebandSampleRate(0), + m_centerFrequency(0), m_scopeXYSink(nullptr) { qDebug("DSDDemod::DSDDemod"); @@ -176,13 +177,13 @@ void DSDDemod::start() &QThread::deleteLater ); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } m_basebandSink->setScopeXYSink(m_scopeXYSink); m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + DSDDemodBaseband::MsgConfigureDSDDemodBaseband *msg = DSDDemodBaseband::MsgConfigureDSDDemodBaseband::create(QStringList(), m_settings, true); m_basebandSink->getInputMessageQueue()->push(msg); @@ -229,6 +230,7 @@ bool DSDDemod::handleMessage(const Message& cmd) qDebug() << "DSDDemod::handleMessage: DSPSignalNotification"; DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); // Forward to the sink if (m_running) { m_basebandSink->getInputMessageQueue()->push(new DSPSignalNotification(notif)); diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index 256862b71..a9973445e 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -191,6 +191,7 @@ private: bool m_running; DSDDemodSettings m_settings; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; QHash m_availableAMBEFeatures; BasebandSampleSink *m_scopeXYSink; QNetworkAccessManager *m_networkManager; diff --git a/plugins/channelrx/demodendoftrain/endoftraindemodgui.cpp b/plugins/channelrx/demodendoftrain/endoftraindemodgui.cpp index 8d7443ddf..c8da03e6b 100644 --- a/plugins/channelrx/demodendoftrain/endoftraindemodgui.cpp +++ b/plugins/channelrx/demodendoftrain/endoftraindemodgui.cpp @@ -305,7 +305,7 @@ void EndOfTrainDemodGUI::on_rfBW_valueChanged(int value) void EndOfTrainDemodGUI::on_fmDev_valueChanged(int value) { - ui->fmDevText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value / 10.0, 0, 'f', 1)); m_settings.m_fmDeviation = value * 100.0; applySetting("fmDeviation"); } @@ -584,7 +584,7 @@ void EndOfTrainDemodGUI::displaySettings() ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); - ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); updateIndexLabel(); diff --git a/plugins/channelrx/demodendoftrain/endoftraindemodgui.ui b/plugins/channelrx/demodendoftrain/endoftraindemodgui.ui index 81cec7080..2306a65f9 100644 --- a/plugins/channelrx/demodendoftrain/endoftraindemodgui.ui +++ b/plugins/channelrx/demodendoftrain/endoftraindemodgui.ui @@ -321,7 +321,7 @@
- Frequency deviation + Peak frequency deviation 10 @@ -349,7 +349,7 @@ - 5.0k + ±3.0k Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/plugins/channelrx/demodendoftrain/readme.md b/plugins/channelrx/demodendoftrain/readme.md index 22fb78306..059f8720a 100644 --- a/plugins/channelrx/demodendoftrain/readme.md +++ b/plugins/channelrx/demodendoftrain/readme.md @@ -7,7 +7,7 @@ that can be found on some trains. It transmits information about whether motion is detected, brake pressure, whether the marker light is on and battery information. * Frequency: 457.9375 MHz (North America, India), 477.7 MHz (Australia) and 450.2625 MHz (New Zealand). -* Modulation: FSK, 1800Hz space, 1200 mark, +-3kHz deviation. +* Modulation: FSK, 1800Hz space, 1200 mark, ±3kHz deviation. * Baud rate: 1200 baud. The End-of-train packet specification is defined in: @@ -40,7 +40,7 @@ This specifies the bandwidth of a LPF that is applied to the input signal to lim

5: Frequency deviation

-Adjusts the expected frequency deviation in 0.1 kHz steps from 1 to 6 kHz. Typical value is 3 kHz. +Adjusts the expected peak frequency deviation in 0.1 kHz steps from 1 to 6 kHz. Typical value is ±3 kHz.

6: Filter Address

diff --git a/plugins/channelrx/demodfreedv/freedvdemod.cpp b/plugins/channelrx/demodfreedv/freedvdemod.cpp index 5011f85a6..f21d4ced9 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemod.cpp @@ -48,7 +48,9 @@ const char* const FreeDVDemod::m_channelId = "FreeDVDemod"; FreeDVDemod::FreeDVDemod(DeviceAPI *deviceAPI) : ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink), m_deviceAPI(deviceAPI), - m_spectrumVis(SDR_RX_SCALEF) + m_spectrumVis(SDR_RX_SCALEF), + m_basebandSampleRate(0), + m_centerFrequency(0) { setObjectName(m_channelId); @@ -120,13 +122,12 @@ void FreeDVDemod::start() { qDebug() << "FreeDVDemod::start"; - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } - m_basebandSink->reset(); m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + SpectrumSettings spectrumSettings = m_spectrumVis.getSettings(); spectrumSettings.m_ssb = true; SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); @@ -163,6 +164,7 @@ bool FreeDVDemod::handleMessage(const Message& cmd) { DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); // Forward to the sink DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy qDebug() << "FreeDVDemod::handleMessage: DSPSignalNotification"; diff --git a/plugins/channelrx/demodfreedv/freedvdemod.h b/plugins/channelrx/demodfreedv/freedvdemod.h index 5d4d9f607..c5678d318 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.h +++ b/plugins/channelrx/demodfreedv/freedvdemod.h @@ -168,6 +168,7 @@ private: FreeDVDemodSettings m_settings; SpectrumVis m_spectrumVis; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channelrx/demodft8/ft8demod.cpp b/plugins/channelrx/demodft8/ft8demod.cpp index 202f666bc..26cbf4627 100644 --- a/plugins/channelrx/demodft8/ft8demod.cpp +++ b/plugins/channelrx/demodft8/ft8demod.cpp @@ -58,7 +58,8 @@ FT8Demod::FT8Demod(DeviceAPI *deviceAPI) : m_deviceAPI(deviceAPI), m_running(false), m_spectrumVis(SDR_RX_SCALEF), - m_basebandSampleRate(0) + m_basebandSampleRate(0), + m_centerFrequency(0) { setObjectName(m_channelId); @@ -181,12 +182,11 @@ void FT8Demod::start() &QThread::deleteLater ); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } - m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + FT8DemodBaseband::MsgConfigureFT8DemodBaseband *msg = FT8DemodBaseband::MsgConfigureFT8DemodBaseband::create(QStringList(), m_settings, true); m_basebandSink->getInputMessageQueue()->push(msg); @@ -223,6 +223,7 @@ bool FT8Demod::handleMessage(const Message& cmd) qDebug() << "FT8Demod::handleMessage: DSPSignalNotification"; DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); // Forward to the sink if (m_running) { m_basebandSink->getInputMessageQueue()->push(new DSPSignalNotification(notif)); diff --git a/plugins/channelrx/demodft8/ft8demod.h b/plugins/channelrx/demodft8/ft8demod.h index 2f409a21c..af1e27263 100644 --- a/plugins/channelrx/demodft8/ft8demod.h +++ b/plugins/channelrx/demodft8/ft8demod.h @@ -162,6 +162,7 @@ private: FT8DemodSettings m_settings; SpectrumVis m_spectrumVis; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channelrx/demodm17/m17demod.cpp b/plugins/channelrx/demodm17/m17demod.cpp index 2cfee7581..5743efbf1 100644 --- a/plugins/channelrx/demodm17/m17demod.cpp +++ b/plugins/channelrx/demodm17/m17demod.cpp @@ -59,6 +59,7 @@ M17Demod::M17Demod(DeviceAPI *deviceAPI) : m_basebandSink(nullptr), m_running(false), m_basebandSampleRate(0), + m_centerFrequency(0), m_scopeXYSink(nullptr) { qDebug("M17Demod::M17Demod"); @@ -140,14 +141,14 @@ void M17Demod::start() QObject::connect(m_thread, &QThread::finished, m_basebandSink, &QObject::deleteLater); QObject::connect(m_thread, &QThread::finished, m_thread, &QThread::deleteLater); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } m_basebandSink->setScopeXYSink(m_scopeXYSink); m_basebandSink->reset(); m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + M17DemodBaseband::MsgConfigureM17DemodBaseband *msg = M17DemodBaseband::MsgConfigureM17DemodBaseband::create(m_settings, QStringList(), true); m_basebandSink->getInputMessageQueue()->push(msg); @@ -182,6 +183,7 @@ bool M17Demod::handleMessage(const Message& cmd) { DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); qDebug() << "M17Demod::handleMessage: DSPSignalNotification"; // Forward to the sink diff --git a/plugins/channelrx/demodm17/m17demod.h b/plugins/channelrx/demodm17/m17demod.h index 758299e0b..7225c1791 100644 --- a/plugins/channelrx/demodm17/m17demod.h +++ b/plugins/channelrx/demodm17/m17demod.h @@ -286,6 +286,7 @@ private: bool m_running; M17DemodSettings m_settings; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; BasebandSampleSink *m_scopeXYSink; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channelrx/demodm17/m17demodsink.cpp b/plugins/channelrx/demodm17/m17demodsink.cpp index 9cee85ac8..42fc2eaa3 100644 --- a/plugins/channelrx/demodm17/m17demodsink.cpp +++ b/plugins/channelrx/demodm17/m17demodsink.cpp @@ -308,7 +308,7 @@ void M17DemodSink::applySettings(const M17DemodSettings& settings, const QListsetBasebandSampleRate(m_basebandSampleRate); - } - m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + NFMDemodBaseband::MsgConfigureNFMDemodBaseband *msg = NFMDemodBaseband::MsgConfigureNFMDemodBaseband::create(QStringList(), m_settings, true); m_basebandSink->getInputMessageQueue()->push(msg); @@ -189,6 +189,7 @@ bool NFMDemod::handleMessage(const Message& cmd) qDebug() << "NFMDemod::handleMessage: DSPSignalNotification"; DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); // Forward to the sink if any if (m_running) { m_basebandSink->getInputMessageQueue()->push(new DSPSignalNotification(notif)); diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index 31059baf4..a88576759 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -152,6 +152,7 @@ private: bool m_running; NFMDemodSettings m_settings; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channelrx/demodnfm/nfmdemodsettings.h b/plugins/channelrx/demodnfm/nfmdemodsettings.h index bd48d114d..45c243494 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsettings.h +++ b/plugins/channelrx/demodnfm/nfmdemodsettings.h @@ -38,7 +38,7 @@ struct NFMDemodSettings int32_t m_inputFrequencyOffset; Real m_rfBandwidth; Real m_afBandwidth; - Real m_fmDeviation; + Real m_fmDeviation; //!< Full deviation in Hz (UI shows peak deviation) int m_squelchGate; bool m_deltaSquelch; Real m_squelch; //!< deci-Bels diff --git a/plugins/channelrx/demodnfm/nfmdemodsink.cpp b/plugins/channelrx/demodnfm/nfmdemodsink.cpp index a48bb48b4..e2f40d206 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsink.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodsink.cpp @@ -317,7 +317,7 @@ void NFMDemodSink::applySettings(const QStringList& settingsKeys, const NFMDemod Real lowCut = -Real(settings.m_fmDeviation) / m_channelSampleRate; Real hiCut = Real(settings.m_fmDeviation) / m_channelSampleRate; m_rfFilter.create_filter(lowCut, hiCut); - m_phaseDiscri.setFMScaling(Real(m_audioSampleRate) / (2.0f * settings.m_fmDeviation)); + m_phaseDiscri.setFMScaling(Real(m_audioSampleRate) / settings.m_fmDeviation); } if ((settingsKeys.contains("afBandwidth") && (settings.m_afBandwidth != m_settings.m_afBandwidth)) || force) @@ -386,7 +386,7 @@ void NFMDemodSink::applyAudioSampleRate(unsigned int sampleRate) } m_afSquelch.setThreshold(m_squelchLevel); - m_phaseDiscri.setFMScaling(Real(sampleRate) / (2.0f * m_settings.m_fmDeviation)); + m_phaseDiscri.setFMScaling(Real(sampleRate) / m_settings.m_fmDeviation); // m_fmDeviation is full rather than peak deviation, so the usual factor of 2 is cancelled m_audioFifo.setSize(sampleRate); m_squelchDelayLine.resize(sampleRate/2); m_interpolatorDistance = Real(m_channelSampleRate) / Real(sampleRate); diff --git a/plugins/channelrx/demodpacket/packetdemodgui.cpp b/plugins/channelrx/demodpacket/packetdemodgui.cpp index 5764828ba..54fe7165b 100644 --- a/plugins/channelrx/demodpacket/packetdemodgui.cpp +++ b/plugins/channelrx/demodpacket/packetdemodgui.cpp @@ -276,7 +276,7 @@ void PacketDemodGUI::on_rfBW_valueChanged(int value) void PacketDemodGUI::on_fmDev_valueChanged(int value) { - ui->fmDevText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value / 10.0, 0, 'f', 1)); m_settings.m_fmDeviation = value * 100.0; applySettings(QStringList({"fmDeviation"})); } @@ -538,7 +538,7 @@ void PacketDemodGUI::displaySettings() ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); - ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); updateIndexLabel(); diff --git a/plugins/channelrx/demodpacket/packetdemodgui.ui b/plugins/channelrx/demodpacket/packetdemodgui.ui index 126996967..158c723a5 100644 --- a/plugins/channelrx/demodpacket/packetdemodgui.ui +++ b/plugins/channelrx/demodpacket/packetdemodgui.ui @@ -339,7 +339,7 @@
- Frequency deviation + Peak frequency deviation 10 @@ -367,7 +367,7 @@ - 5.0k + ±5.0k Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/plugins/channelrx/demodpacket/readme.md b/plugins/channelrx/demodpacket/readme.md index 57e4176a7..78b5a89d7 100644 --- a/plugins/channelrx/demodpacket/readme.md +++ b/plugins/channelrx/demodpacket/readme.md @@ -34,7 +34,7 @@ This specifies the bandwidth of a LPF that is applied to the input signal to lim

6: Frequency deviation

-Adjusts the expected frequency deviation in 0.1 kHz steps from 1 to 6 kHz. Typical values are 2.5 kHz and 5 kHz. +Adjusts the expected peak frequency deviation in 0.1 kHz steps from 1 to 6 kHz. Typical values are ±2.5 kHz and ±5 kHz.

7: Filter Packets From

diff --git a/plugins/channelrx/demodpager/pagerdemodgui.cpp b/plugins/channelrx/demodpager/pagerdemodgui.cpp index 6829de94f..6fc356e2e 100644 --- a/plugins/channelrx/demodpager/pagerdemodgui.cpp +++ b/plugins/channelrx/demodpager/pagerdemodgui.cpp @@ -368,7 +368,7 @@ void PagerDemodGUI::on_rfBW_valueChanged(int value) void PagerDemodGUI::on_fmDev_valueChanged(int value) { - ui->fmDevText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value / 10.0, 0, 'f', 1)); m_settings.m_fmDeviation = value * 100.0; applySettings(QStringList("fmDeviation")); } @@ -665,7 +665,7 @@ void PagerDemodGUI::displaySettings() ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); - ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); updateIndexLabel(); diff --git a/plugins/channelrx/demodpager/pagerdemodgui.ui b/plugins/channelrx/demodpager/pagerdemodgui.ui index d66602c81..a1c13e259 100644 --- a/plugins/channelrx/demodpager/pagerdemodgui.ui +++ b/plugins/channelrx/demodpager/pagerdemodgui.ui @@ -301,7 +301,7 @@
- Frequency deviation + Peak frequency deviation 10 @@ -329,7 +329,7 @@ - 2.4k + ±2.4k Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter diff --git a/plugins/channelrx/demodpager/readme.md b/plugins/channelrx/demodpager/readme.md index 15a8e586d..1cf071a6c 100644 --- a/plugins/channelrx/demodpager/readme.md +++ b/plugins/channelrx/demodpager/readme.md @@ -30,7 +30,7 @@ This specifies the bandwidth of a LPF that is applied to the input signal to lim

5: Dev - Frequency deviation

-Adjusts the expected frequency deviation in 0.1 kHz steps from 1 to 6 kHz. POCSAG uses FSK with a +/- 4.5 kHz shift. +Adjusts the expected peak frequency deviation in 0.1 kHz steps from 1 to 6 kHz. POCSAG uses FSK with a ±4.5 kHz shift.

6: Mod - Modulation

diff --git a/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp b/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp index 88e18df57..081e4508d 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp +++ b/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp @@ -398,7 +398,7 @@ void RadiosondeDemodGUI::on_rfBW_valueChanged(int value) void RadiosondeDemodGUI::on_fmDev_valueChanged(int value) { - ui->fmDevText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value / 10.0, 0, 'f', 1)); m_settings.m_fmDeviation = value * 100.0; applySettings(QStringList("fmDeviation")); } @@ -748,7 +748,7 @@ void RadiosondeDemodGUI::displaySettings() ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); - ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); ui->thresholdText->setText(QString("%1").arg(m_settings.m_correlationThreshold)); diff --git a/plugins/channelrx/demodradiosonde/radiosondedemodgui.ui b/plugins/channelrx/demodradiosonde/radiosondedemodgui.ui index 9d6b8192b..d98410385 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemodgui.ui +++ b/plugins/channelrx/demodradiosonde/radiosondedemodgui.ui @@ -298,7 +298,7 @@
- Frequency deviation + Peak frequency deviation 10 diff --git a/plugins/channelrx/demodradiosonde/radiosondedemodsettings.h b/plugins/channelrx/demodradiosonde/radiosondedemodsettings.h index fa9f83f58..2b2edbd44 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemodsettings.h +++ b/plugins/channelrx/demodradiosonde/radiosondedemodsettings.h @@ -36,7 +36,7 @@ struct RadiosondeDemodSettings qint32 m_baud; qint32 m_inputFrequencyOffset; Real m_rfBandwidth; - Real m_fmDeviation; + Real m_fmDeviation; // Peak frequency deviation in Hz Real m_correlationThreshold; QString m_filterSerial; bool m_udpEnabled; diff --git a/plugins/channelrx/demodradiosonde/readme.md b/plugins/channelrx/demodradiosonde/readme.md index 8fab4e4b4..7bbf0e53f 100644 --- a/plugins/channelrx/demodradiosonde/readme.md +++ b/plugins/channelrx/demodradiosonde/readme.md @@ -34,7 +34,7 @@ This specifies the bandwidth of a LPF that is applied to the input signal to lim

5: Dev - Frequency deviation

-Adjusts the expected frequency deviation in 0.1 kHz steps from 1 to 5 kHz. Typical value to RS41 is 2.4kHz. +Adjusts the expected peak frequency deviation in 0.1 kHz steps from 1 to 5 kHz. Typical value to RS41 is ±2.4kHz.

6: TH - Correlation Threshold

diff --git a/plugins/channelrx/demodssb/ssbdemod.cpp b/plugins/channelrx/demodssb/ssbdemod.cpp index 57d43d8ce..f91b570d7 100644 --- a/plugins/channelrx/demodssb/ssbdemod.cpp +++ b/plugins/channelrx/demodssb/ssbdemod.cpp @@ -58,7 +58,8 @@ SSBDemod::SSBDemod(DeviceAPI *deviceAPI) : m_basebandSink(nullptr), m_running(false), m_spectrumVis(SDR_RX_SCALEF), - m_basebandSampleRate(0) + m_basebandSampleRate(0), + m_centerFrequency(0) { setObjectName(m_channelId); @@ -166,12 +167,11 @@ void SSBDemod::start() &QThread::deleteLater ); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } - m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + SSBDemodBaseband::MsgConfigureSSBDemodBaseband *msg = SSBDemodBaseband::MsgConfigureSSBDemodBaseband::create(QStringList(), m_settings, true); m_basebandSink->getInputMessageQueue()->push(msg); @@ -208,6 +208,7 @@ bool SSBDemod::handleMessage(const Message& cmd) qDebug() << "SSBDemod::handleMessage: DSPSignalNotification"; DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); // Forward to the sink if (m_running) { m_basebandSink->getInputMessageQueue()->push(new DSPSignalNotification(notif)); diff --git a/plugins/channelrx/demodssb/ssbdemod.h b/plugins/channelrx/demodssb/ssbdemod.h index 89de0e303..5da17ba36 100644 --- a/plugins/channelrx/demodssb/ssbdemod.h +++ b/plugins/channelrx/demodssb/ssbdemod.h @@ -160,6 +160,7 @@ private: SSBDemodSettings m_settings; SpectrumVis m_spectrumVis; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channelrx/demodwfm/wfmdemod.cpp b/plugins/channelrx/demodwfm/wfmdemod.cpp index c11629fbc..7386b43b5 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.cpp +++ b/plugins/channelrx/demodwfm/wfmdemod.cpp @@ -58,7 +58,8 @@ WFMDemod::WFMDemod(DeviceAPI* deviceAPI) : m_thread(nullptr), m_basebandSink(nullptr), m_running(false), - m_basebandSampleRate(0) + m_basebandSampleRate(0), + m_centerFrequency(0) { setObjectName(m_channelId); applySettings(QStringList(), m_settings, true); @@ -138,13 +139,12 @@ void WFMDemod::start() QObject::connect(m_thread, &QThread::finished, m_basebandSink, &QObject::deleteLater); QObject::connect(m_thread, &QThread::finished, m_thread, &QThread::deleteLater); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } - m_basebandSink->reset(); m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + WFMDemodBaseband::MsgConfigureWFMDemodBaseband *msg = WFMDemodBaseband::MsgConfigureWFMDemodBaseband::create(QStringList(), m_settings, true); m_basebandSink->getInputMessageQueue()->push(msg); @@ -178,6 +178,7 @@ bool WFMDemod::handleMessage(const Message& cmd) { DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); qDebug() << "WFMDemod::handleMessage: DSPSignalNotification"; // Forward to the sink diff --git a/plugins/channelrx/demodwfm/wfmdemod.h b/plugins/channelrx/demodwfm/wfmdemod.h index 94e822c26..5176a0e98 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.h +++ b/plugins/channelrx/demodwfm/wfmdemod.h @@ -153,6 +153,7 @@ private: bool m_running; WFMDemodSettings m_settings; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channelrx/freqtracker/freqtracker.cpp b/plugins/channelrx/freqtracker/freqtracker.cpp index 45c7be45c..ea51ea21e 100644 --- a/plugins/channelrx/freqtracker/freqtracker.cpp +++ b/plugins/channelrx/freqtracker/freqtracker.cpp @@ -56,7 +56,8 @@ FreqTracker::FreqTracker(DeviceAPI *deviceAPI) : m_basebandSink(nullptr), m_running(false), m_spectrumVis(SDR_RX_SCALEF), - m_basebandSampleRate(0) + m_basebandSampleRate(0), + m_centerFrequency(0) { setObjectName(m_channelId); applySettings(QStringList(), m_settings, true); @@ -137,13 +138,12 @@ void FreqTracker::start() QObject::connect(m_thread, &QThread::finished, m_basebandSink, &QObject::deleteLater); QObject::connect(m_thread, &QThread::finished, m_thread, &QThread::deleteLater); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } - m_basebandSink->reset(); m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + FreqTrackerBaseband::MsgConfigureFreqTrackerBaseband *msg = FreqTrackerBaseband::MsgConfigureFreqTrackerBaseband::create(QStringList(), m_settings, true); m_basebandSink->getInputMessageQueue()->push(msg); @@ -168,6 +168,7 @@ bool FreqTracker::handleMessage(const Message& cmd) { DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); qDebug() << "FreqTracker::handleMessage: DSPSignalNotification"; // Forward to the sink diff --git a/plugins/channelrx/freqtracker/freqtracker.h b/plugins/channelrx/freqtracker/freqtracker.h index d384a3a33..86ad77be3 100644 --- a/plugins/channelrx/freqtracker/freqtracker.h +++ b/plugins/channelrx/freqtracker/freqtracker.h @@ -157,6 +157,7 @@ private: FreqTrackerSettings m_settings; SpectrumVis m_spectrumVis; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; static const int m_udpBlockSize; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channelrx/remotesink/remotesink.cpp b/plugins/channelrx/remotesink/remotesink.cpp index 82a83477e..d5dd0353d 100644 --- a/plugins/channelrx/remotesink/remotesink.cpp +++ b/plugins/channelrx/remotesink/remotesink.cpp @@ -56,7 +56,8 @@ RemoteSink::RemoteSink(DeviceAPI *deviceAPI) : m_basebandSink(nullptr), m_running(false), m_frequencyOffset(0), - m_basebandSampleRate(0) + m_basebandSampleRate(0), + m_centerFrequency(0) { setObjectName(m_channelId); updateWithDeviceData(); @@ -141,9 +142,8 @@ void RemoteSink::start() m_basebandSink->startWork(); m_thread->start(); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); RemoteSinkBaseband::MsgConfigureRemoteSinkBaseband *msg = RemoteSinkBaseband::MsgConfigureRemoteSinkBaseband::create(QStringList(), m_settings, true); m_basebandSink->getInputMessageQueue()->push(msg); @@ -178,6 +178,7 @@ bool RemoteSink::handleMessage(const Message& cmd) { DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); qDebug() << "RemoteSink::handleMessage: DSPSignalNotification: m_basebandSampleRate:" << m_basebandSampleRate; calculateFrequencyOffset(); updateWithDeviceData(); // Device center frequency and/or sample rate has changed diff --git a/plugins/channelrx/remotesink/remotesink.h b/plugins/channelrx/remotesink/remotesink.h index 9a6a73a9c..156634a2c 100644 --- a/plugins/channelrx/remotesink/remotesink.h +++ b/plugins/channelrx/remotesink/remotesink.h @@ -137,6 +137,7 @@ private: int64_t m_frequencyOffset; int m_basebandSampleRate; + qint64 m_centerFrequency; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channelrx/remotetcpsink/remotetcpsink.cpp b/plugins/channelrx/remotetcpsink/remotetcpsink.cpp index e86e0b496..4f7c3ae57 100644 --- a/plugins/channelrx/remotetcpsink/remotetcpsink.cpp +++ b/plugins/channelrx/remotetcpsink/remotetcpsink.cpp @@ -54,6 +54,7 @@ RemoteTCPSink::RemoteTCPSink(DeviceAPI *deviceAPI) : ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink), m_deviceAPI(deviceAPI), m_basebandSampleRate(0), + m_centerFrequency(0), m_clients(0), m_removeRequest(nullptr) { @@ -145,9 +146,8 @@ void RemoteTCPSink::start() m_basebandSink->startWork(); m_thread.start(); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); MsgConfigureRemoteTCPSink* msg = MsgConfigureRemoteTCPSink::create(m_settings, QStringList(), true, true); m_basebandSink->getInputMessageQueue()->push(msg); @@ -180,6 +180,7 @@ bool RemoteTCPSink::handleMessage(const Message& cmd) { const DSPSignalNotification& notif = (const DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); qDebug() << "RemoteTCPSink::handleMessage: DSPSignalNotification: m_basebandSampleRate:" << m_basebandSampleRate; // Forward to the sink diff --git a/plugins/channelrx/remotetcpsink/remotetcpsink.h b/plugins/channelrx/remotetcpsink/remotetcpsink.h index bc030e08c..ab05b9d64 100644 --- a/plugins/channelrx/remotetcpsink/remotetcpsink.h +++ b/plugins/channelrx/remotetcpsink/remotetcpsink.h @@ -288,6 +288,7 @@ private: RemoteTCPSinkSettings m_settings; int m_basebandSampleRate; + qint64 m_centerFrequency; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channelrx/udpsink/udpsink.cpp b/plugins/channelrx/udpsink/udpsink.cpp index e8a446b05..5b076565c 100644 --- a/plugins/channelrx/udpsink/udpsink.cpp +++ b/plugins/channelrx/udpsink/udpsink.cpp @@ -49,6 +49,8 @@ UDPSink::UDPSink(DeviceAPI *deviceAPI) : ChannelAPI(m_channelIdURI, ChannelAPI::StreamSingleSink), m_deviceAPI(deviceAPI), m_spectrumVis(SDR_RX_SCALEF), + m_basebandSampleRate(0), + m_centerFrequency(0), m_channelSampleRate(48000), m_channelFrequencyOffset(0) { @@ -122,12 +124,11 @@ void UDPSink::start() { qDebug() << "UDPSink::start"; - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } - m_basebandSink->reset(); m_thread->start(); + + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); } void UDPSink::stop() @@ -152,6 +153,7 @@ bool UDPSink::handleMessage(const Message& cmd) { DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); // Forward to the sink DSPSignalNotification* rep = new DSPSignalNotification(notif); // make a copy qDebug() << "UDPSink::handleMessage: DSPSignalNotification"; diff --git a/plugins/channelrx/udpsink/udpsink.h b/plugins/channelrx/udpsink/udpsink.h index d976e56b6..973466133 100644 --- a/plugins/channelrx/udpsink/udpsink.h +++ b/plugins/channelrx/udpsink/udpsink.h @@ -150,6 +150,7 @@ protected: UDPSinkSettings m_settings; SpectrumVis m_spectrumVis; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; int m_channelSampleRate; int m_channelFrequencyOffset; diff --git a/plugins/channelrx/wdsprx/wdsprx.cpp b/plugins/channelrx/wdsprx/wdsprx.cpp index 9ac16c69a..215158c3e 100644 --- a/plugins/channelrx/wdsprx/wdsprx.cpp +++ b/plugins/channelrx/wdsprx/wdsprx.cpp @@ -58,7 +58,8 @@ WDSPRx::WDSPRx(DeviceAPI *deviceAPI) : m_basebandSink(nullptr), m_running(false), m_spectrumVis(SDR_RX_SCALEF), - m_basebandSampleRate(0) + m_basebandSampleRate(0), + m_centerFrequency(0) { setObjectName(m_channelId); @@ -168,12 +169,11 @@ void WDSPRx::start() &QThread::deleteLater ); - if (m_basebandSampleRate != 0) { - m_basebandSink->setBasebandSampleRate(m_basebandSampleRate); - } - m_thread->start(); + DSPSignalNotification *dspMsg = new DSPSignalNotification(m_basebandSampleRate, m_centerFrequency); + m_basebandSink->getInputMessageQueue()->push(dspMsg); + WDSPRxBaseband::MsgConfigureWDSPRxBaseband *msg = WDSPRxBaseband::MsgConfigureWDSPRxBaseband::create(QStringList(), m_settings, true); m_basebandSink->getInputMessageQueue()->push(msg); @@ -210,6 +210,7 @@ bool WDSPRx::handleMessage(const Message& cmd) qDebug() << "WDSPRx::handleMessage: DSPSignalNotification"; auto& notif = (const DSPSignalNotification&) cmd; m_basebandSampleRate = notif.getSampleRate(); + m_centerFrequency = notif.getCenterFrequency(); // Forward to the sink if (m_running) { m_basebandSink->getInputMessageQueue()->push(new DSPSignalNotification(notif)); diff --git a/plugins/channelrx/wdsprx/wdsprx.h b/plugins/channelrx/wdsprx/wdsprx.h index f47a4d0cd..4b7128d89 100644 --- a/plugins/channelrx/wdsprx/wdsprx.h +++ b/plugins/channelrx/wdsprx/wdsprx.h @@ -160,6 +160,7 @@ private: WDSPRxSettings m_settings; SpectrumVis m_spectrumVis; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + qint64 m_centerFrequency; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; diff --git a/plugins/channeltx/modais/aismodgui.cpp b/plugins/channeltx/modais/aismodgui.cpp index 7926c9147..63f84da2b 100644 --- a/plugins/channeltx/modais/aismodgui.cpp +++ b/plugins/channeltx/modais/aismodgui.cpp @@ -156,7 +156,7 @@ void AISModGUI::on_mode_currentIndexChanged(int value) ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); - ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); ui->btText->setText(QString("%1").arg(m_settings.m_bt, 0, 'f', 1)); ui->bt->setValue(m_settings.m_bt * 10); @@ -174,7 +174,7 @@ void AISModGUI::on_rfBW_valueChanged(int value) void AISModGUI::on_fmDev_valueChanged(int value) { - ui->fmDevText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value / 10.0, 0, 'f', 1)); m_settings.m_fmDeviation = value * 100.0; applySettings(QStringList("fmDeviation")); } @@ -556,7 +556,7 @@ void AISModGUI::displaySettings() ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); - ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); ui->btText->setText(QString("%1").arg(m_settings.m_bt, 0, 'f', 1)); diff --git a/plugins/channeltx/modais/aismodgui.ui b/plugins/channeltx/modais/aismodgui.ui index 629d0bc86..20a98241b 100644 --- a/plugins/channeltx/modais/aismodgui.ui +++ b/plugins/channeltx/modais/aismodgui.ui @@ -304,7 +304,7 @@
- Frequency deviation + Peak frequency deviation 10 @@ -332,7 +332,7 @@ - 4.8k + ±4.8k Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/plugins/channeltx/modais/aismodsettings.cpp b/plugins/channeltx/modais/aismodsettings.cpp index 736602594..1bf419445 100644 --- a/plugins/channeltx/modais/aismodsettings.cpp +++ b/plugins/channeltx/modais/aismodsettings.cpp @@ -35,7 +35,7 @@ void AISModSettings::resetToDefaults() m_inputFrequencyOffset = 0; m_baud = 9600; // nominal value m_rfBandwidth = 25000.0f; // 12.5k for narrow, 25k for wide (narrow is obsolete) - m_fmDeviation = 4800.0f; // To give modulation index of 0.5 for 9600 baud + m_fmDeviation = 4800.0f; // Peak deviation - To give modulation index of 0.5 for 9600 baud m_gain = -1.0f; // To avoid overflow, which results in out-of-band RF m_channelMute = false; m_repeat = false; diff --git a/plugins/channeltx/modais/readme.md b/plugins/channeltx/modais/readme.md index 9748de83a..6ce364fc8 100644 --- a/plugins/channeltx/modais/readme.md +++ b/plugins/channeltx/modais/readme.md @@ -34,7 +34,7 @@ This specifies the bandwidth of a LPF that is applied to the output signal to li

6: FM Deviation

-This specifies the maximum frequency deviation. Typically this should be 4.8kHz, giving a modulation index of 0.5 at 9,600 baud. +This specifies the peak frequency deviation. Typically this should be ±4.8kHz, giving a modulation index of 0.5 at 9,600 baud.

7: BT Bandwidth

diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index 81b64257a..c6adcb31e 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -281,10 +281,10 @@ bool NFMMod::handleMessage(const Message& cmd) auto* rep = new DSPSignalNotification(notif); // make a copy qDebug() << "NFMMod::handleMessage: DSPSignalNotification"; m_basebandSource->getInputMessageQueue()->push(rep); - // Forward to GUI if any - if (getMessageQueueToGUI()) { - getMessageQueueToGUI()->push(new DSPSignalNotification(notif)); - } + } + // Forward to GUI if any + if (getMessageQueueToGUI()) { + getMessageQueueToGUI()->push(new DSPSignalNotification(notif)); } return true; diff --git a/plugins/channeltx/modnfm/nfmmodsettings.h b/plugins/channeltx/modnfm/nfmmodsettings.h index 0b2d0e109..d9bf77961 100644 --- a/plugins/channeltx/modnfm/nfmmodsettings.h +++ b/plugins/channeltx/modnfm/nfmmodsettings.h @@ -48,7 +48,7 @@ struct NFMModSettings qint64 m_inputFrequencyOffset; Real m_rfBandwidth; Real m_afBandwidth; - float m_fmDeviation; + float m_fmDeviation; //!< Full deviation in Hz (UI shows peak deviation) float m_toneFrequency; float m_volumeFactor; bool m_channelMute; diff --git a/plugins/channeltx/modnfm/nfmmodsource.cpp b/plugins/channeltx/modnfm/nfmmodsource.cpp index 9e2d295e1..eb7f561c7 100644 --- a/plugins/channeltx/modnfm/nfmmodsource.cpp +++ b/plugins/channeltx/modnfm/nfmmodsource.cpp @@ -171,6 +171,7 @@ void NFMModSource::modulateSample() t1 = m_lowpass.filter(t); } + // The usual factor of 2*pi is cancelled by m_fmDeviation being the full rather than peak deviation m_modPhasor += (float) ((M_PI * m_settings.m_fmDeviation / (float) m_audioSampleRate) * t1); // limit phasor range to ]-pi,pi] diff --git a/plugins/channeltx/modpacket/packetmodgui.cpp b/plugins/channeltx/modpacket/packetmodgui.cpp index 4f35aa7af..37e899521 100644 --- a/plugins/channeltx/modpacket/packetmodgui.cpp +++ b/plugins/channeltx/modpacket/packetmodgui.cpp @@ -151,7 +151,7 @@ void PacketModGUI::on_mode_currentIndexChanged(int value) m_settings.setMode(mode); ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); - ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); ui->glSpectrum->setCenterFrequency(m_settings.m_spectrumRate/4); ui->glSpectrum->setSampleRate(m_settings.m_spectrumRate/2); @@ -173,7 +173,7 @@ void PacketModGUI::on_rfBW_valueChanged(int value) void PacketModGUI::on_fmDev_valueChanged(int value) { - ui->fmDevText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value / 10.0, 0, 'f', 1)); m_settings.m_fmDeviation = value * 100.0; applySettings(QStringList("fmDeviation")); } @@ -593,7 +593,7 @@ void PacketModGUI::displaySettings() ui->rfBWText->setText(QString("%1k").arg(m_settings.m_rfBandwidth / 1000.0, 0, 'f', 1)); ui->rfBW->setValue(m_settings.m_rfBandwidth / 100.0); - ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1)); ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0); ui->gainText->setText(QString("%1").arg((double)m_settings.m_gain, 0, 'f', 1)); diff --git a/plugins/channeltx/modpacket/packetmodgui.ui b/plugins/channeltx/modpacket/packetmodgui.ui index 8df7d2d31..a034dc9a8 100644 --- a/plugins/channeltx/modpacket/packetmodgui.ui +++ b/plugins/channeltx/modpacket/packetmodgui.ui @@ -304,7 +304,7 @@
- Frequency deviation + Peak frequency deviation 10 @@ -332,7 +332,7 @@ - 5.0k + ±5.0k Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/plugins/channeltx/modpacket/readme.md b/plugins/channeltx/modpacket/readme.md index 21af80f69..9257525ed 100644 --- a/plugins/channeltx/modpacket/readme.md +++ b/plugins/channeltx/modpacket/readme.md @@ -32,7 +32,7 @@ This specifies the bandwidth of a LPF that is applied to the output signal to li

6: Frequency deviation

-Adjusts the frequency deviation in 0.1 kHz steps from 1 to 6 kHz. Typical values are 2.5 kHz and 5 kHz. +Adjusts the frequency peak deviation in 0.1 kHz steps from 1 to 6 kHz. Typical values are ±2.5 kHz and ±5 kHz.

7: Gain

diff --git a/plugins/channeltx/modwfm/readme.md b/plugins/channeltx/modwfm/readme.md index e28bc0326..39446160a 100644 --- a/plugins/channeltx/modwfm/readme.md +++ b/plugins/channeltx/modwfm/readme.md @@ -32,7 +32,7 @@ This is the bandwidth in kHz of the modulating signal filtered before modulation

7: Frequency deviation

-Adjusts the frequency deviation in 1 kHz steps from 0 to 100 kHz +Adjusts the peak frequency deviation in 1 kHz steps from 0 to 100 kHz

8: Volume

diff --git a/plugins/channeltx/modwfm/wfmmodgui.cpp b/plugins/channeltx/modwfm/wfmmodgui.cpp index 745fb8c44..1b447146f 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.cpp +++ b/plugins/channeltx/modwfm/wfmmodgui.cpp @@ -172,7 +172,7 @@ void WFMModGUI::on_afBW_valueChanged(int value) void WFMModGUI::on_fmDev_valueChanged(int value) { - ui->fmDevText->setText(QString("%1k").arg(value)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(value)); m_settings.m_fmDeviation = value * 1000.0; applySettings(QStringList("fmDeviation")); } @@ -476,7 +476,7 @@ void WFMModGUI::displaySettings() ui->afBWText->setText(QString("%1k").arg(m_settings.m_afBandwidth / 1000.0)); ui->afBW->setValue(m_settings.m_afBandwidth / 1000.0); - ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0)); + ui->fmDevText->setText(QString("%1%2k").arg(QChar(0xB1, 0x00)).arg(m_settings.m_fmDeviation / 1000.0)); ui->fmDev->setValue(m_settings.m_fmDeviation / 1000.0); ui->volumeText->setText(QString("%1").arg(m_settings.m_volumeFactor, 0, 'f', 1)); diff --git a/plugins/channeltx/modwfm/wfmmodgui.ui b/plugins/channeltx/modwfm/wfmmodgui.ui index 4a8d5bb2b..534534438 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.ui +++ b/plugins/channeltx/modwfm/wfmmodgui.ui @@ -302,7 +302,7 @@
- Modulation percentage + Peak frequency deviation 100 @@ -327,7 +327,7 @@ - 50k + ±50k Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/plugins/channeltx/modwfm/wfmmodsettings.h b/plugins/channeltx/modwfm/wfmmodsettings.h index 3f82d5b41..0bb0b3051 100644 --- a/plugins/channeltx/modwfm/wfmmodsettings.h +++ b/plugins/channeltx/modwfm/wfmmodsettings.h @@ -45,7 +45,7 @@ struct WFMModSettings qint64 m_inputFrequencyOffset; Real m_rfBandwidth; Real m_afBandwidth; - float m_fmDeviation; + float m_fmDeviation; //!< Peak frequency deviation in Hz float m_toneFrequency; float m_volumeFactor; bool m_channelMute; diff --git a/sdrbase/settings/rollupstate.cpp b/sdrbase/settings/rollupstate.cpp index 3dd2499d4..000a9a731 100644 --- a/sdrbase/settings/rollupstate.cpp +++ b/sdrbase/settings/rollupstate.cpp @@ -33,7 +33,7 @@ QByteArray RollupState::serialize() const QDataStream stream(&state, QIODevice::WriteOnly); stream << VersionMarker; stream << m_version; - stream << m_childrenStates.size(); + stream << (int) m_childrenStates.size(); for (const auto &child : m_childrenStates) { diff --git a/sdrgui/gui/rollupcontents.cpp b/sdrgui/gui/rollupcontents.cpp index 0d60add09..a966bb9f3 100644 --- a/sdrgui/gui/rollupcontents.cpp +++ b/sdrgui/gui/rollupcontents.cpp @@ -129,7 +129,7 @@ int RollupContents::arrangeRollups() } int h = 0; if (r->hasHeightForWidth()) { - h = r->heightForWidth(width() - 4); + h = r->heightForWidth(width() - 4); // FIXME: This is preferred height for the given width, not the minimum height. } else { h = r->minimumSizeHint().height(); }