PlutoSDR output: implemented transverter feature

pull/85/head
f4exb 2017-09-25 19:11:13 +02:00
rodzic 99e96f1099
commit 37d44038f4
9 zmienionych plików z 105 dodań i 4 usunięć

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 26 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 27 KiB

Wyświetl plik

@ -343,11 +343,23 @@ bool PlutoSDROutput::applySettings(const PlutoSDROutputSettings& settings, bool
std::vector<std::string> 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)

Wyświetl plik

@ -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;

Wyświetl plik

@ -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();

Wyświetl plik

@ -240,6 +240,22 @@
</property>
</widget>
</item>
<item>
<widget class="TransverterButton" name="transverter">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Transverter frequency translation dialog</string>
</property>
<property name="text">
<string>X</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -766,6 +782,11 @@
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>TransverterButton</class>
<extends>QPushButton</extends>
<header>gui/transverterbutton.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../../../sdrbase/resources/res.qrc"/>

Wyświetl plik

@ -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;
}

Wyświetl plik

@ -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();

Wyświetl plik

@ -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.
<h3>2a: Transverter mode open dialog</h3>
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.
<h4>2a.1: Translating frequency</h4>
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
<h4>2a.2: Translating frequency enable/disable</h4>
Use this toggle button to activate or deactivate the frequency translation
<h4>2a.3: Confirmation buttons</h4>
Use these buttons to confirm ("OK") or dismiss ("Cancel") your changes.
<h3>3: Software interpolation factor</h3>
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.

Wyświetl plik

@ -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.