diff --git a/doc/img/XTRXOutput_plugin.png b/doc/img/XTRXOutput_plugin.png index 218112ab3..9ec5126eb 100644 Binary files a/doc/img/XTRXOutput_plugin.png and b/doc/img/XTRXOutput_plugin.png differ diff --git a/doc/img/XTRXOutput_plugin.xcf b/doc/img/XTRXOutput_plugin.xcf index 15700a0de..a920ce46b 100644 Binary files a/doc/img/XTRXOutput_plugin.xcf and b/doc/img/XTRXOutput_plugin.xcf differ diff --git a/plugins/samplesink/limesdroutput/readme.md b/plugins/samplesink/limesdroutput/readme.md index 1caf4d87c..07b07254a 100644 --- a/plugins/samplesink/limesdroutput/readme.md +++ b/plugins/samplesink/limesdroutput/readme.md @@ -154,7 +154,11 @@ Use this toggle button to switch the sample rate input next (10) between host to - **SR**: host to device sample rate input mode. The baseband sample rate (2B) is the host to device sample rate (10) divided by the software interpolation factor (9). - **BB**: baseband sample rate input mode. The host to device sample rate (2B) is the baseband sample rate (8) multiplied by the software interpolation factor (9). -

10: Host to device stream sample rate

+

10: Sample rate

+ +This is the LMS7002M device to/from host stream sample rate or baseband sample rate in samples per second (S/s). The control (10A) is used to switch between the two input modes. The device to/from host stream sample rate is the same for the Rx and Tx systems. + +The limits are adjusted automatically. In baseband input mode the limits are driven by the interpolation factor (9). You may need to increase this interpolation factor to be able to reach lower values. This is the LMS7002M device to/from host stream sample rate in S/s. It is the same for the Rx and Tx systems. diff --git a/plugins/samplesink/xtrxoutput/readme.md b/plugins/samplesink/xtrxoutput/readme.md index d0800d2a2..c641f7d4a 100644 --- a/plugins/samplesink/xtrxoutput/readme.md +++ b/plugins/samplesink/xtrxoutput/readme.md @@ -65,10 +65,11 @@ This is the center frequency of transmission in kHz. LimeSDR is a 2x2 MIMO device so it has two transmitting channels. This shows the corresponding Tx channel index (0 or 1). -

5: Stream sample rate

-Baseband I/Q sample rate in kS/s. This is the device to host sample rate (11) divided by the software interpolation factor (10). +In host to device sample rate input mode (11A) this is the baseband I/Q sample rate in kS/s. This is the host to device sample rate (11) divided by the software interpolation factor (10). + +In baseband sample rate input mode (11A) this is the host to device sample rate in kS/s. This is the baseband sample rate (11) multiplied by the software interpolation factor (10)

6: NCO toggle

@@ -118,9 +119,18 @@ The first position in the combo is marked as "A". This is because interpolation The I/Q stream from the baseband is upsampled by a power of two by software inside the plugin before being sent to the LimeSDR device. Possible values are increasing powers of two: 1 (no interpolation), 2, 4, 8, 16, 32. -

11: Host to device stream sample rate

+

11A: Host to device sample rate / Baseband sample rate input toggle

-This is the LMS7002M device to/from host stream sample rate in S/s. It is the same for the Rx and Tx systems. +Use this toggle button to switch the sample rate input next (10) between host to device sample rate and baseband sample rate input. The button shows the current mode: + + - **SR**: host to device sample rate input mode. The baseband sample rate (5) is the host to device sample rate (11) divided by the software interpolation factor (10). + - **BB**: baseband sample rate input mode. The host to device sample rate (5) is the baseband sample rate (11) multiplied by the software interpolation factor (10). + +

11: Sample rate

