1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00

LimeSDR input: handle NCO for self

This commit is contained in:
f4exb 2017-04-20 23:02:06 +02:00
parent 4534695bab
commit 35f51bcdb2
4 changed files with 30 additions and 8 deletions

View File

@ -666,6 +666,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
m_settings.m_ncoFrequency)) m_settings.m_ncoFrequency))
{ {
doCalibration = true; doCalibration = true;
forwardChangeOwnDSP = true;
qDebug("LimeSDRInput::applySettings: %sd and set NCO to %d Hz", qDebug("LimeSDRInput::applySettings: %sd and set NCO to %d Hz",
m_settings.m_ncoEnable ? "enable" : "disable", m_settings.m_ncoEnable ? "enable" : "disable",
m_settings.m_ncoFrequency); m_settings.m_ncoFrequency);
@ -802,9 +803,10 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies(); const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin(); std::vector<DeviceSourceAPI*>::const_iterator itSource = sourceBuddies.begin();
int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim); int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim);
int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0;
// send to self first // send to self first
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency); DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency + ncoShift);
m_deviceAPI->getDeviceInputMessageQueue()->push(notif); m_deviceAPI->getDeviceInputMessageQueue()->push(notif);
// send to source buddies // send to source buddies
@ -841,9 +843,10 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies(); const std::vector<DeviceSourceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin(); std::vector<DeviceSourceAPI*>::const_iterator it = sourceBuddies.begin();
int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim); int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim);
int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0;
// send to self first // send to self first
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency); DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency + ncoShift);
m_deviceAPI->getDeviceInputMessageQueue()->push(notif); m_deviceAPI->getDeviceInputMessageQueue()->push(notif);
// send to source buddies // send to source buddies
@ -863,7 +866,8 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
qDebug("LimeSDRInput::applySettings: forward change to self only"); qDebug("LimeSDRInput::applySettings: forward change to self only");
int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim); int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2SoftDecim);
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency); int ncoShift = m_settings.m_ncoEnable ? m_settings.m_ncoFrequency : 0;
DSPSignalNotification *notif = new DSPSignalNotification(sampleRate, m_settings.m_centerFrequency + ncoShift);
m_deviceAPI->getDeviceInputMessageQueue()->push(notif); m_deviceAPI->getDeviceInputMessageQueue()->push(notif);
} }

View File

@ -250,6 +250,11 @@ void LimeSDRInputGUI::displaySettings()
ui->gain->setValue(m_settings.m_gain); ui->gain->setValue(m_settings.m_gain);
ui->gainText->setText(tr("%1dB").arg(m_settings.m_gain)); ui->gainText->setText(tr("%1dB").arg(m_settings.m_gain));
setNCODisplay();
}
void LimeSDRInputGUI::setNCODisplay()
{
int ncoHalfRange = (m_settings.m_devSampleRate * (1<<(m_settings.m_log2HardDecim)))/2; int ncoHalfRange = (m_settings.m_devSampleRate * (1<<(m_settings.m_log2HardDecim)))/2;
ui->ncoFrequency->setValueRange(7, ui->ncoFrequency->setValueRange(7,
(m_settings.m_centerFrequency - ncoHalfRange)/1000, (m_settings.m_centerFrequency - ncoHalfRange)/1000,
@ -353,6 +358,7 @@ void LimeSDRInputGUI::on_record_toggled(bool checked)
void LimeSDRInputGUI::on_centerFrequency_changed(quint64 value) void LimeSDRInputGUI::on_centerFrequency_changed(quint64 value)
{ {
m_settings.m_centerFrequency = value * 1000; m_settings.m_centerFrequency = value * 1000;
setNCODisplay();
sendSettings(); sendSettings();
} }
@ -391,6 +397,7 @@ void LimeSDRInputGUI::on_iqImbalance_toggled(bool checked)
void LimeSDRInputGUI::on_sampleRate_changed(quint64 value) void LimeSDRInputGUI::on_sampleRate_changed(quint64 value)
{ {
m_settings.m_devSampleRate = value; m_settings.m_devSampleRate = value;
setNCODisplay();
sendSettings();} sendSettings();}
void LimeSDRInputGUI::on_hwDecim_currentIndexChanged(int index) void LimeSDRInputGUI::on_hwDecim_currentIndexChanged(int index)
@ -398,6 +405,7 @@ void LimeSDRInputGUI::on_hwDecim_currentIndexChanged(int index)
if ((index <0) || (index > 5)) if ((index <0) || (index > 5))
return; return;
m_settings.m_log2HardDecim = index; m_settings.m_log2HardDecim = index;
setNCODisplay();
sendSettings(); sendSettings();
} }

View File

@ -64,6 +64,7 @@ private:
int m_statusCounter; int m_statusCounter;
void displaySettings(); void displaySettings();
void setNCODisplay();
void sendSettings(); void sendSettings();
void updateSampleRateAndFrequency(); void updateSampleRateAndFrequency();
void blockApplySettings(bool block); void blockApplySettings(bool block);

View File

@ -147,7 +147,7 @@
<enum>Qt::StrongFocus</enum> <enum>Qt::StrongFocus</enum>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Tuner center frequency in kHz</string> <string>Main center frequency in kHz</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -326,6 +326,9 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>TSP hardware decimation factor</string>
</property>
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>2</number>
</property> </property>
@ -380,7 +383,7 @@
</size> </size>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Decimation factor</string> <string>Software decimation factor</string>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
@ -463,6 +466,9 @@
<pointsize>12</pointsize> <pointsize>12</pointsize>
</font> </font>
</property> </property>
<property name="toolTip">
<string>Device to host sample rate</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -517,7 +523,7 @@
</font> </font>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Analog lowpass filers bandwidth (kHz)</string> <string>Analog lowpass filer bandwidth (kHz)</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -544,7 +550,7 @@
<item> <item>
<widget class="ButtonSwitch" name="lpFIREnable"> <widget class="ButtonSwitch" name="lpFIREnable">
<property name="toolTip"> <property name="toolTip">
<string>Enable or disable the digital FIR lowpass filters</string> <string>Enable or disable TSP digital FIR lowpass filters</string>
</property> </property>
<property name="text"> <property name="text">
<string>FIR</string> <string>FIR</string>
@ -672,6 +678,9 @@
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Green when stream is reporting data</string>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
@ -779,7 +788,7 @@
</font> </font>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>FIFO status</string> <string>FIFO fill status</string>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QProgressBar{border: 2px solid rgb(79, 79, 79); text-align: center;} <string notr="true">QProgressBar{border: 2px solid rgb(79, 79, 79); text-align: center;}