1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-16 05:11:49 -05:00
Handle LMS_Calibrate returning positive error values.
Set Lime minimum frequency in GUI to 30MHz+NCO freq.
Set minimum calibration bandwidth to 2.5MHz.
This commit is contained in:
Jon Beniston 2022-08-21 15:34:51 +01:00
parent 044af0d06d
commit 6ef84154a5
6 changed files with 24 additions and 6 deletions

View File

@ -1066,11 +1066,12 @@ bool LimeSDROutput::applySettings(const LimeSDROutputSettings& settings, bool fo
if (doCalibration) if (doCalibration)
{ {
double bw = std::min((double)m_settings.m_devSampleRate, 2500000.0); // Min supported calibration bandwidth is 2.5MHz
if (LMS_Calibrate(m_deviceShared.m_deviceParams->getDevice(), if (LMS_Calibrate(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_TX, LMS_CH_TX,
m_deviceShared.m_channel, m_deviceShared.m_channel,
m_settings.m_devSampleRate, bw,
0) < 0) 0) != 0)
{ {
qCritical("LimeSDROutput::applySettings: calibration failed on Tx channel %d", m_deviceShared.m_channel); qCritical("LimeSDROutput::applySettings: calibration failed on Tx channel %d", m_deviceShared.m_channel);
} }

View File

@ -151,8 +151,10 @@ void LimeSDROutputGUI::updateFrequencyLimits()
m_limeSDROutput->getLORange(minF, maxF); m_limeSDROutput->getLORange(minF, maxF);
qint64 minLimit = minF/1000 + deltaFrequency; qint64 minLimit = minF/1000 + deltaFrequency;
qint64 maxLimit = maxF/1000 + deltaFrequency; qint64 maxLimit = maxF/1000 + deltaFrequency;
// Min freq is 30MHz - NCO must be used to go below this
qint64 minFreq = m_settings.m_ncoEnable ? 30000 + m_settings.m_ncoFrequency/1000 : 30000;
minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit; minLimit = minLimit < minFreq ? minFreq : minLimit > 9999999 ? 9999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit; maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
qDebug("LimeSDROutputGUI::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit); qDebug("LimeSDROutputGUI::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
@ -515,6 +517,7 @@ void LimeSDROutputGUI::on_centerFrequency_changed(quint64 value)
void LimeSDROutputGUI::on_ncoFrequency_changed(qint64 value) void LimeSDROutputGUI::on_ncoFrequency_changed(qint64 value)
{ {
m_settings.m_ncoFrequency = value; m_settings.m_ncoFrequency = value;
updateFrequencyLimits();
setCenterFrequencyDisplay(); setCenterFrequencyDisplay();
sendSettings(); sendSettings();
} }
@ -522,6 +525,7 @@ void LimeSDROutputGUI::on_ncoFrequency_changed(qint64 value)
void LimeSDROutputGUI::on_ncoEnable_toggled(bool checked) void LimeSDROutputGUI::on_ncoEnable_toggled(bool checked)
{ {
m_settings.m_ncoEnable = checked; m_settings.m_ncoEnable = checked;
updateFrequencyLimits();
setCenterFrequencyDisplay(); setCenterFrequencyDisplay();
sendSettings(); sendSettings();
} }

View File

@ -64,6 +64,8 @@ Transmission latency depends essentially in the delay in the sample FIFO. The si
This is the center frequency of transmission in kHz. This is the center frequency of transmission in kHz.
The NCO must be enabled with a negative value in order to set this below 30MHz.
<h3>3A: Center frequency units</h3> <h3>3A: Center frequency units</h3>
This is the center frequency units thus kHz (fixed) This is the center frequency units thus kHz (fixed)
@ -171,6 +173,8 @@ The LMS7002M uses the same clock for both the ADCs and DACs therefore this sampl
This is the Tx hardware filter bandwidth in kHz in the LMS7002M device for the given channel. Boundaries are updated automatically but generally are from 5 to 130 MHz in 1 kHz steps. Use the wheels to adjust the value. Pressing shift simultaneously moves digit by 5 and pressing control moves it by 2. This is the Tx hardware filter bandwidth in kHz in the LMS7002M device for the given channel. Boundaries are updated automatically but generally are from 5 to 130 MHz in 1 kHz steps. Use the wheels to adjust the value. Pressing shift simultaneously moves digit by 5 and pressing control moves it by 2.
The filter is centered at the LO frequency, so if using the NCO to achieve frequencies below 30MHz, the filter bandwidth needs to be set wide enough for not only your desired signal but the offset from the 30MHz LO as well.
<h3>12: TSP FIR filter toggle</h3> <h3>12: TSP FIR filter toggle</h3>
The TSP in the LMS7002M chip has a FIR filter chain per channel. Use this button to activate or deactivate the TSP FIR filter. The TSP in the LMS7002M chip has a FIR filter chain per channel. Use this button to activate or deactivate the TSP FIR filter.

View File

@ -1227,11 +1227,12 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
if (doCalibration) if (doCalibration)
{ {
double bw = std::min((double)m_settings.m_devSampleRate, 2500000.0); // Min supported calibration bandwidth is 2.5MHz
if (LMS_Calibrate(m_deviceShared.m_deviceParams->getDevice(), if (LMS_Calibrate(m_deviceShared.m_deviceParams->getDevice(),
LMS_CH_RX, LMS_CH_RX,
m_deviceShared.m_channel, m_deviceShared.m_channel,
m_settings.m_devSampleRate, bw,
0) < 0) 0) != 0)
{ {
qCritical("LimeSDRInput::applySettings: calibration failed on Rx channel %d", m_deviceShared.m_channel); qCritical("LimeSDRInput::applySettings: calibration failed on Rx channel %d", m_deviceShared.m_channel);
} }

View File

@ -262,8 +262,10 @@ void LimeSDRInputGUI::updateFrequencyLimits()
m_limeSDRInput->getLORange(minF, maxF); m_limeSDRInput->getLORange(minF, maxF);
qint64 minLimit = minF/1000 + deltaFrequency; qint64 minLimit = minF/1000 + deltaFrequency;
qint64 maxLimit = maxF/1000 + deltaFrequency; qint64 maxLimit = maxF/1000 + deltaFrequency;
// Min freq is 30MHz - NCO must be used to go below this
qint64 minFreq = m_settings.m_ncoEnable ? 30000 + m_settings.m_ncoFrequency/1000 : 30000;
minLimit = minLimit < 0 ? 0 : minLimit > 9999999 ? 9999999 : minLimit; minLimit = minLimit < minFreq ? minFreq : minLimit > 9999999 ? 9999999 : minLimit;
maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit; maxLimit = maxLimit < 0 ? 0 : maxLimit > 9999999 ? 9999999 : maxLimit;
qDebug("LimeSDRInputGUI::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit); qDebug("LimeSDRInputGUI::updateFrequencyLimits: delta: %lld min: %lld max: %lld", deltaFrequency, minLimit, maxLimit);
@ -548,6 +550,7 @@ void LimeSDRInputGUI::on_centerFrequency_changed(quint64 value)
void LimeSDRInputGUI::on_ncoFrequency_changed(qint64 value) void LimeSDRInputGUI::on_ncoFrequency_changed(qint64 value)
{ {
m_settings.m_ncoFrequency = value; m_settings.m_ncoFrequency = value;
updateFrequencyLimits();
setCenterFrequencyDisplay(); setCenterFrequencyDisplay();
sendSettings(); sendSettings();
} }
@ -555,6 +558,7 @@ void LimeSDRInputGUI::on_ncoFrequency_changed(qint64 value)
void LimeSDRInputGUI::on_ncoEnable_toggled(bool checked) void LimeSDRInputGUI::on_ncoEnable_toggled(bool checked)
{ {
m_settings.m_ncoEnable = checked; m_settings.m_ncoEnable = checked;
updateFrequencyLimits();
setCenterFrequencyDisplay(); setCenterFrequencyDisplay();
sendSettings(); sendSettings();
} }

View File

@ -24,6 +24,8 @@ The top and bottom bars of the device window are described [here](../../../sdrgu
This is the center frequency of reception in kHz. This is the center frequency of reception in kHz.
The NCO must be enabled with a negative value in order to set this below 30MHz.
<h4>1.2: Start/Stop</h4> <h4>1.2: Start/Stop</h4>
Device start / stop button. Device start / stop button.
@ -133,6 +135,8 @@ The LMS7002M uses the same clock for both the ADCs and DACs therefore this sampl
This is the Rx hardware filter bandwidth in kHz in the LMS7002M device for the given channel. Boundaries are updated automatically but generally are from 1.4 to 130 MHz in 1 kHz steps. Use the wheels to adjust the value. Pressing shift simultaneously moves digit by 5 and pressing control moves it by 2. This is the Rx hardware filter bandwidth in kHz in the LMS7002M device for the given channel. Boundaries are updated automatically but generally are from 1.4 to 130 MHz in 1 kHz steps. Use the wheels to adjust the value. Pressing shift simultaneously moves digit by 5 and pressing control moves it by 2.
The filter is centered at the LO frequency, so if using the NCO to achieve frequencies below 30MHz, the filter bandwidth needs to be set wide enough for not only your desired signal but the offset from the 30MHz LO as well.
<h4>7.2: TSP FIR filter toggle</h4> <h4>7.2: TSP FIR filter toggle</h4>
The TSP in the LMS7002M chip has a FIR filter chain per channel. Use this button to activate or deactivate the TSP FIR filter. The TSP in the LMS7002M chip has a FIR filter chain per channel. Use this button to activate or deactivate the TSP FIR filter.