+ +This is the LMS7002M device to/from host stream sample rate or baseband sample rate in samples per second (S/s). The control (11A) is used to switch between the two input modes. The device to/from host stream sample rate is the same for the Rx and Tx systems. + +The limits are adjusted automatically. In baseband input mode the limits are driven by the interpolation factor (10). You may need to increase this interpolation factor to be able to reach lower values. Use the wheels to adjust the sample rate. Pressing shift simultaneously moves digit by 5 and pressing control moves it by 2. Left click on a digit sets the cursor position at this digit. Right click on a digit sets all digits on the right to zero. This effectively floors value at the digit position. Wheels are moved with the mousewheel while pointing at the wheel or by selecting the wheel with the left mouse click and using the keyboard arrows. diff --git a/plugins/samplesink/xtrxoutput/xtrxoutputgui.cpp b/plugins/samplesink/xtrxoutput/xtrxoutputgui.cpp index 8962fe39f..edb16de1a 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutputgui.cpp +++ b/plugins/samplesink/xtrxoutput/xtrxoutputgui.cpp @@ -35,6 +35,7 @@ XTRXOutputGUI::XTRXOutputGUI(DeviceUISet *deviceUISet, QWidget* parent) : ui(new Ui::XTRXOutputGUI), m_deviceUISet(deviceUISet), m_settings(), + m_sampleRateMode(true), m_sampleRate(0), m_lastEngineState((DSPDeviceSinkEngine::State)-1), m_doApplySettings(true), @@ -275,7 +276,39 @@ void XTRXOutputGUI::updateSampleRateAndFrequency() { m_deviceUISet->getSpectrum()->setSampleRate(m_sampleRate); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); - ui->deviceRateLabel->setText(tr("%1k").arg(QString::number(m_sampleRate / 1000.0f, 'g', 5))); + displaySampleRate(); +} + +void XTRXOutputGUI::displaySampleRate() +{ + float minF, maxF, stepF; + m_XTRXOutput->getSRRange(minF, maxF, stepF); + + ui->sampleRate->blockSignals(true); + + if (m_sampleRateMode) + { + ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(60,60,60); }"); + ui->sampleRateMode->setText("SR"); + ui->sampleRate->setValueRange(8, (uint32_t) minF, (uint32_t) maxF); + ui->sampleRate->setValue(m_settings.m_devSampleRate); + ui->sampleRate->setToolTip("Device to host sample rate (S/s)"); + ui->deviceRateText->setToolTip("Baseband sample rate (S/s)"); + uint32_t basebandSampleRate = m_settings.m_devSampleRate/(1<deviceRateText->setText(tr("%1k").arg(QString::number(basebandSampleRate / 1000.0f, 'g', 5))); + } + else + { + ui->sampleRateMode->setStyleSheet("QToolButton { background:rgb(50,50,50); }"); + ui->sampleRateMode->setText("BB"); + ui->sampleRate->setValueRange(8, (uint32_t) minF/(1<sampleRate->setValue(m_settings.m_devSampleRate/(1<sampleRate->setToolTip("Baseband sample rate (S/s)"); + ui->deviceRateText->setToolTip("Device to host sample rate (S/s)"); + ui->deviceRateText->setText(tr("%1k").arg(QString::number(m_settings.m_devSampleRate / 1000.0f, 'g', 5))); + } + + ui->sampleRate->blockSignals(false); } void XTRXOutputGUI::displaySettings() @@ -284,7 +317,7 @@ void XTRXOutputGUI::displaySettings() ui->extClock->setExternalClockActive(m_settings.m_extClock); setCenterFrequencyDisplay(); - ui->sampleRate->setValue(m_settings.m_devSampleRate); + displaySampleRate(); ui->hwInterp->setCurrentIndex(m_settings.m_log2HardInterp); ui->swInterp->setCurrentIndex(m_settings.m_log2SoftInterp); @@ -454,16 +487,24 @@ void XTRXOutputGUI::on_ncoEnable_toggled(bool checked) void XTRXOutputGUI::on_sampleRate_changed(quint64 value) { - m_settings.m_devSampleRate = value; + if (m_sampleRateMode) { + m_settings.m_devSampleRate = value; + } else { + m_settings.m_devSampleRate = value * (1 << m_settings.m_log2SoftInterp); + } + updateDACRate(); setNCODisplay(); sendSettings();} void XTRXOutputGUI::on_hwInterp_currentIndexChanged(int index) { - if ((index <0) || (index > 5)) + if ((index <0) || (index > 5)) { return; + } + m_settings.m_log2HardInterp = index; + updateDACRate(); setNCODisplay(); sendSettings(); @@ -471,9 +512,19 @@ void XTRXOutputGUI::on_hwInterp_currentIndexChanged(int index) void XTRXOutputGUI::on_swInterp_currentIndexChanged(int index) { - if ((index <0) || (index > 6)) + if ((index <0) || (index > 6)) { return; + } + m_settings.m_log2SoftInterp = index; + displaySampleRate(); + + if (m_sampleRateMode) { + m_settings.m_devSampleRate = ui->sampleRate->getValueNew(); + } else { + m_settings.m_devSampleRate = ui->sampleRate->getValueNew() * (1 << m_settings.m_log2SoftInterp); + } + sendSettings(); } @@ -510,6 +561,12 @@ void XTRXOutputGUI::on_pwrmode_currentIndexChanged(int index) sendSettings(); } +void XTRXOutputGUI::on_sampleRateMode_toggled(bool checked) +{ + m_sampleRateMode = checked; + displaySampleRate(); +} + void XTRXOutputGUI::openDeviceSettingsDialog(const QPoint& p) { BasicDeviceSettingsDialog dialog(this); diff --git a/plugins/samplesink/xtrxoutput/xtrxoutputgui.h b/plugins/samplesink/xtrxoutput/xtrxoutputgui.h index 6340b0455..7d0eb728d 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutputgui.h +++ b/plugins/samplesink/xtrxoutput/xtrxoutputgui.h @@ -56,6 +56,7 @@ private: DeviceUISet* m_deviceUISet; XTRXOutput* m_XTRXOutput; //!< Same object as above but gives easy access to XTRXInput methods and attributes that are used intensively XTRXOutputSettings m_settings; + bool m_sampleRateMode; //!< true: device, false: base band sample rate update mode QTimer m_updateTimer; QTimer m_statusTimer; int m_sampleRate; @@ -68,6 +69,7 @@ private: MessageQueue m_inputMessageQueue; void displaySettings(); + void displaySampleRate(); void setNCODisplay(); void setCenterFrequencyDisplay(); void setCenterFrequencySetting(uint64_t kHzValue); @@ -90,6 +92,7 @@ private slots: void on_antenna_currentIndexChanged(int index); void on_extClock_clicked(); void on_pwrmode_currentIndexChanged(int index); + void on_sampleRateMode_toggled(bool checked); void updateHardware(); void updateStatus(); diff --git a/plugins/samplesink/xtrxoutput/xtrxoutputgui.ui b/plugins/samplesink/xtrxoutput/xtrxoutputgui.ui index 6b2492b4e..cb0959f02 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutputgui.ui +++ b/plugins/samplesink/xtrxoutput/xtrxoutputgui.ui @@ -185,7 +185,7 @@ - + 54 @@ -433,16 +433,28 @@ - - - - 0 - 0 - + + + + 24 + 0 + + + + + 24 + 16777215 + SR + + true + + + true + diff --git a/plugins/samplesink/xtrxoutput/xtrxoutputthread.cpp b/plugins/samplesink/xtrxoutput/xtrxoutputthread.cpp index e10274642..62c52594e 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutputthread.cpp +++ b/plugins/samplesink/xtrxoutput/xtrxoutputthread.cpp @@ -129,6 +129,7 @@ void XTRXOutputThread::run() params.tx.chs = XTRX_CH_AB; params.tx.wfmt = XTRX_WF_16; params.tx.hfmt = XTRX_IQ_INT16; + params.tx.flags |= XTRX_RSP_SWAP_IQ; if (m_nbChannels == 1) { diff --git a/plugins/samplesource/limesdrinput/readme.md b/plugins/samplesource/limesdrinput/readme.md index 9803f57b3..f2e49b86c 100644 --- a/plugins/samplesource/limesdrinput/readme.md +++ b/plugins/samplesource/limesdrinput/readme.md @@ -117,9 +117,11 @@ Use this toggle button to switch the sample rate input next (8) between device t - **SR**: device to host sample rate input mode. The baseband sample rate (1.5) is the device to host sample rate (6) divided by the software decimation factor (4). - **BB**: baseband sample rate input mode. The device to host sample rate (1.5) is the baseband sample rate (8) multiplied by the software decimation factor (4). -

6: Device to host stream sample rate

+

6: Sample rate

-This is the LMS7002M device to/from host stream sample rate in S/s. It is the same for the Rx and Tx systems. +This is the LMS7002M device to/from host stream sample rate or baseband sample rate in samples per second (S/s). The control (5) is used to switch between the two input modes. The device to/from host stream sample rate is the same for the Rx and Tx systems. + +The limits are adjusted automatically. In baseband input mode the limits are driven by the decimation factor (4). You may need to increase this decimation factor to be able to reach lower values. Use the wheels to adjust the sample rate. Pressing shift simultaneously moves digit by 5 and pressing control moves it by 2. Left click on a digit sets the cursor position at this digit. Right click on a digit sets all digits on the right to zero. This effectively floors value at the digit position. Wheels are moved with the mousewheel while pointing at the wheel or by selecting the wheel with the left mouse click and using the keyboard arrows.