diff --git a/doc/img/PlutoSDROutput_plugin.png b/doc/img/PlutoSDROutput_plugin.png index 9bfebf06c..d728b849f 100644 Binary files a/doc/img/PlutoSDROutput_plugin.png and b/doc/img/PlutoSDROutput_plugin.png differ diff --git a/plugins/samplesink/plutosdroutput/plutosdroutput.cpp b/plugins/samplesink/plutosdroutput/plutosdroutput.cpp index 39459fff3..e979fe627 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutput.cpp +++ b/plugins/samplesink/plutosdroutput/plutosdroutput.cpp @@ -343,11 +343,23 @@ bool PlutoSDROutput::applySettings(const PlutoSDROutputSettings& settings, bool std::vector params; bool paramsToSet = false; - if ((m_settings.m_centerFrequency != settings.m_centerFrequency) || force) + if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency) + || (m_settings.m_transverterMode != settings.m_transverterMode) + || (m_settings.m_transverterDeltaFrequency != settings.m_transverterDeltaFrequency)) + { - params.push_back(QString(tr("out_altvoltage1_TX_LO_frequency=%1").arg(settings.m_centerFrequency)).toStdString()); + qint64 deviceCenterFrequency = settings.m_centerFrequency; + deviceCenterFrequency -= settings.m_transverterMode ? settings.m_transverterDeltaFrequency : 0; + deviceCenterFrequency = deviceCenterFrequency < 0 ? 0 : deviceCenterFrequency; + + + params.push_back(QString(tr("out_altvoltage1_TX_LO_frequency=%1").arg(deviceCenterFrequency)).toStdString()); paramsToSet = true; forwardChangeOwnDSP = true; + + qDebug() << "PlutoSDROutput::applySettings: center freq: " << settings.m_centerFrequency << " Hz" + << " device center freq: " << deviceCenterFrequency << " Hz"; + } if ((m_settings.m_lpfBW != settings.m_lpfBW) || force) diff --git a/plugins/samplesink/plutosdroutput/plutosdroutputgui.cpp b/plugins/samplesink/plutosdroutput/plutosdroutputgui.cpp index 8d4a48521..893c2055e 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutputgui.cpp +++ b/plugins/samplesink/plutosdroutput/plutosdroutputgui.cpp @@ -44,7 +44,7 @@ PlutoSDROutputGUI::PlutoSDROutputGUI(DeviceSinkAPI *deviceAPI, QWidget* parent) ui->setupUi(this); ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); - ui->centerFrequency->setValueRange(7, DevicePlutoSDR::loLowLimitFreq/1000, DevicePlutoSDR::loHighLimitFreq/1000); + updateFrequencyLimits(); ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow)); ui->sampleRate->setValueRange(8, DevicePlutoSDR::srLowLimitFreq, DevicePlutoSDR::srHighLimitFreq); @@ -238,8 +238,21 @@ void PlutoSDROutputGUI::on_antenna_currentIndexChanged(int index) sendSettings(); } +void PlutoSDROutputGUI::on_transverter_clicked() +{ + m_settings.m_transverterMode = ui->transverter->getDeltaFrequencyAcive(); + m_settings.m_transverterDeltaFrequency = ui->transverter->getDeltaFrequency(); + qDebug("PlutoSDROutputGUI::on_transverter_clicked: %lld Hz %s", m_settings.m_transverterDeltaFrequency, m_settings.m_transverterMode ? "on" : "off"); + updateFrequencyLimits(); + m_settings.m_centerFrequency = ui->centerFrequency->getValueNew()*1000; + sendSettings(); +} + void PlutoSDROutputGUI::displaySettings() { + ui->transverter->setDeltaFrequency(m_settings.m_transverterDeltaFrequency); + ui->transverter->setDeltaFrequencyActive(m_settings.m_transverterMode); + updateFrequencyLimits(); ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000); ui->sampleRate->setValue(m_settings.m_devSampleRate); @@ -362,6 +375,21 @@ void PlutoSDROutputGUI::setSampleRateLimits() ui->sampleRate->setValue(m_settings.m_devSampleRate); } +void PlutoSDROutputGUI::updateFrequencyLimits() +{ + // values in kHz + qint64 deltaFrequency = m_settings.m_transverterMode ? m_settings.m_transverterDeltaFrequency/1000 : 0; + qint64 minLimit = DevicePlutoSDR::loLowLimitFreq/1000 + deltaFrequency; + qint64 maxLimit = DevicePlutoSDR::loHighLimitFreq/1000 + deltaFrequency; + + minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit; + maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit; + + qDebug("PlutoSDRInputGui::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit); + + ui->centerFrequency->setValueRange(7, minLimit, maxLimit); +} + void PlutoSDROutputGUI::handleInputMessages() { Message* message; diff --git a/plugins/samplesink/plutosdroutput/plutosdroutputgui.h b/plugins/samplesink/plutosdroutput/plutosdroutputgui.h index 570a9e93e..235624f04 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutputgui.h +++ b/plugins/samplesink/plutosdroutput/plutosdroutputgui.h @@ -72,6 +72,7 @@ private: void updateSampleRateAndFrequency(); void setFIRBWLimits(); void setSampleRateLimits(); + void updateFrequencyLimits(); private slots: void on_startStop_toggled(bool checked); @@ -86,6 +87,7 @@ private slots: void on_lpFIRGain_currentIndexChanged(int index); void on_att_valueChanged(int value); void on_antenna_currentIndexChanged(int index); + void on_transverter_clicked(); void updateHardware(); void updateStatus(); void handleInputMessages(); diff --git a/plugins/samplesink/plutosdroutput/plutosdroutputgui.ui b/plugins/samplesink/plutosdroutput/plutosdroutputgui.ui index a8c7e7183..ea61bf9c4 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutputgui.ui +++ b/plugins/samplesink/plutosdroutput/plutosdroutputgui.ui @@ -240,6 +240,22 @@ + + + + + 24 + 24 + + + + Transverter frequency translation dialog + + + X + + + @@ -766,6 +782,11 @@ QToolButton
gui/buttonswitch.h
+ + TransverterButton + QPushButton +
gui/transverterbutton.h
+
diff --git a/plugins/samplesink/plutosdroutput/plutosdroutputsettings.cpp b/plugins/samplesink/plutosdroutput/plutosdroutputsettings.cpp index 631da14d6..21ef340c4 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutputsettings.cpp +++ b/plugins/samplesink/plutosdroutput/plutosdroutputsettings.cpp @@ -36,6 +36,8 @@ void PlutoSDROutputSettings::resetToDefaults() m_lpfFIRlog2Interp = 0; m_att = -50; m_antennaPath = RFPATH_A; + m_transverterMode = false; + m_transverterDeltaFrequency = 0; } QByteArray PlutoSDROutputSettings::serialize() const @@ -52,6 +54,8 @@ QByteArray PlutoSDROutputSettings::serialize() const s.writeU64(12, m_devSampleRate); s.writeS32(13, m_att); s.writeS32(14, (int) m_antennaPath); + s.writeBool(15, m_transverterMode); + s.writeS64(16, m_transverterDeltaFrequency); return s.final(); } @@ -91,6 +95,8 @@ bool PlutoSDROutputSettings::deserialize(const QByteArray& data) } else { m_antennaPath = RFPATH_A; } + d.readBool(15, &m_transverterMode, false); + d.readS64(16, &m_transverterDeltaFrequency, 0); return true; } diff --git a/plugins/samplesink/plutosdroutput/plutosdroutputsettings.h b/plugins/samplesink/plutosdroutput/plutosdroutputsettings.h index a3ad223b3..672dbd4fd 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutputsettings.h +++ b/plugins/samplesink/plutosdroutput/plutosdroutputsettings.h @@ -42,6 +42,8 @@ struct PlutoSDROutputSettings { quint32 m_lpfBW; //!< analog lowpass filter bandwidth (Hz) qint32 m_att; //!< "hardware" attenuation in dB fourths RFPath m_antennaPath; + bool m_transverterMode; + qint64 m_transverterDeltaFrequency; PlutoSDROutputSettings(); diff --git a/plugins/samplesink/plutosdroutput/readme.md b/plugins/samplesink/plutosdroutput/readme.md index 5ed3f9ef1..b8724eb6a 100644 --- a/plugins/samplesink/plutosdroutput/readme.md +++ b/plugins/samplesink/plutosdroutput/readme.md @@ -59,6 +59,36 @@ Baseband I/Q sample rate in kS/s. This is the host to device sample rate (5) div Use this slider to adjust LO correction in ppm. It can be varied from -20.0 to 20.0 in 0.1 steps and is applied in hardware. This applies to the oscillator that controls both the Tx and Rx frequency therefore it is also changed on the Rx plugin if it is active. +

2a: Transverter mode open dialog

+ +This button opens a dialog to set the transverter mode frequency translation options: + +![SDR Daemon source input stream trasverter dialog](../../../doc/img/RTLSDR_plugin_xvrt.png) + +Note that if you mouse over the button a tooltip appears that displays the translating frequency and if translation is enabled or disabled. When the frequency translation is enabled the button is lit. + +

2a.1: Translating frequency

+ +You can set the translating frequency in Hz with this dial. Use the wheels to adjust the sample rate. 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 arroews. Pressing shift simultanoeusly moves digit by 5 and pressing control moves it by 2. + +The frequency set in the device is the frequency on the main dial (1) minus this frequency. Thus it is positive for up converters and negative for down converters. + +For example with a mixer at 120 MHz for HF operation you would set the value to -120,000,000 Hz so that if the main dial frequency is set to 7,130 kHz the PuotSDR will be set to 127.130 MHz. + +If you use an up converter to transmit at the 6 cm band narrowband center frequency of 5670 MHz aith the PlutoSDR set at 432 MHz you would set the translating frequency to 5760 - 432 = 5328 MHz thus dial +5,328,000,000 Hz. + +For bands even higher in the frequency spectrum the GHz digits are not really significant so you can have them set at 1 GHz. Thus to transmit at the 10368 MHz frequency with 432 MHz for the PlutoSDR you would set the translating frequency to 1368 - 432 = 936 MHz. Note that in this case the frequency of the LO used in the mixer of the transverter is set at 9936 MHz. + +The Hz precision allows a fine tuning of the transverter LO offset + +

2a.2: Translating frequency enable/disable

+ +Use this toggle button to activate or deactivate the frequency translation + +

2a.3: Confirmation buttons

+ +Use these buttons to confirm ("OK") or dismiss ("Cancel") your changes. +

3: Software interpolation factor

The I/Q stream to the PlutoSDR is upsampled by a power of two by software inside the plugin from the signal coming from the passband. Possible values are increasing powers of two: 1 (no interpolation), 2, 4, 8, 16, 32. diff --git a/plugins/samplesource/plutosdrinput/readme.md b/plugins/samplesource/plutosdrinput/readme.md index 291f41874..351e7bceb 100644 --- a/plugins/samplesource/plutosdrinput/readme.md +++ b/plugins/samplesource/plutosdrinput/readme.md @@ -86,7 +86,7 @@ You can set the translating frequency in Hz with this dial. Use the wheels to ad The frequency set in the device is the frequency on the main dial (1) minus this frequency. Thus it is positive for down converters and negative for up converters. -For example with the DX Patrol that has a mixer at 120 MHz for HF operation you would set the value to -120,000,000 Hz so that if the main dial frequency is set at 7,130 kHz the RTLSDR of the DX Patrol will be set to 127.130 MHz. +For example a mixer at 120 MHz for HF operation you would set the value to -120,000,000 Hz so that if the main dial frequency is set at 7,130 kHz the PlutoSDR will be set to 127.130 MHz. If you use a down converter to receive the 6 cm band narrowband center frequency of 5670 MHz at 432 MHz you would set the translating frequency to 5760 - 432 = 5328 MHz thus dial +5,328,000,000 Hz.