Airspy HF (int version): use raw integer samples and do the DC and IQ corrections in the application

pull/147/head
f4exb 2018-02-04 23:42:46 +01:00
rodzic 6b26543655
commit cbf229c15c
7 zmienionych plików z 95 dodań i 3 usunięć

Wyświetl plik

@ -219,6 +219,7 @@ void AirspyHFGui::displaySettings()
ui->centerFrequency->setValue(m_settings.m_centerFrequency / 1000);
ui->LOppm->setValue(m_settings.m_LOppmTenths);
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->decim->setCurrentIndex(m_settings.m_log2Decim);
ui->band->blockSignals(false);
@ -277,6 +278,16 @@ void AirspyHFGui::on_resetLOppm_clicked()
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)
{
m_settings.m_devSampleRateIndex = index;

Wyświetl plik

@ -79,6 +79,7 @@ private slots:
void on_centerFrequency_changed(quint64 value);
void on_LOppm_valueChanged(int value);
void on_resetLOppm_clicked();
void on_autoCorr_currentIndexChanged(int index);
void on_sampleRate_currentIndexChanged(int index);
void on_decim_currentIndexChanged(int index);
void on_startStop_toggled(bool checked);

Wyświetl plik

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>324</width>
<height>132</height>
<height>174</height>
</rect>
</property>
<property name="sizePolicy">
@ -237,6 +237,52 @@
</item>
</layout>
</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>
<widget class="Line" name="line_freq">
<property name="orientation">

Wyświetl plik

@ -134,7 +134,7 @@ bool AirspyHFInput::openDevice()
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;
}
@ -349,6 +349,23 @@ bool AirspyHFInput::applySettings(const AirspyHFSettings& settings, bool force)
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)
{
forwardChange = true;

Wyświetl plik

@ -28,7 +28,7 @@
const PluginDescriptor AirspyHFPlugin::m_pluginDescriptor = {
QString("AirspyHF Input"),
QString("3.11.0"),
QString("3.12.0"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

Wyświetl plik

@ -32,6 +32,7 @@ void AirspyHFSettings::resetToDefaults()
m_transverterMode = false;
m_transverterDeltaFrequency = 0;
m_bandIndex = 0;
m_autoCorrOptions = AutoCorrNone;
}
QByteArray AirspyHFSettings::serialize() const
@ -41,6 +42,7 @@ QByteArray AirspyHFSettings::serialize() const
s.writeU32(1, m_devSampleRateIndex);
s.writeS32(2, m_LOppmTenths);
s.writeU32(3, m_log2Decim);
s.writeS32(4, (int) m_autoCorrOptions);
s.writeBool(7, m_transverterMode);
s.writeS64(8, m_transverterDeltaFrequency);
s.writeU32(9, m_bandIndex);
@ -67,6 +69,13 @@ bool AirspyHFSettings::deserialize(const QByteArray& data)
d.readS32(2, &m_LOppmTenths, 0);
d.readU32(3, &m_log2Decim, 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.readS64(8, &m_transverterDeltaFrequency, 0);
d.readU32(9, &uintval, 0);

Wyświetl plik

@ -19,6 +19,13 @@
struct AirspyHFSettings
{
typedef enum {
AutoCorrNone,
AutoCorrDC,
AutoCorrDCAndIQ,
AutoCorrLast,
} AutoCorrOptions;
quint64 m_centerFrequency;
qint32 m_LOppmTenths;
quint32 m_devSampleRateIndex;
@ -26,6 +33,7 @@ struct AirspyHFSettings
bool m_transverterMode;
qint64 m_transverterDeltaFrequency;
quint32 m_bandIndex;
AutoCorrOptions m_autoCorrOptions;
AirspyHFSettings();
void resetToDefaults();