diff --git a/fcdlib/fcdtraits.cpp b/fcdlib/fcdtraits.cpp index 7317531e7..883137f12 100644 --- a/fcdlib/fcdtraits.cpp +++ b/fcdlib/fcdtraits.cpp @@ -34,8 +34,8 @@ const char *fcd_traits::displayedName = "FunCube Dongle Pro+"; const char *fcd_traits::pluginDisplayedName = "FunCube Pro Input"; const char *fcd_traits::pluginDisplayedName = "FunCube Pro+ Input"; -const char *fcd_traits::pluginVersion = "4.3.2"; -const char *fcd_traits::pluginVersion = "4.3.2"; +const char *fcd_traits::pluginVersion = "4.4.0"; +const char *fcd_traits::pluginVersion = "4.4.0"; const int64_t fcd_traits::loLowLimitFreq = 64000000L; const int64_t fcd_traits::loLowLimitFreq = 150000L; diff --git a/plugins/samplesink/plutosdroutput/plutosdroutputplugin.cpp b/plugins/samplesink/plutosdroutput/plutosdroutputplugin.cpp index e1fc9d661..182ffd063 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutputplugin.cpp +++ b/plugins/samplesink/plutosdroutput/plutosdroutputplugin.cpp @@ -30,7 +30,7 @@ class DeviceSourceAPI; const PluginDescriptor PlutoSDROutputPlugin::m_pluginDescriptor = { QString("PlutoSDR Output"), - QString("4.3.2"), + QString("4.4.0"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/samplesource/fcdpro/fcdprogui.cpp b/plugins/samplesource/fcdpro/fcdprogui.cpp index ffb6ae1af..4a5ad80a7 100644 --- a/plugins/samplesource/fcdpro/fcdprogui.cpp +++ b/plugins/samplesource/fcdpro/fcdprogui.cpp @@ -308,6 +308,7 @@ void FCDProGui::displaySettings() ui->gain4->setCurrentIndex(m_settings.m_gain4Index); ui->gain5->setCurrentIndex(m_settings.m_gain5Index); ui->gain6->setCurrentIndex(m_settings.m_gain6Index); + ui->decim->setCurrentIndex(m_settings.m_log2Decim); ui->rcFilter->setCurrentIndex(m_settings.m_rcFilterIndex); ui->ifFilter->setCurrentIndex(m_settings.m_ifFilterIndex); } @@ -439,6 +440,16 @@ void FCDProGui::on_gain6_currentIndexChanged(int index) sendSettings(); } +void FCDProGui::on_decim_currentIndexChanged(int index) +{ + if ((index < 0) || (index > 6)) { + return; + } + + m_settings.m_log2Decim = index; + sendSettings(); +} + void FCDProGui::on_setDefaults_clicked(bool checked) { (void) checked; diff --git a/plugins/samplesource/fcdpro/fcdprogui.h b/plugins/samplesource/fcdpro/fcdprogui.h index 4b807f1ab..2099b5932 100644 --- a/plugins/samplesource/fcdpro/fcdprogui.h +++ b/plugins/samplesource/fcdpro/fcdprogui.h @@ -96,6 +96,7 @@ private slots: void on_ifFilter_currentIndexChanged(int index); void on_gain5_currentIndexChanged(int index); void on_gain6_currentIndexChanged(int index); + void on_decim_currentIndexChanged(int index); void on_setDefaults_clicked(bool checked); void on_startStop_toggled(bool checked); void on_record_toggled(bool checked); diff --git a/plugins/samplesource/fcdpro/fcdprogui.ui b/plugins/samplesource/fcdpro/fcdprogui.ui index ad9e7c918..7336199b2 100644 --- a/plugins/samplesource/fcdpro/fcdprogui.ui +++ b/plugins/samplesource/fcdpro/fcdprogui.ui @@ -224,7 +224,7 @@ DC offset auto correction - DC offset + DC @@ -234,10 +234,63 @@ IQ imbalance auto correction - IQ imbalance + IQ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Dec + + + + + + + + 50 + 16777215 + + + + Decimation factor + + + + 1 + + + + + 2 + + + + + 4 + + + + + 8 + + + + diff --git a/plugins/samplesource/fcdpro/fcdproinput.cpp b/plugins/samplesource/fcdpro/fcdproinput.cpp index ac6e8cef1..eef2afad6 100644 --- a/plugins/samplesource/fcdpro/fcdproinput.cpp +++ b/plugins/samplesource/fcdpro/fcdproinput.cpp @@ -235,7 +235,7 @@ const QString& FCDProInput::getDeviceDescription() const int FCDProInput::getSampleRate() const { - return fcd_traits::sampleRate; + return fcd_traits::sampleRate/(1<setLog2Decimation(settings.m_log2Decim); + qDebug() << "FCDProInput::applySettings: set decimation to " << (1<::sampleRate, m_settings.m_centerFrequency); + DSPSignalNotification *notif = new DSPSignalNotification(fcd_traits::sampleRate/(1<handleMessage(*notif); // forward to file sink m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif); } diff --git a/plugins/samplesource/fcdpro/fcdprosettings.cpp b/plugins/samplesource/fcdpro/fcdprosettings.cpp index 18e809f4b..0aa2fb4d6 100644 --- a/plugins/samplesource/fcdpro/fcdprosettings.cpp +++ b/plugins/samplesource/fcdpro/fcdprosettings.cpp @@ -45,6 +45,7 @@ void FCDProSettings::resetToDefaults() m_ifFilterIndex = 0; m_gain5Index = 0; m_gain6Index = 0; + m_log2Decim = 0; m_transverterMode = false; m_transverterDeltaFrequency = 0; m_fileRecordName = ""; @@ -77,12 +78,13 @@ QByteArray FCDProSettings::serialize() const s.writeS32(17, m_ifFilterIndex); s.writeS32(18, m_gain5Index); s.writeS32(19, m_gain6Index); - s.writeBool(20, m_transverterMode); - s.writeS64(21, m_transverterDeltaFrequency); - s.writeBool(22, m_useReverseAPI); - s.writeString(23, m_reverseAPIAddress); - s.writeU32(24, m_reverseAPIPort); - s.writeU32(25, m_reverseAPIDeviceIndex); + s.writeU32(20, m_log2Decim); + s.writeBool(21, m_transverterMode); + s.writeS64(22, m_transverterDeltaFrequency); + s.writeBool(23, m_useReverseAPI); + s.writeString(24, m_reverseAPIAddress); + s.writeU32(25, m_reverseAPIPort); + s.writeU32(26, m_reverseAPIDeviceIndex); return s.final(); } @@ -120,11 +122,12 @@ bool FCDProSettings::deserialize(const QByteArray& data) d.readS32(17, &m_ifFilterIndex, 0); d.readS32(18, &m_gain5Index, 0); d.readS32(19, &m_gain6Index, 0); - d.readBool(20, &m_transverterMode, false); - d.readS64(21, &m_transverterDeltaFrequency, 0); - d.readBool(22, &m_useReverseAPI, false); - d.readString(23, &m_reverseAPIAddress, "127.0.0.1"); - d.readU32(24, &uintval, 0); + d.readU32(20, &m_log2Decim, 0); + d.readBool(21, &m_transverterMode, false); + d.readS64(22, &m_transverterDeltaFrequency, 0); + d.readBool(23, &m_useReverseAPI, false); + d.readString(24, &m_reverseAPIAddress, "127.0.0.1"); + d.readU32(25, &uintval, 0); if ((uintval > 1023) && (uintval < 65535)) { m_reverseAPIPort = uintval; @@ -132,7 +135,7 @@ bool FCDProSettings::deserialize(const QByteArray& data) m_reverseAPIPort = 8888; } - d.readU32(25, &uintval, 0); + d.readU32(26, &uintval, 0); m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval; return true; diff --git a/plugins/samplesource/fcdpro/fcdprosettings.h b/plugins/samplesource/fcdpro/fcdprosettings.h index 4ef9d1d8e..c4f60b893 100644 --- a/plugins/samplesource/fcdpro/fcdprosettings.h +++ b/plugins/samplesource/fcdpro/fcdprosettings.h @@ -38,6 +38,7 @@ struct FCDProSettings { qint32 m_ifFilterIndex; qint32 m_gain5Index; qint32 m_gain6Index; + quint32 m_log2Decim; bool m_dcBlock; bool m_iqCorrection; bool m_transverterMode; diff --git a/plugins/samplesource/fcdpro/fcdprothread.cpp b/plugins/samplesource/fcdpro/fcdprothread.cpp index 7b4152b2e..d4961031c 100644 --- a/plugins/samplesource/fcdpro/fcdprothread.cpp +++ b/plugins/samplesource/fcdpro/fcdprothread.cpp @@ -60,6 +60,11 @@ void FCDProThread::stopWork() wait(); } +void FCDProThread::setLog2Decimation(unsigned int log2_decim) +{ + m_log2Decim = log2_decim; +} + void FCDProThread::run() { m_running = true; @@ -79,6 +84,24 @@ void FCDProThread::work(unsigned int n_items) { uint32_t nbRead = m_fcdFIFO->read((unsigned char *) m_buf, n_items); // number of samples SampleVector::iterator it = m_convertBuffer.begin(); - m_decimators.decimate1(&it, m_buf, 2*nbRead); + + switch (m_log2Decim) + { + case 0: + m_decimators.decimate1(&it, m_buf, 2*nbRead); + break; + case 1: + m_decimators.decimate2_cen(&it, m_buf, 2*nbRead); + break; + case 2: + m_decimators.decimate4_cen(&it, m_buf, 2*nbRead); + break; + case 3: + m_decimators.decimate8_cen(&it, m_buf, 2*nbRead); + break; + default: + break; + } + m_sampleFifo->write(m_convertBuffer.begin(), it); } diff --git a/plugins/samplesource/fcdpro/fcdprothread.h b/plugins/samplesource/fcdpro/fcdprothread.h index 05891cd92..9bb3a8f67 100644 --- a/plugins/samplesource/fcdpro/fcdprothread.h +++ b/plugins/samplesource/fcdpro/fcdprothread.h @@ -36,6 +36,7 @@ public: void startWork(); void stopWork(); + void setLog2Decimation(unsigned int log2_decim); private: AudioFifo* m_fcdFIFO; @@ -43,6 +44,7 @@ private: QMutex m_startWaitMutex; QWaitCondition m_startWaiter; bool m_running; + unsigned int m_log2Decim; qint16 m_buf[fcd_traits::convBufSize*2]; // stereo (I, Q) SampleVector m_convertBuffer; diff --git a/plugins/samplesource/fcdproplus/fcdproplusgui.cpp b/plugins/samplesource/fcdproplus/fcdproplusgui.cpp index 5f2c92d77..ec08e4a98 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusgui.cpp +++ b/plugins/samplesource/fcdproplus/fcdproplusgui.cpp @@ -209,6 +209,7 @@ void FCDProPlusGui::displaySettings() ui->transverter->setDeltaFrequencyActive(m_settings.m_transverterMode); updateFrequencyLimits(); ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000); + ui->decim->setCurrentIndex(m_settings.m_log2Decim); ui->dcOffset->setChecked(m_settings.m_dcBlock); ui->iqImbalance->setChecked(m_settings.m_iqImbalance); ui->checkBoxG->setChecked(m_settings.m_lnaGain); @@ -234,6 +235,16 @@ void FCDProPlusGui::on_centerFrequency_changed(quint64 value) sendSettings(); } +void FCDProPlusGui::on_decim_currentIndexChanged(int index) +{ + if ((index < 0) || (index > 6)) { + return; + } + + m_settings.m_log2Decim = index; + sendSettings(); +} + void FCDProPlusGui::on_dcOffset_toggled(bool checked) { m_settings.m_dcBlock = checked; diff --git a/plugins/samplesource/fcdproplus/fcdproplusgui.h b/plugins/samplesource/fcdproplus/fcdproplusgui.h index 81649fb11..a18cd65d0 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusgui.h +++ b/plugins/samplesource/fcdproplus/fcdproplusgui.h @@ -75,6 +75,7 @@ private: private slots: void handleInputMessages(); void on_centerFrequency_changed(quint64 value); + void on_decim_currentIndexChanged(int index); void on_dcOffset_toggled(bool checked); void on_iqImbalance_toggled(bool checked); void on_checkBoxG_stateChanged(int state); diff --git a/plugins/samplesource/fcdproplus/fcdproplusgui.ui b/plugins/samplesource/fcdproplus/fcdproplusgui.ui index 983ee0050..57e8632b1 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusgui.ui +++ b/plugins/samplesource/fcdproplus/fcdproplusgui.ui @@ -224,7 +224,7 @@ Automatic DC offset removal - DC offset + DC @@ -234,10 +234,62 @@ Automatic IQ imbalance correction - IQ imbalance + IQ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Dec + + + + + + + Decimation factor + + + + 1 + + + + + 2 + + + + + 4 + + + + + 8 + + + + + 16 + + + + diff --git a/plugins/samplesource/fcdproplus/fcdproplusinput.cpp b/plugins/samplesource/fcdproplus/fcdproplusinput.cpp index 809d603ea..9fce14197 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusinput.cpp +++ b/plugins/samplesource/fcdproplus/fcdproplusinput.cpp @@ -237,7 +237,7 @@ const QString& FCDProPlusInput::getDeviceDescription() const int FCDProPlusInput::getSampleRate() const { - return fcd_traits::sampleRate; + return fcd_traits::sampleRate/(1<setLog2Decimation(settings.m_log2Decim); + qDebug() << "FCDProPlusInput::applySettings: set decimation to " << (1<::sampleRate, m_settings.m_centerFrequency); + DSPSignalNotification *notif = new DSPSignalNotification(fcd_traits::sampleRate/(1<handleMessage(*notif); // forward to file sink m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif); } diff --git a/plugins/samplesource/fcdproplus/fcdproplussettings.cpp b/plugins/samplesource/fcdproplus/fcdproplussettings.cpp index ba6d46367..9eab36203 100644 --- a/plugins/samplesource/fcdproplus/fcdproplussettings.cpp +++ b/plugins/samplesource/fcdproplus/fcdproplussettings.cpp @@ -34,6 +34,7 @@ void FCDProPlusSettings::resetToDefaults() m_rfFilterIndex = 0; m_ifFilterIndex = 0; m_LOppmTenths = 0; + m_log2Decim = 0; m_dcBlock = false; m_iqImbalance = false; m_transverterMode = false; @@ -54,16 +55,17 @@ QByteArray FCDProPlusSettings::serialize() const s.writeBool(3, m_mixGain); s.writeS32(4, m_ifFilterIndex); s.writeS32(5, m_rfFilterIndex); - s.writeBool(6, m_dcBlock); - s.writeBool(7, m_iqImbalance); - s.writeS32(8, m_LOppmTenths); - s.writeU32(9, m_ifGain); - s.writeBool(10, m_transverterMode); - s.writeS64(11, m_transverterDeltaFrequency); - s.writeBool(12, m_useReverseAPI); - s.writeString(13, m_reverseAPIAddress); - s.writeU32(14, m_reverseAPIPort); - s.writeU32(15, m_reverseAPIDeviceIndex); + s.writeU32(6, m_log2Decim); + s.writeBool(7, m_dcBlock); + s.writeBool(8, m_iqImbalance); + s.writeS32(9, m_LOppmTenths); + s.writeU32(10, m_ifGain); + s.writeBool(11, m_transverterMode); + s.writeS64(12, m_transverterDeltaFrequency); + s.writeBool(13, m_useReverseAPI); + s.writeString(14, m_reverseAPIAddress); + s.writeU32(15, m_reverseAPIPort); + s.writeU32(16, m_reverseAPIDeviceIndex); return s.final(); } @@ -87,15 +89,16 @@ bool FCDProPlusSettings::deserialize(const QByteArray& data) d.readBool(3, &m_mixGain, true); d.readS32(4, &m_ifFilterIndex, 0); d.readS32(5, &m_rfFilterIndex, 0); - d.readBool(6, &m_dcBlock, false); - d.readBool(7, &m_iqImbalance, false); - d.readS32(8, &m_LOppmTenths, 0); - d.readU32(9, &m_ifGain, 0); - d.readBool(10, &m_transverterMode, false); - d.readS64(11, &m_transverterDeltaFrequency, 0); - d.readBool(12, &m_useReverseAPI, false); - d.readString(13, &m_reverseAPIAddress, "127.0.0.1"); - d.readU32(14, &uintval, 0); + d.readU32(6, &m_log2Decim, 0); + d.readBool(7, &m_dcBlock, false); + d.readBool(8, &m_iqImbalance, false); + d.readS32(9, &m_LOppmTenths, 0); + d.readU32(10, &m_ifGain, 0); + d.readBool(11, &m_transverterMode, false); + d.readS64(12, &m_transverterDeltaFrequency, 0); + d.readBool(13, &m_useReverseAPI, false); + d.readString(14, &m_reverseAPIAddress, "127.0.0.1"); + d.readU32(15, &uintval, 0); if ((uintval > 1023) && (uintval < 65535)) { m_reverseAPIPort = uintval; @@ -103,7 +106,7 @@ bool FCDProPlusSettings::deserialize(const QByteArray& data) m_reverseAPIPort = 8888; } - d.readU32(15, &uintval, 0); + d.readU32(16, &uintval, 0); m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval; return true; } diff --git a/plugins/samplesource/fcdproplus/fcdproplussettings.h b/plugins/samplesource/fcdproplus/fcdproplussettings.h index 7d505dcb4..ded2084de 100644 --- a/plugins/samplesource/fcdproplus/fcdproplussettings.h +++ b/plugins/samplesource/fcdproplus/fcdproplussettings.h @@ -29,6 +29,7 @@ struct FCDProPlusSettings { qint32 m_ifFilterIndex; qint32 m_rfFilterIndex; qint32 m_LOppmTenths; + quint32 m_log2Decim; bool m_dcBlock; bool m_iqImbalance; bool m_transverterMode; diff --git a/plugins/samplesource/fcdproplus/fcdproplusthread.cpp b/plugins/samplesource/fcdproplus/fcdproplusthread.cpp index 4a6f27f2a..dd88b206e 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusthread.cpp +++ b/plugins/samplesource/fcdproplus/fcdproplusthread.cpp @@ -59,6 +59,11 @@ void FCDProPlusThread::stopWork() wait(); } +void FCDProPlusThread::setLog2Decimation(unsigned int log2_decim) +{ + m_log2Decim = log2_decim; +} + void FCDProPlusThread::run() { m_running = true; @@ -78,6 +83,27 @@ void FCDProPlusThread::work(unsigned int n_items) { uint32_t nbRead = m_fcdFIFO->read((unsigned char *) m_buf, n_items); // number of samples SampleVector::iterator it = m_convertBuffer.begin(); - m_decimators.decimate1(&it, m_buf, 2*nbRead); + + switch (m_log2Decim) + { + case 0: + m_decimators.decimate1(&it, m_buf, 2*nbRead); + break; + case 1: + m_decimators.decimate2_cen(&it, m_buf, 2*nbRead); + break; + case 2: + m_decimators.decimate4_cen(&it, m_buf, 2*nbRead); + break; + case 3: + m_decimators.decimate8_cen(&it, m_buf, 2*nbRead); + break; + case 4: + m_decimators.decimate16_cen(&it, m_buf, 2*nbRead); + break; + default: + break; + } + m_sampleFifo->write(m_convertBuffer.begin(), it); } diff --git a/plugins/samplesource/fcdproplus/fcdproplusthread.h b/plugins/samplesource/fcdproplus/fcdproplusthread.h index d8b7a7961..62621d782 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusthread.h +++ b/plugins/samplesource/fcdproplus/fcdproplusthread.h @@ -37,6 +37,7 @@ public: void startWork(); void stopWork(); + void setLog2Decimation(unsigned int log2_decim); private: AudioFifo* m_fcdFIFO; @@ -44,6 +45,7 @@ private: QMutex m_startWaitMutex; QWaitCondition m_startWaiter; bool m_running; + unsigned int m_log2Decim; qint16 m_buf[fcd_traits::convBufSize*2]; // stereo (I, Q) SampleVector m_convertBuffer; diff --git a/plugins/samplesource/plutosdrinput/plutosdrinputplugin.cpp b/plugins/samplesource/plutosdrinput/plutosdrinputplugin.cpp index bbfae06d6..b5beaaff3 100644 --- a/plugins/samplesource/plutosdrinput/plutosdrinputplugin.cpp +++ b/plugins/samplesource/plutosdrinput/plutosdrinputplugin.cpp @@ -30,7 +30,7 @@ class DeviceSourceAPI; const PluginDescriptor PlutoSDRInputPlugin::m_pluginDescriptor = { QString("PlutoSDR Input"), - QString("4.3.2"), + QString("4.4.0"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true,