mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-01 06:32:25 -04:00
Airspy HF (int version): use raw integer samples and do the DC and IQ corrections in the application
This commit is contained in:
parent
6b26543655
commit
cbf229c15c
@ -219,6 +219,7 @@ void AirspyHFGui::displaySettings()
|
|||||||
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
|
||||||
ui->LOppm->setValue(m_settings.m_LOppmTenths);
|
ui->LOppm->setValue(m_settings.m_LOppmTenths);
|
||||||
ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
|
ui->LOppmText->setText(QString("%1").arg(QString::number(m_settings.m_LOppmTenths/10.0, 'f', 1)));
|
||||||
|
ui->autoCorr->setCurrentIndex(m_settings.m_autoCorrOptions);
|
||||||
ui->sampleRate->setCurrentIndex(m_settings.m_devSampleRateIndex);
|
ui->sampleRate->setCurrentIndex(m_settings.m_devSampleRateIndex);
|
||||||
ui->decim->setCurrentIndex(m_settings.m_log2Decim);
|
ui->decim->setCurrentIndex(m_settings.m_log2Decim);
|
||||||
ui->band->blockSignals(false);
|
ui->band->blockSignals(false);
|
||||||
@ -277,6 +278,16 @@ void AirspyHFGui::on_resetLOppm_clicked()
|
|||||||
ui->LOppm->setValue(0);
|
ui->LOppm->setValue(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AirspyHFGui::on_autoCorr_currentIndexChanged(int index)
|
||||||
|
{
|
||||||
|
if ((index < 0) || (index > AirspyHFSettings::AutoCorrLast)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_settings.m_autoCorrOptions = (AirspyHFSettings::AutoCorrOptions) index;
|
||||||
|
sendSettings();
|
||||||
|
}
|
||||||
|
|
||||||
void AirspyHFGui::on_sampleRate_currentIndexChanged(int index)
|
void AirspyHFGui::on_sampleRate_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
m_settings.m_devSampleRateIndex = index;
|
m_settings.m_devSampleRateIndex = index;
|
||||||
|
@ -79,6 +79,7 @@ private slots:
|
|||||||
void on_centerFrequency_changed(quint64 value);
|
void on_centerFrequency_changed(quint64 value);
|
||||||
void on_LOppm_valueChanged(int value);
|
void on_LOppm_valueChanged(int value);
|
||||||
void on_resetLOppm_clicked();
|
void on_resetLOppm_clicked();
|
||||||
|
void on_autoCorr_currentIndexChanged(int index);
|
||||||
void on_sampleRate_currentIndexChanged(int index);
|
void on_sampleRate_currentIndexChanged(int index);
|
||||||
void on_decim_currentIndexChanged(int index);
|
void on_decim_currentIndexChanged(int index);
|
||||||
void on_startStop_toggled(bool checked);
|
void on_startStop_toggled(bool checked);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>324</width>
|
<width>324</width>
|
||||||
<height>132</height>
|
<height>174</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -237,6 +237,52 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="autoCorrLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="autoCorrLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Corr</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="autoCorr">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>DC offset and IQ correction options</string>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>None</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>DC</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>DC+IQ</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line_freq">
|
<widget class="Line" name="line_freq">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -134,7 +134,7 @@ bool AirspyHFInput::openDevice()
|
|||||||
|
|
||||||
delete[] sampleRates;
|
delete[] sampleRates;
|
||||||
|
|
||||||
airspyhf_set_sample_type(m_dev, AIRSPYHF_SAMPLE_INT16_IQ);
|
airspyhf_set_sample_type(m_dev, AIRSPYHF_SAMPLE_INT16_NDSP_IQ);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -349,6 +349,23 @@ bool AirspyHFInput::applySettings(const AirspyHFSettings& settings, bool force)
|
|||||||
|
|
||||||
qDebug() << "AirspyHFInput::applySettings";
|
qDebug() << "AirspyHFInput::applySettings";
|
||||||
|
|
||||||
|
if ((m_settings.m_autoCorrOptions != settings.m_autoCorrOptions) || force)
|
||||||
|
{
|
||||||
|
switch(settings.m_autoCorrOptions)
|
||||||
|
{
|
||||||
|
case AirspyHFSettings::AutoCorrDC:
|
||||||
|
m_deviceAPI->configureCorrections(true, false);
|
||||||
|
break;
|
||||||
|
case AirspyHFSettings::AutoCorrDCAndIQ:
|
||||||
|
m_deviceAPI->configureCorrections(true, true);
|
||||||
|
break;
|
||||||
|
case AirspyHFSettings::AutoCorrNone:
|
||||||
|
default:
|
||||||
|
m_deviceAPI->configureCorrections(false, false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((m_settings.m_devSampleRateIndex != settings.m_devSampleRateIndex) || force)
|
if ((m_settings.m_devSampleRateIndex != settings.m_devSampleRateIndex) || force)
|
||||||
{
|
{
|
||||||
forwardChange = true;
|
forwardChange = true;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
const PluginDescriptor AirspyHFPlugin::m_pluginDescriptor = {
|
const PluginDescriptor AirspyHFPlugin::m_pluginDescriptor = {
|
||||||
QString("AirspyHF Input"),
|
QString("AirspyHF Input"),
|
||||||
QString("3.11.0"),
|
QString("3.12.0"),
|
||||||
QString("(c) Edouard Griffiths, F4EXB"),
|
QString("(c) Edouard Griffiths, F4EXB"),
|
||||||
QString("https://github.com/f4exb/sdrangel"),
|
QString("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
|
@ -32,6 +32,7 @@ void AirspyHFSettings::resetToDefaults()
|
|||||||
m_transverterMode = false;
|
m_transverterMode = false;
|
||||||
m_transverterDeltaFrequency = 0;
|
m_transverterDeltaFrequency = 0;
|
||||||
m_bandIndex = 0;
|
m_bandIndex = 0;
|
||||||
|
m_autoCorrOptions = AutoCorrNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray AirspyHFSettings::serialize() const
|
QByteArray AirspyHFSettings::serialize() const
|
||||||
@ -41,6 +42,7 @@ QByteArray AirspyHFSettings::serialize() const
|
|||||||
s.writeU32(1, m_devSampleRateIndex);
|
s.writeU32(1, m_devSampleRateIndex);
|
||||||
s.writeS32(2, m_LOppmTenths);
|
s.writeS32(2, m_LOppmTenths);
|
||||||
s.writeU32(3, m_log2Decim);
|
s.writeU32(3, m_log2Decim);
|
||||||
|
s.writeS32(4, (int) m_autoCorrOptions);
|
||||||
s.writeBool(7, m_transverterMode);
|
s.writeBool(7, m_transverterMode);
|
||||||
s.writeS64(8, m_transverterDeltaFrequency);
|
s.writeS64(8, m_transverterDeltaFrequency);
|
||||||
s.writeU32(9, m_bandIndex);
|
s.writeU32(9, m_bandIndex);
|
||||||
@ -67,6 +69,13 @@ bool AirspyHFSettings::deserialize(const QByteArray& data)
|
|||||||
d.readS32(2, &m_LOppmTenths, 0);
|
d.readS32(2, &m_LOppmTenths, 0);
|
||||||
d.readU32(3, &m_log2Decim, 0);
|
d.readU32(3, &m_log2Decim, 0);
|
||||||
d.readS32(4, &intval, 0);
|
d.readS32(4, &intval, 0);
|
||||||
|
|
||||||
|
if (intval < 0 || intval > (int) AutoCorrLast) {
|
||||||
|
m_autoCorrOptions = AutoCorrNone;
|
||||||
|
} else {
|
||||||
|
m_autoCorrOptions = (AutoCorrOptions) intval;
|
||||||
|
}
|
||||||
|
|
||||||
d.readBool(7, &m_transverterMode, false);
|
d.readBool(7, &m_transverterMode, false);
|
||||||
d.readS64(8, &m_transverterDeltaFrequency, 0);
|
d.readS64(8, &m_transverterDeltaFrequency, 0);
|
||||||
d.readU32(9, &uintval, 0);
|
d.readU32(9, &uintval, 0);
|
||||||
|
@ -19,6 +19,13 @@
|
|||||||
|
|
||||||
struct AirspyHFSettings
|
struct AirspyHFSettings
|
||||||
{
|
{
|
||||||
|
typedef enum {
|
||||||
|
AutoCorrNone,
|
||||||
|
AutoCorrDC,
|
||||||
|
AutoCorrDCAndIQ,
|
||||||
|
AutoCorrLast,
|
||||||
|
} AutoCorrOptions;
|
||||||
|
|
||||||
quint64 m_centerFrequency;
|
quint64 m_centerFrequency;
|
||||||
qint32 m_LOppmTenths;
|
qint32 m_LOppmTenths;
|
||||||
quint32 m_devSampleRateIndex;
|
quint32 m_devSampleRateIndex;
|
||||||
@ -26,6 +33,7 @@ struct AirspyHFSettings
|
|||||||
bool m_transverterMode;
|
bool m_transverterMode;
|
||||||
qint64 m_transverterDeltaFrequency;
|
qint64 m_transverterDeltaFrequency;
|
||||||
quint32 m_bandIndex;
|
quint32 m_bandIndex;
|
||||||
|
AutoCorrOptions m_autoCorrOptions;
|
||||||
|
|
||||||
AirspyHFSettings();
|
AirspyHFSettings();
|
||||||
void resetToDefaults();
|
void resetToDefaults();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user