1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-11-16 05:03:17 -05:00

LimeSDR MIMO: unsuccessful attempt to fix

This commit is contained in:
f4exb 2020-04-18 18:32:56 +02:00
parent 7e82ede7ae
commit 4bca8efd6a
8 changed files with 323 additions and 364 deletions

View File

@ -569,7 +569,7 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
bool forceRxNCOFrequency = false; bool forceRxNCOFrequency = false;
bool forceTxNCOFrequency = false; bool forceTxNCOFrequency = false;
qDebug() << "LimeSDRMIMO::applySettings: " qDebug() << "LimeSDRMIMO::applySettings: common:"
<< " m_devSampleRate: " << settings.m_devSampleRate << " m_devSampleRate: " << settings.m_devSampleRate
<< " m_LOppmTenths: " << settings.m_LOppmTenths << " m_LOppmTenths: " << settings.m_LOppmTenths
<< " m_gpioDir: " << settings.m_gpioDir << " m_gpioDir: " << settings.m_gpioDir
@ -581,7 +581,8 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
<< " m_reverseAPIAddress: " << settings.m_reverseAPIAddress << " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
<< " m_reverseAPIPort: " << settings.m_reverseAPIPort << " m_reverseAPIPort: " << settings.m_reverseAPIPort
<< " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex << " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex
// Rx general << " force: " << force;
qDebug() << "LimeSDRMIMO::applySettings: Rx general:"
<< " m_rxCenterFrequency: " << settings.m_rxCenterFrequency << " m_rxCenterFrequency: " << settings.m_rxCenterFrequency
<< " m_log2HardDecim: " << settings.m_log2HardDecim << " m_log2HardDecim: " << settings.m_log2HardDecim
<< " m_log2SoftDecim: " << settings.m_log2SoftDecim << " m_log2SoftDecim: " << settings.m_log2SoftDecim
@ -589,54 +590,48 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
<< " m_iqCorrection: " << settings.m_iqCorrection << " m_iqCorrection: " << settings.m_iqCorrection
<< " m_rxTransverterMode: " << settings.m_rxTransverterMode << " m_rxTransverterMode: " << settings.m_rxTransverterMode
<< " m_rxTransverterDeltaFrequency: " << settings.m_rxTransverterDeltaFrequency << " m_rxTransverterDeltaFrequency: " << settings.m_rxTransverterDeltaFrequency
// Rx0 << " m_ncoEnableRx: " << settings.m_ncoEnableRx
<< " m_ncoFrequencyRx: " << settings.m_ncoFrequencyRx;
qDebug() << "LimeSDRMIMO::applySettings: Rx0:"
<< " m_lpfBWRx0: " << settings.m_lpfBWRx0 << " m_lpfBWRx0: " << settings.m_lpfBWRx0
<< " m_lpfFIREnableRx0: " << settings.m_lpfFIREnableRx0 << " m_lpfFIREnableRx0: " << settings.m_lpfFIREnableRx0
<< " m_lpfFIRBWRx0: " << settings.m_lpfFIRBWRx0 << " m_lpfFIRBWRx0: " << settings.m_lpfFIRBWRx0
<< " m_gainRx0: " << settings.m_gainRx0 << " m_gainRx0: " << settings.m_gainRx0
<< " m_ncoEnableRx0: " << settings.m_ncoEnableRx0
<< " m_ncoFrequencyRx0: " << settings.m_ncoFrequencyRx0
<< " m_antennaPathRx0: " << settings.m_antennaPathRx0 << " m_antennaPathRx0: " << settings.m_antennaPathRx0
<< " m_gainModeRx0: " << settings.m_gainModeRx0 << " m_gainModeRx0: " << settings.m_gainModeRx0
<< " m_lnaGainRx0: " << settings.m_lnaGainRx0 << " m_lnaGainRx0: " << settings.m_lnaGainRx0
<< " m_tiaGainRx0: " << settings.m_tiaGainRx0 << " m_tiaGainRx0: " << settings.m_tiaGainRx0
<< " m_pgaGainRx0: " << settings.m_pgaGainRx0 << " m_pgaGainRx0: " << settings.m_pgaGainRx0;
// Rx1 qDebug() << "LimeSDRMIMO::applySettings: Rx1:"
<< " m_lpfBWRx1: " << settings.m_lpfBWRx1 << " m_lpfBWRx1: " << settings.m_lpfBWRx1
<< " m_lpfFIREnableRx1: " << settings.m_lpfFIREnableRx1 << " m_lpfFIREnableRx1: " << settings.m_lpfFIREnableRx1
<< " m_lpfFIRBWRx1: " << settings.m_lpfFIRBWRx1 << " m_lpfFIRBWRx1: " << settings.m_lpfFIRBWRx1
<< " m_gainRx1: " << settings.m_gainRx1 << " m_gainRx1: " << settings.m_gainRx1
<< " m_ncoEnableRx1: " << settings.m_ncoEnableRx1
<< " m_ncoFrequencyRx1: " << settings.m_ncoFrequencyRx1
<< " m_antennaPathRx1: " << settings.m_antennaPathRx1 << " m_antennaPathRx1: " << settings.m_antennaPathRx1
<< " m_gainModeRx1: " << settings.m_gainModeRx1 << " m_gainModeRx1: " << settings.m_gainModeRx1
<< " m_lnaGainRx1: " << settings.m_lnaGainRx1 << " m_lnaGainRx1: " << settings.m_lnaGainRx1
<< " m_tiaGainRx1: " << settings.m_tiaGainRx1 << " m_tiaGainRx1: " << settings.m_tiaGainRx1
<< " m_pgaGainRx1: " << settings.m_pgaGainRx1 << " m_pgaGainRx1: " << settings.m_pgaGainRx1;
// Tx general qDebug() << "LimeSDRMIMO::applySettings: Tx general:"
<< " m_txCenterFrequency: " << settings.m_txCenterFrequency << " m_txCenterFrequency: " << settings.m_txCenterFrequency
<< " m_log2HardInterp: " << settings.m_log2HardInterp << " m_log2HardInterp: " << settings.m_log2HardInterp
<< " m_log2SoftInterp: " << settings.m_log2SoftInterp << " m_log2SoftInterp: " << settings.m_log2SoftInterp
<< " m_txTransverterMode: " << settings.m_txTransverterMode << " m_txTransverterMode: " << settings.m_txTransverterMode
<< " m_txTransverterDeltaFrequency: " << settings.m_txTransverterDeltaFrequency << " m_txTransverterDeltaFrequency: " << settings.m_txTransverterDeltaFrequency
// Tx0 << " m_ncoEnableTx: " << settings.m_ncoEnableTx
<< " m_ncoFrequencyTx: " << settings.m_ncoFrequencyTx;
qDebug() << "LimeSDRMIMO::applySettings: Tx0:"
<< " m_lpfBWTx0: " << settings.m_lpfBWTx0 << " m_lpfBWTx0: " << settings.m_lpfBWTx0
<< " m_lpfFIREnableTx0: " << settings.m_lpfFIREnableTx0 << " m_lpfFIREnableTx0: " << settings.m_lpfFIREnableTx0
<< " m_lpfFIRBWTx0: " << settings.m_lpfFIRBWTx0 << " m_lpfFIRBWTx0: " << settings.m_lpfFIRBWTx0
<< " m_gainTx0: " << settings.m_gainTx0 << " m_gainTx0: " << settings.m_gainTx0
<< " m_ncoEnableTx0: " << settings.m_ncoEnableTx0 << " m_antennaPathTx0: " << settings.m_antennaPathTx0;
<< " m_ncoFrequencyTx0: " << settings.m_ncoFrequencyTx0 qDebug() << "LimeSDRMIMO::applySettings: Tx1:"
<< " m_antennaPathTx0: " << settings.m_antennaPathTx0
// Tx1
<< " m_lpfBWTx1: " << settings.m_lpfBWTx1 << " m_lpfBWTx1: " << settings.m_lpfBWTx1
<< " m_lpfFIREnableTx1: " << settings.m_lpfFIREnableTx1 << " m_lpfFIREnableTx1: " << settings.m_lpfFIREnableTx1
<< " m_lpfFIRBWTx1: " << settings.m_lpfFIRBWTx1 << " m_lpfFIRBWTx1: " << settings.m_lpfFIRBWTx1
<< " m_gainTx1: " << settings.m_gainTx1 << " m_gainTx1: " << settings.m_gainTx1
<< " m_ncoEnableTx1: " << settings.m_ncoEnableTx1 << " m_antennaPathTx1: " << settings.m_antennaPathTx1;
<< " m_ncoFrequencyTx1: " << settings.m_ncoFrequencyTx1
<< " m_antennaPathTx1: " << settings.m_antennaPathTx1
// force
<< " force: " << force;
qint64 rxDeviceCenterFrequency = settings.m_rxCenterFrequency; qint64 rxDeviceCenterFrequency = settings.m_rxCenterFrequency;
rxDeviceCenterFrequency -= settings.m_rxTransverterMode ? settings.m_rxTransverterDeltaFrequency : 0; rxDeviceCenterFrequency -= settings.m_rxTransverterMode ? settings.m_rxTransverterDeltaFrequency : 0;
@ -646,6 +641,8 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
txDeviceCenterFrequency -= settings.m_txTransverterMode ? settings.m_txTransverterDeltaFrequency : 0; txDeviceCenterFrequency -= settings.m_txTransverterMode ? settings.m_txTransverterDeltaFrequency : 0;
txDeviceCenterFrequency = txDeviceCenterFrequency < 0 ? 0 : txDeviceCenterFrequency; txDeviceCenterFrequency = txDeviceCenterFrequency < 0 ? 0 : txDeviceCenterFrequency;
// Common
if (LMS_GetClockFreq(m_deviceParams->getDevice(), LMS_CLOCK_CGEN, &clockGenFreq) != 0) { if (LMS_GetClockFreq(m_deviceParams->getDevice(), LMS_CLOCK_CGEN, &clockGenFreq) != 0) {
qCritical("LimeSDRMIMO::applySettings: could not get clock gen frequency"); qCritical("LimeSDRMIMO::applySettings: could not get clock gen frequency");
} else { } else {
@ -655,6 +652,24 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || force) { if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || force) {
reverseAPIKeys.append("devSampleRate"); reverseAPIKeys.append("devSampleRate");
} }
if ((m_settings.m_log2HardDecim != settings.m_log2HardDecim) || force) {
reverseAPIKeys.append("log2HardDecim");
}
if ((m_settings.m_rxCenterFrequency != settings.m_rxCenterFrequency) || force) {
reverseAPIKeys.append("rxCenterFrequency");
}
if ((m_settings.m_rxTransverterMode != settings.m_rxTransverterMode) || force) {
reverseAPIKeys.append("rxTransverterMode");
}
if ((m_settings.m_rxTransverterDeltaFrequency != settings.m_rxTransverterDeltaFrequency) || force) {
reverseAPIKeys.append("rxTransverterDeltaFrequency");
}
if ((m_settings.m_ncoFrequencyRx != settings.m_ncoFrequencyRx) || force) {
reverseAPIKeys.append("ncoFrequencyRx");
}
if ((m_settings.m_ncoEnableRx != settings.m_ncoEnableRx) || force) {
reverseAPIKeys.append("ncoEnableRx");
}
if ((m_settings.m_dcBlock != settings.m_dcBlock) || force) { if ((m_settings.m_dcBlock != settings.m_dcBlock) || force) {
reverseAPIKeys.append("dcBlock"); reverseAPIKeys.append("dcBlock");
} }
@ -671,6 +686,67 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
m_deviceAPI->configureCorrections(settings.m_dcBlock, settings.m_iqCorrection, 1); m_deviceAPI->configureCorrections(settings.m_dcBlock, settings.m_iqCorrection, 1);
} }
if ((m_settings.m_devSampleRate != settings.m_devSampleRate)
|| (m_settings.m_log2HardDecim != settings.m_log2HardDecim) || force)
{
forwardChangeRxDSP = true;
if (m_deviceParams->getDevice())
{
if (LMS_SetSampleRateDir(
m_deviceParams->getDevice(),
LMS_CH_RX,
settings.m_devSampleRate,
1<<settings.m_log2HardDecim) < 0)
{
qCritical("LimeSDRMIMO::applySettings: could not set sample rate to %d with Rx oversampling of %d",
settings.m_devSampleRate,
1<<settings.m_log2HardDecim);
}
else
{
m_deviceParams->m_log2OvSRRx = settings.m_log2HardDecim;
m_deviceParams->m_sampleRate = settings.m_devSampleRate;
forceRxNCOFrequency = true;
qDebug("LimeSDRMIMO::applySettings: set sample rate set to %d with Rx oversampling of %d",
settings.m_devSampleRate,
1<<settings.m_log2HardDecim);
}
}
}
if ((m_settings.m_rxCenterFrequency != settings.m_rxCenterFrequency)
|| (m_settings.m_rxTransverterMode != settings.m_rxTransverterMode)
|| (m_settings.m_rxTransverterDeltaFrequency != settings.m_rxTransverterDeltaFrequency)
|| force)
{
forwardChangeRxDSP = true;
if (m_deviceParams->getDevice())
{
if (LMS_SetClockFreq(m_deviceParams->getDevice(), LMS_CLOCK_SXR, rxDeviceCenterFrequency) < 0)
{
qCritical("LimeSDRMIMO::applySettings: could not set Rx frequency to %lld", rxDeviceCenterFrequency);
}
else
{
doCalibrationRx0 = true;
doCalibrationRx1 = true;
qDebug("LimeSDRMIMO::applySettings: Rx frequency set to %lld", rxDeviceCenterFrequency);
}
}
}
if ((m_settings.m_ncoFrequencyRx != settings.m_ncoFrequencyRx) ||
(m_settings.m_ncoEnableRx != settings.m_ncoEnableRx) || force)
{
forwardChangeRxDSP = true;
applyRxNCOFrequency(0, settings.m_ncoEnableRx, settings.m_ncoFrequencyRx);
applyRxNCOFrequency(1, settings.m_ncoEnableRx, settings.m_ncoFrequencyRx);
}
// Rx0/1
if ((m_settings.m_gainModeRx0 != settings.m_gainModeRx0) || force) if ((m_settings.m_gainModeRx0 != settings.m_gainModeRx0) || force)
{ {
reverseAPIKeys.append("gainModeRx0"); reverseAPIKeys.append("gainModeRx0");
@ -747,36 +823,6 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
applyRxLNAGain(1, doCalibrationRx1, settings.m_pgaGainRx1); applyRxLNAGain(1, doCalibrationRx1, settings.m_pgaGainRx1);
} }
if ((m_settings.m_devSampleRate != settings.m_devSampleRate)
|| (m_settings.m_log2HardDecim != settings.m_log2HardDecim) || force)
{
reverseAPIKeys.append("log2HardDecim");
if (m_deviceParams->getDevice())
{
if (LMS_SetSampleRateDir(
m_deviceParams->getDevice(),
LMS_CH_RX,
settings.m_devSampleRate,
1<<settings.m_log2HardDecim) < 0)
{
qCritical("LimeSDRMIMO::applySettings: could not set sample rate to %d with Rx oversampling of %d",
settings.m_devSampleRate,
1<<settings.m_log2HardDecim);
}
else
{
m_deviceParams->m_log2OvSRRx = settings.m_log2HardDecim;
m_deviceParams->m_sampleRate = settings.m_devSampleRate;
//doCalibration = true;
forceRxNCOFrequency = true;
qDebug("LimeSDRMIMO::applySettings: set sample rate set to %d with Rx oversampling of %d",
settings.m_devSampleRate,
1<<settings.m_log2HardDecim);
}
}
}
if ((m_settings.m_lpfBWRx0 != settings.m_lpfBWRx0) || force) if ((m_settings.m_lpfBWRx0 != settings.m_lpfBWRx0) || force)
{ {
reverseAPIKeys.append("lpfBWRx0"); reverseAPIKeys.append("lpfBWRx0");
@ -805,22 +851,6 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
applyRxLPFIRBW(1, settings.m_lpfFIREnableRx1, settings.m_lpfFIRBWRx1); applyRxLPFIRBW(1, settings.m_lpfFIREnableRx1, settings.m_lpfFIRBWRx1);
} }
if ((m_settings.m_ncoFrequencyRx0 != settings.m_ncoFrequencyRx0) ||
(m_settings.m_ncoEnableRx0 != settings.m_ncoEnableRx0) || force)
{
reverseAPIKeys.append("ncoFrequencyRx0");
reverseAPIKeys.append("ncoEnableRx0");
applyRxNCOFrequency(0, settings.m_ncoEnableRx0, settings.m_ncoFrequencyRx0);
}
if ((m_settings.m_ncoFrequencyRx1 != settings.m_ncoFrequencyRx1) ||
(m_settings.m_ncoEnableRx1 != settings.m_ncoEnableRx1) || force)
{
reverseAPIKeys.append("ncoFrequencyRx1");
reverseAPIKeys.append("ncoEnableRx1");
applyRxNCOFrequency(1, settings.m_ncoEnableRx1, settings.m_ncoFrequencyRx1);
}
if ((m_settings.m_log2SoftDecim != settings.m_log2SoftDecim) || force) if ((m_settings.m_log2SoftDecim != settings.m_log2SoftDecim) || force)
{ {
reverseAPIKeys.append("log2SoftDecim"); reverseAPIKeys.append("log2SoftDecim");
@ -844,32 +874,27 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
applyRxAntennaPath(1, doCalibrationRx1, settings.m_antennaPathRx1); applyRxAntennaPath(1, doCalibrationRx1, settings.m_antennaPathRx1);
} }
if ((m_settings.m_rxCenterFrequency != settings.m_rxCenterFrequency)
|| (m_settings.m_rxTransverterMode != settings.m_rxTransverterMode)
|| (m_settings.m_rxTransverterDeltaFrequency != settings.m_rxTransverterDeltaFrequency)
|| force)
{
reverseAPIKeys.append("rxCenterFrequency");
reverseAPIKeys.append("rxTransverterMode");
reverseAPIKeys.append("rxTransverterDeltaFrequency");
if (m_deviceParams->getDevice())
{
if (LMS_SetClockFreq(m_deviceParams->getDevice(), LMS_CLOCK_SXR, rxDeviceCenterFrequency) < 0)
{
qCritical("LimeSDRMIMO::applySettings: could not set Rx frequency to %lld", rxDeviceCenterFrequency);
}
else
{
doCalibrationRx0 = true;
doCalibrationRx1 = true;
qDebug("LimeSDRMIMO::applySettings: Rx frequency set to %lld", rxDeviceCenterFrequency);
}
}
}
// Tx // Tx
if ((m_settings.m_log2HardInterp != settings.m_log2HardInterp) || force) {
reverseAPIKeys.append("log2HardInterp");
}
if ((m_settings.m_txCenterFrequency != settings.m_txCenterFrequency) || force) {
reverseAPIKeys.append("txCenterFrequency");
}
if ((m_settings.m_txTransverterMode != settings.m_txTransverterMode) || force) {
reverseAPIKeys.append("txTransverterMode");
}
if ((m_settings.m_txTransverterDeltaFrequency != settings.m_txTransverterDeltaFrequency) || force) {
reverseAPIKeys.append("txTransverterDeltaFrequency");
}
if ((m_settings.m_ncoFrequencyTx != settings.m_ncoFrequencyTx) || force) {
reverseAPIKeys.append("ncoFrequencyTx");
}
if ((m_settings.m_ncoEnableTx != settings.m_ncoEnableTx) || force) {
reverseAPIKeys.append("ncoEnableTx");
}
if ((m_settings.m_gainTx0 != settings.m_gainTx0) || force) if ((m_settings.m_gainTx0 != settings.m_gainTx0) || force)
{ {
reverseAPIKeys.append("gainTx0"); reverseAPIKeys.append("gainTx0");
@ -885,7 +910,7 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) if ((m_settings.m_devSampleRate != settings.m_devSampleRate)
|| (m_settings.m_log2HardInterp != settings.m_log2HardInterp) || force) || (m_settings.m_log2HardInterp != settings.m_log2HardInterp) || force)
{ {
reverseAPIKeys.append("log2HardInterp"); forwardChangeTxDSP = true;
if (m_deviceParams->getDevice()) if (m_deviceParams->getDevice())
{ {
@ -928,6 +953,38 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
qDebug("LimeSDRMIMO::applySettings: resize MO FIFO: rate %u", fifoRate); qDebug("LimeSDRMIMO::applySettings: resize MO FIFO: rate %u", fifoRate);
} }
if ((m_settings.m_txCenterFrequency != settings.m_txCenterFrequency)
|| (m_settings.m_txTransverterMode != settings.m_txTransverterMode)
|| (m_settings.m_txTransverterDeltaFrequency != settings.m_txTransverterDeltaFrequency)
|| force)
{
forwardChangeTxDSP = true;
if (m_deviceParams->getDevice())
{
if (LMS_SetClockFreq(m_deviceParams->getDevice(), LMS_CLOCK_SXT, txDeviceCenterFrequency) < 0)
{
qCritical("LimeSDRMIMO::applySettings: could not set Tx frequency to %lld", txDeviceCenterFrequency);
}
else
{
doCalibrationTx0 = true;
doCalibrationTx1 = true;
qDebug("LimeSDRMIMO::applySettings: Tx frequency set to %lld", txDeviceCenterFrequency);
}
}
}
if ((m_settings.m_ncoFrequencyTx != settings.m_ncoFrequencyTx) ||
(m_settings.m_ncoEnableTx != settings.m_ncoEnableTx) || force || forceTxNCOFrequency)
{
forwardChangeTxDSP = true;
applyTxNCOFrequency(0, settings.m_ncoEnableTx, settings.m_ncoFrequencyTx);
applyTxNCOFrequency(1, settings.m_ncoEnableTx, settings.m_ncoFrequencyTx);
}
// Tx 0/1
if ((m_settings.m_lpfBWTx0 != settings.m_lpfBWTx0) || force) if ((m_settings.m_lpfBWTx0 != settings.m_lpfBWTx0) || force)
{ {
reverseAPIKeys.append("lpfBWTx0"); reverseAPIKeys.append("lpfBWTx0");
@ -956,22 +1013,6 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
applyTxLPFIRBW(1, settings.m_lpfFIREnableTx1, settings.m_lpfFIRBWTx1); applyTxLPFIRBW(1, settings.m_lpfFIREnableTx1, settings.m_lpfFIRBWTx1);
} }
if ((m_settings.m_ncoFrequencyTx0 != settings.m_ncoFrequencyTx0) ||
(m_settings.m_ncoEnableTx0 != settings.m_ncoEnableTx0) || force || forceTxNCOFrequency)
{
reverseAPIKeys.append("ncoFrequencyTx0");
reverseAPIKeys.append("ncoEnableTx0");
applyTxNCOFrequency(0, settings.m_ncoEnableTx0, settings.m_ncoFrequencyTx0);
}
if ((m_settings.m_ncoFrequencyTx1 != settings.m_ncoFrequencyTx1) ||
(m_settings.m_ncoEnableTx1 != settings.m_ncoEnableTx1) || force || forceTxNCOFrequency)
{
reverseAPIKeys.append("ncoFrequencyTx1");
reverseAPIKeys.append("ncoEnableTx1");
applyTxNCOFrequency(1, settings.m_ncoEnableTx1, settings.m_ncoFrequencyTx1);
}
if ((m_settings.m_log2SoftInterp != settings.m_log2SoftInterp) || force) if ((m_settings.m_log2SoftInterp != settings.m_log2SoftInterp) || force)
{ {
reverseAPIKeys.append("log2SoftInterp"); reverseAPIKeys.append("log2SoftInterp");
@ -995,32 +1036,7 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
applyTxAntennaPath(1, doCalibrationTx1, settings.m_antennaPathTx1); applyTxAntennaPath(1, doCalibrationTx1, settings.m_antennaPathTx1);
} }
if ((m_settings.m_txCenterFrequency != settings.m_txCenterFrequency) // Post common
|| (m_settings.m_txTransverterMode != settings.m_txTransverterMode)
|| (m_settings.m_txTransverterDeltaFrequency != settings.m_txTransverterDeltaFrequency)
|| force)
{
reverseAPIKeys.append("txCenterFrequency");
reverseAPIKeys.append("txTransverterMode");
reverseAPIKeys.append("txTransverterDeltaFrequency");
forwardChangeTxDSP = true;
if (m_deviceParams->getDevice())
{
if (LMS_SetClockFreq(m_deviceParams->getDevice(), LMS_CLOCK_SXT, txDeviceCenterFrequency) < 0)
{
qCritical("LimeSDRMIMO::applySettings: could not set Tx frequency to %lld", txDeviceCenterFrequency);
}
else
{
doCalibrationTx0 = true;
doCalibrationTx1 = true;
qDebug("LimeSDRMIMO::applySettings: Tx frequency set to %lld", txDeviceCenterFrequency);
}
}
}
// common
if ((m_settings.m_extClock != settings.m_extClock) || if ((m_settings.m_extClock != settings.m_extClock) ||
(settings.m_extClock && (m_settings.m_extClockFreq != settings.m_extClockFreq)) || force) (settings.m_extClock && (m_settings.m_extClockFreq != settings.m_extClockFreq)) || force)
@ -1152,6 +1168,30 @@ bool LimeSDRMIMO::applySettings(const LimeSDRMIMOSettings& settings, bool force)
m_sinkThread->startWork(); m_sinkThread->startWork();
} }
} }
// forward changes
if (forwardChangeRxDSP)
{
int sampleRate = settings.m_devSampleRate/(1<<settings.m_log2SoftDecim);
int ncoShift = m_settings.m_ncoEnableRx ? m_settings.m_ncoFrequencyRx : 0;
DSPMIMOSignalNotification *notif0 = new DSPMIMOSignalNotification(sampleRate, settings.m_rxCenterFrequency + ncoShift, true, 0);
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif0);
DSPMIMOSignalNotification *notif1 = new DSPMIMOSignalNotification(sampleRate, settings.m_rxCenterFrequency + ncoShift, true, 1);
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif1);
}
if (forwardChangeTxDSP)
{
int sampleRate = settings.m_devSampleRate/(1<<settings.m_log2SoftInterp);
int ncoShift = m_settings.m_ncoEnableTx ? m_settings.m_ncoFrequencyTx : 0;
DSPMIMOSignalNotification *notif0 = new DSPMIMOSignalNotification(sampleRate, settings.m_txCenterFrequency + ncoShift, false, 0);
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif0);
DSPMIMOSignalNotification *notif1 = new DSPMIMOSignalNotification(sampleRate, settings.m_txCenterFrequency + ncoShift, false, 1);
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif1);
}
return true;
} }
void LimeSDRMIMO::applyRxGainMode( void LimeSDRMIMO::applyRxGainMode(

View File

@ -445,12 +445,8 @@ void LimeSDRMIMOGUI::setRxCenterFrequencyDisplay()
int64_t centerFrequency = m_settings.m_rxCenterFrequency; int64_t centerFrequency = m_settings.m_rxCenterFrequency;
ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000)); ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
if ((m_streamIndex == 0) && (m_settings.m_ncoEnableRx0)) { if (m_settings.m_ncoEnableRx) {
centerFrequency += m_settings.m_ncoFrequencyRx0; centerFrequency += m_settings.m_ncoFrequencyRx;
}
if ((m_streamIndex == 1) && (m_settings.m_ncoEnableRx1)) {
centerFrequency += m_settings.m_ncoFrequencyRx1;
} }
ui->centerFrequency->blockSignals(true); ui->centerFrequency->blockSignals(true);
@ -462,10 +458,8 @@ void LimeSDRMIMOGUI::setRxCenterFrequencySetting(uint64_t kHzValue)
{ {
int64_t centerFrequency = kHzValue*1000; int64_t centerFrequency = kHzValue*1000;
if (m_streamIndex == 0 && m_settings.m_ncoEnableRx0) { if (m_settings.m_ncoEnableRx) {
centerFrequency -= m_settings.m_ncoFrequencyRx0; centerFrequency -= m_settings.m_ncoFrequencyRx;
} else if (m_streamIndex == 1 && m_settings.m_ncoEnableRx1) {
centerFrequency -= m_settings.m_ncoFrequencyRx1;
} }
m_settings.m_rxCenterFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency; m_settings.m_rxCenterFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency;
@ -488,12 +482,8 @@ void LimeSDRMIMOGUI::setTxCenterFrequencyDisplay()
int64_t centerFrequency = m_settings.m_txCenterFrequency; int64_t centerFrequency = m_settings.m_txCenterFrequency;
ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000)); ui->centerFrequency->setToolTip(QString("Main center frequency in kHz (LO: %1 kHz)").arg(centerFrequency/1000));
if ((m_streamIndex == 0) && (m_settings.m_ncoEnableTx0)) { if (m_settings.m_ncoEnableTx) {
centerFrequency += m_settings.m_ncoFrequencyTx0; centerFrequency += m_settings.m_ncoFrequencyTx;
}
if ((m_streamIndex == 1) && (m_settings.m_ncoEnableTx1)) {
centerFrequency += m_settings.m_ncoFrequencyTx1;
} }
ui->centerFrequency->blockSignals(true); ui->centerFrequency->blockSignals(true);
@ -505,10 +495,8 @@ void LimeSDRMIMOGUI::setTxCenterFrequencySetting(uint64_t kHzValue)
{ {
int64_t centerFrequency = kHzValue*1000; int64_t centerFrequency = kHzValue*1000;
if (m_streamIndex == 0 && m_settings.m_ncoEnableTx0) { if (m_settings.m_ncoEnableTx) {
centerFrequency -= m_settings.m_ncoFrequencyTx0; centerFrequency -= m_settings.m_ncoFrequencyTx;
} else if (m_streamIndex == 1 && m_settings.m_ncoEnableTx1) {
centerFrequency -= m_settings.m_ncoFrequencyTx1;
} }
m_settings.m_txCenterFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency; m_settings.m_txCenterFrequency = centerFrequency < 0 ? 0 : (uint64_t) centerFrequency;
@ -571,18 +559,8 @@ void LimeSDRMIMOGUI::setNCODisplay()
ui->ncoFrequency->blockSignals(true); ui->ncoFrequency->blockSignals(true);
ui->ncoFrequency->setToolTip(QString("NCO frequency shift in Hz (Range: +/- %1 kHz)").arg(ncoHalfRange/1000)); ui->ncoFrequency->setToolTip(QString("NCO frequency shift in Hz (Range: +/- %1 kHz)").arg(ncoHalfRange/1000));
ui->ncoFrequency->setValue(m_settings.m_ncoFrequencyRx);
if (m_streamIndex == 0) ui->ncoEnable->setChecked(m_settings.m_ncoEnableRx);
{
ui->ncoFrequency->setValue(m_settings.m_ncoFrequencyRx0);
ui->ncoEnable->setChecked(m_settings.m_ncoEnableRx0);
}
else
{
ui->ncoFrequency->setValue(m_settings.m_ncoFrequencyRx1);
ui->ncoEnable->setChecked(m_settings.m_ncoEnableRx1);
}
ui->ncoFrequency->blockSignals(false); ui->ncoFrequency->blockSignals(false);
} }
else else
@ -596,18 +574,8 @@ void LimeSDRMIMOGUI::setNCODisplay()
ui->ncoFrequency->blockSignals(true); ui->ncoFrequency->blockSignals(true);
ui->ncoFrequency->setToolTip(QString("NCO frequency shift in Hz (Range: +/- %1 kHz)").arg(ncoHalfRange/1000)); ui->ncoFrequency->setToolTip(QString("NCO frequency shift in Hz (Range: +/- %1 kHz)").arg(ncoHalfRange/1000));
ui->ncoFrequency->setValue(m_settings.m_ncoFrequencyTx);
if (m_streamIndex == 0) ui->ncoEnable->setChecked(m_settings.m_ncoEnableTx);
{
ui->ncoFrequency->setValue(m_settings.m_ncoFrequencyTx0);
ui->ncoEnable->setChecked(m_settings.m_ncoEnableTx0);
}
else
{
ui->ncoFrequency->setValue(m_settings.m_ncoFrequencyTx1);
ui->ncoEnable->setChecked(m_settings.m_ncoEnableTx1);
}
ui->ncoFrequency->blockSignals(false); ui->ncoFrequency->blockSignals(false);
} }
} }
@ -848,22 +816,12 @@ void LimeSDRMIMOGUI::on_ncoEnable_toggled(bool checked)
{ {
if (m_rxElseTx) if (m_rxElseTx)
{ {
if (m_streamIndex == 0) { m_settings.m_ncoEnableRx = checked;
m_settings.m_ncoEnableRx0 = checked;
} else if (m_streamIndex == 1) {
m_settings.m_ncoEnableRx1 = checked;
}
setRxCenterFrequencyDisplay(); setRxCenterFrequencyDisplay();
} }
else else
{ {
if (m_streamIndex == 0) { m_settings.m_ncoEnableTx = checked;
m_settings.m_ncoEnableTx0 = checked;
} else if (m_streamIndex == 1) {
m_settings.m_ncoEnableTx1 = checked;
}
setTxCenterFrequencyDisplay(); setTxCenterFrequencyDisplay();
} }
@ -874,22 +832,12 @@ void LimeSDRMIMOGUI::on_ncoFrequency_changed(qint64 value)
{ {
if (m_rxElseTx) if (m_rxElseTx)
{ {
if (m_streamIndex == 0) { m_settings.m_ncoFrequencyRx = value;
m_settings.m_ncoFrequencyRx0 = value;
} else if (m_streamIndex == 1) {
m_settings.m_ncoFrequencyRx1 = value;
}
setRxCenterFrequencyDisplay(); setRxCenterFrequencyDisplay();
} }
else else
{ {
if (m_streamIndex == 0) { m_settings.m_ncoFrequencyTx = value;
m_settings.m_ncoFrequencyTx0 = value;
} else if (m_streamIndex == 1) {
m_settings.m_ncoFrequencyTx1 = value;
}
setTxCenterFrequencyDisplay(); setTxCenterFrequencyDisplay();
} }

View File

@ -365,25 +365,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="channelNumberText">
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Channel number</string>
</property>
<property name="text">
<string>#0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -572,6 +553,71 @@
<property name="topMargin"> <property name="topMargin">
<number>2</number> <number>2</number>
</property> </property>
<item>
<widget class="QToolButton" name="sampleRateMode">
<property name="minimumSize">
<size>
<width>26</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>26</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Toggle between device to host (SR) and base band (BB) sample rate input</string>
</property>
<property name="text">
<string>SR</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="ValueDial" name="sampleRate" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
<property name="font">
<font>
<family>Liberation Mono</family>
<pointsize>12</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string>Device to host sample rate</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="samplerateUnit">
<property name="text">
<string>S/s</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="hwDecimLabel"> <widget class="QLabel" name="hwDecimLabel">
<property name="text"> <property name="text">
@ -582,6 +628,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QComboBox" name="hwDecim"> <widget class="QComboBox" name="hwDecim">
<property name="maximumSize"> <property name="maximumSize">
@ -689,84 +748,6 @@
</item> </item>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="sampleRateMode">
<property name="minimumSize">
<size>
<width>26</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>26</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Toggle between device to host (SR) and base band (BB) sample rate input</string>
</property>
<property name="text">
<string>SR</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="ValueDial" name="sampleRate" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>32</width>
<height>16</height>
</size>
</property>
<property name="font">
<font>
<family>Liberation Mono</family>
<pointsize>12</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="toolTip">
<string>Device to host sample rate</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="samplerateUnit">
<property name="text">
<string>S/s</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>

View File

@ -45,13 +45,13 @@ void LimeSDRMIMOSettings::resetToDefaults()
m_iqCorrection = false; m_iqCorrection = false;
m_rxTransverterMode = false; m_rxTransverterMode = false;
m_rxTransverterDeltaFrequency = 0; m_rxTransverterDeltaFrequency = 0;
m_ncoEnableRx = false;
m_ncoFrequencyRx = 0;
m_lpfBWRx0 = 4.5e6f; m_lpfBWRx0 = 4.5e6f;
m_lpfFIREnableRx0 = false; m_lpfFIREnableRx0 = false;
m_lpfFIRBWRx0 = 2.5e6f; m_lpfFIRBWRx0 = 2.5e6f;
m_gainRx0 = 50; m_gainRx0 = 50;
m_ncoEnableRx0 = false;
m_ncoFrequencyRx0 = 0;
m_antennaPathRx0 = PATH_RFE_RX_NONE; m_antennaPathRx0 = PATH_RFE_RX_NONE;
m_gainModeRx0 = GAIN_AUTO; m_gainModeRx0 = GAIN_AUTO;
m_lnaGainRx0 = 15; m_lnaGainRx0 = 15;
@ -62,8 +62,6 @@ void LimeSDRMIMOSettings::resetToDefaults()
m_lpfFIREnableRx1 = false; m_lpfFIREnableRx1 = false;
m_lpfFIRBWRx1 = 2.5e6f; m_lpfFIRBWRx1 = 2.5e6f;
m_gainRx1 = 50; m_gainRx1 = 50;
m_ncoEnableRx1 = false;
m_ncoFrequencyRx1 = 0;
m_antennaPathRx1 = PATH_RFE_RX_NONE; m_antennaPathRx1 = PATH_RFE_RX_NONE;
m_gainModeRx1 = GAIN_AUTO; m_gainModeRx1 = GAIN_AUTO;
m_lnaGainRx1 = 15; m_lnaGainRx1 = 15;
@ -75,21 +73,19 @@ void LimeSDRMIMOSettings::resetToDefaults()
m_log2SoftInterp = 0; m_log2SoftInterp = 0;
m_txTransverterMode = false; m_txTransverterMode = false;
m_txTransverterDeltaFrequency = 0; m_txTransverterDeltaFrequency = 0;
m_ncoEnableTx = false;
m_ncoFrequencyTx = 0;
m_lpfBWTx0 = 5.5e6f; m_lpfBWTx0 = 5.5e6f;
m_lpfFIREnableTx0 = false; m_lpfFIREnableTx0 = false;
m_lpfFIRBWTx0 = 2.5e6f; m_lpfFIRBWTx0 = 2.5e6f;
m_gainTx0 = 4; m_gainTx0 = 4;
m_ncoEnableTx0 = false;
m_ncoFrequencyTx0 = 0;
m_antennaPathTx0 = PATH_RFE_TX_NONE; m_antennaPathTx0 = PATH_RFE_TX_NONE;
m_lpfBWTx1 = 5.5e6f; m_lpfBWTx1 = 5.5e6f;
m_lpfFIREnableTx1 = false; m_lpfFIREnableTx1 = false;
m_lpfFIRBWTx1 = 2.5e6f; m_lpfFIRBWTx1 = 2.5e6f;
m_gainTx1 = 4; m_gainTx1 = 4;
m_ncoEnableTx1 = false;
m_ncoFrequencyTx1 = 0;
m_antennaPathTx1 = PATH_RFE_TX_NONE; m_antennaPathTx1 = PATH_RFE_TX_NONE;
} }
@ -116,52 +112,48 @@ QByteArray LimeSDRMIMOSettings::serialize() const
s.writeBool(24, m_iqCorrection); s.writeBool(24, m_iqCorrection);
s.writeBool(25, m_rxTransverterMode); s.writeBool(25, m_rxTransverterMode);
s.writeS64(26, m_rxTransverterDeltaFrequency); s.writeS64(26, m_rxTransverterDeltaFrequency);
s.writeBool(27, m_ncoEnableRx);
s.writeS32(28, m_ncoFrequencyRx);
s.writeFloat(30, m_lpfBWRx0); s.writeFloat(30, m_lpfBWRx0);
s.writeBool(31, m_lpfFIREnableRx0); s.writeBool(31, m_lpfFIREnableRx0);
s.writeFloat(32, m_lpfFIRBWRx0); s.writeFloat(32, m_lpfFIRBWRx0);
s.writeU32(33, m_gainRx0); s.writeU32(33, m_gainRx0);
s.writeBool(34, m_ncoEnableRx0); s.writeS32(34, (int) m_antennaPathRx0);
s.writeS32(35, m_ncoFrequencyRx0); s.writeS32(35, (int) m_gainModeRx0);
s.writeS32(36, (int) m_antennaPathRx0); s.writeU32(36, m_lnaGainRx0);
s.writeS32(37, (int) m_gainModeRx0); s.writeU32(37, m_tiaGainRx0);
s.writeU32(38, m_lnaGainRx0); s.writeU32(38, m_pgaGainRx0);
s.writeU32(39, m_tiaGainRx0);
s.writeU32(40, m_pgaGainRx0);
s.writeFloat(50, m_lpfBWRx1); s.writeFloat(50, m_lpfBWRx1);
s.writeBool(51, m_lpfFIREnableRx1); s.writeBool(51, m_lpfFIREnableRx1);
s.writeFloat(52, m_lpfFIRBWRx1); s.writeFloat(52, m_lpfFIRBWRx1);
s.writeU32(53, m_gainRx1); s.writeU32(53, m_gainRx1);
s.writeBool(54, m_ncoEnableRx1); s.writeS32(54, (int) m_antennaPathRx1);
s.writeS32(55, m_ncoFrequencyRx1); s.writeS32(55, (int) m_gainModeRx1);
s.writeS32(56, (int) m_antennaPathRx1); s.writeU32(56, m_lnaGainRx1);
s.writeS32(57, (int) m_gainModeRx1); s.writeU32(57, m_tiaGainRx1);
s.writeU32(58, m_lnaGainRx1); s.writeU32(58, m_pgaGainRx1);
s.writeU32(59, m_tiaGainRx1);
s.writeU32(60, m_pgaGainRx1);
s.writeU64(70, m_txCenterFrequency); s.writeU64(70, m_txCenterFrequency);
s.writeU32(71, m_log2HardInterp); s.writeU32(71, m_log2HardInterp);
s.writeU32(72, m_log2SoftInterp); s.writeU32(72, m_log2SoftInterp);
s.writeBool(73, m_txTransverterMode); s.writeBool(73, m_txTransverterMode);
s.writeS64(74, m_txTransverterDeltaFrequency); s.writeS64(74, m_txTransverterDeltaFrequency);
s.writeBool(75, m_ncoEnableTx);
s.writeS32(76, m_ncoFrequencyTx);
s.writeFloat(80, m_lpfBWTx0); s.writeFloat(80, m_lpfBWTx0);
s.writeBool(81, m_lpfFIREnableTx0); s.writeBool(81, m_lpfFIREnableTx0);
s.writeFloat(82, m_lpfFIRBWTx0); s.writeFloat(82, m_lpfFIRBWTx0);
s.writeU32(83, m_gainTx0); s.writeU32(83, m_gainTx0);
s.writeBool(84, m_ncoEnableTx0); s.writeS32(84, (int) m_antennaPathTx0);
s.writeS32(85, m_ncoFrequencyTx0);
s.writeS32(86, (int) m_antennaPathTx0);
s.writeFloat(90, m_lpfBWTx1); s.writeFloat(90, m_lpfBWTx1);
s.writeBool(91, m_lpfFIREnableTx1); s.writeBool(91, m_lpfFIREnableTx1);
s.writeFloat(92, m_lpfFIRBWTx1); s.writeFloat(92, m_lpfFIRBWTx1);
s.writeU32(93, m_gainTx1); s.writeU32(93, m_gainTx1);
s.writeBool(94, m_ncoEnableTx1); s.writeS32(94, (int) m_antennaPathTx1);
s.writeS32(95, m_ncoFrequencyTx1);
s.writeS32(96, (int) m_antennaPathTx1);
return s.final(); return s.final();
} }
@ -210,57 +202,53 @@ bool LimeSDRMIMOSettings::deserialize(const QByteArray& data)
d.readBool(24, &m_iqCorrection, false); d.readBool(24, &m_iqCorrection, false);
d.readBool(25, &m_rxTransverterMode, false); d.readBool(25, &m_rxTransverterMode, false);
d.readS64(26, &m_rxTransverterDeltaFrequency, 0); d.readS64(26, &m_rxTransverterDeltaFrequency, 0);
d.readBool(27, &m_ncoEnableRx, false);
d.readS32(28, &m_ncoFrequencyRx, 0);
d.readFloat(30, &m_lpfBWRx0, 1.5e6); d.readFloat(30, &m_lpfBWRx0, 1.5e6);
d.readBool(31, &m_lpfFIREnableRx0, false); d.readBool(31, &m_lpfFIREnableRx0, false);
d.readFloat(32, &m_lpfFIRBWRx0, 1.5e6); d.readFloat(32, &m_lpfFIRBWRx0, 1.5e6);
d.readU32(33, &m_gainRx0, 50); d.readU32(33, &m_gainRx0, 50);
d.readBool(34, &m_ncoEnableRx0, false); d.readS32(34, &intval, 0);
d.readS32(35, &m_ncoFrequencyRx0, 0);
d.readS32(36, &intval, 0);
m_antennaPathRx0 = (PathRxRFE) intval; m_antennaPathRx0 = (PathRxRFE) intval;
d.readS32(37, &intval, 0); d.readS32(35, &intval, 0);
m_gainModeRx0 = (RxGainMode) intval; m_gainModeRx0 = (RxGainMode) intval;
d.readU32(38, &m_lnaGainRx0, 15); d.readU32(36, &m_lnaGainRx0, 15);
d.readU32(39, &m_tiaGainRx0, 2); d.readU32(37, &m_tiaGainRx0, 2);
d.readU32(40, &m_pgaGainRx0, 16); d.readU32(38, &m_pgaGainRx0, 16);
d.readFloat(50, &m_lpfBWRx1, 1.5e6); d.readFloat(50, &m_lpfBWRx1, 1.5e6);
d.readBool(51, &m_lpfFIREnableRx1, false); d.readBool(51, &m_lpfFIREnableRx1, false);
d.readFloat(52, &m_lpfFIRBWRx1, 1.5e6); d.readFloat(52, &m_lpfFIRBWRx1, 1.5e6);
d.readU32(53, &m_gainRx1, 50); d.readU32(53, &m_gainRx1, 50);
d.readBool(54, &m_ncoEnableRx1, false); d.readS32(54, &intval, 0);
d.readS32(55, &m_ncoFrequencyRx1, 0);
d.readS32(56, &intval, 0);
m_antennaPathRx1 = (PathRxRFE) intval; m_antennaPathRx1 = (PathRxRFE) intval;
d.readS32(57, &intval, 0); d.readS32(55, &intval, 0);
m_gainModeRx1 = (RxGainMode) intval; m_gainModeRx1 = (RxGainMode) intval;
d.readU32(58, &m_lnaGainRx1, 15); d.readU32(56, &m_lnaGainRx1, 15);
d.readU32(59, &m_tiaGainRx1, 2); d.readU32(57, &m_tiaGainRx1, 2);
d.readU32(60, &m_pgaGainRx1, 16); d.readU32(58, &m_pgaGainRx1, 16);
d.readU64(70, &m_txCenterFrequency, 435000*1000); d.readU64(70, &m_txCenterFrequency, 435000*1000);
d.readU32(71, &m_log2HardInterp, 2); d.readU32(71, &m_log2HardInterp, 2);
d.readU32(72, &m_log2SoftInterp, 0); d.readU32(72, &m_log2SoftInterp, 0);
d.readBool(73, &m_txTransverterMode, false); d.readBool(73, &m_txTransverterMode, false);
d.readS64(74, &m_txTransverterDeltaFrequency, 0); d.readS64(74, &m_txTransverterDeltaFrequency, 0);
d.readBool(75, &m_ncoEnableTx, false);
d.readS32(76, &m_ncoFrequencyTx, 0);
d.readFloat(80, &m_lpfBWTx0, 1.5e6); d.readFloat(80, &m_lpfBWTx0, 1.5e6);
d.readBool(81, &m_lpfFIREnableTx0, false); d.readBool(81, &m_lpfFIREnableTx0, false);
d.readFloat(82, &m_lpfFIRBWTx0, 1.5e6); d.readFloat(82, &m_lpfFIRBWTx0, 1.5e6);
d.readU32(83, &m_gainTx0, 4); d.readU32(83, &m_gainTx0, 4);
d.readBool(84, &m_ncoEnableTx0, false); d.readS32(84, &intval, 0);
d.readS32(85, &m_ncoFrequencyTx0, 0);
d.readS32(86, &intval, 0);
m_antennaPathTx0 = (PathTxRFE) intval; m_antennaPathTx0 = (PathTxRFE) intval;
d.readFloat(90, &m_lpfBWTx1, 1.5e6); d.readFloat(90, &m_lpfBWTx1, 1.5e6);
d.readBool(91, &m_lpfFIREnableTx1, false); d.readBool(91, &m_lpfFIREnableTx1, false);
d.readFloat(92, &m_lpfFIRBWTx1, 1.5e6); d.readFloat(92, &m_lpfFIRBWTx1, 1.5e6);
d.readU32(93, &m_gainTx1, 4); d.readU32(93, &m_gainTx1, 4);
d.readBool(94, &m_ncoEnableTx1, false); d.readS32(94, &intval, 0);
d.readS32(95, &m_ncoFrequencyTx1, 0);
d.readS32(96, &intval, 0);
m_antennaPathTx1 = (PathTxRFE) intval; m_antennaPathTx1 = (PathTxRFE) intval;
return true; return true;

View File

@ -72,14 +72,14 @@ struct LimeSDRMIMOSettings
bool m_iqCorrection; bool m_iqCorrection;
bool m_rxTransverterMode; bool m_rxTransverterMode;
qint64 m_rxTransverterDeltaFrequency; qint64 m_rxTransverterDeltaFrequency;
bool m_ncoEnableRx; //!< Rx Enable TSP NCO and mixing
int m_ncoFrequencyRx; //!< Rx Actual NCO frequency (the resulting frequency with mixing is displayed)
// Rx channel 0 // Rx channel 0
float m_lpfBWRx0; //!< Rx[0] LMS analog lowpass filter bandwidth (Hz) float m_lpfBWRx0; //!< Rx[0] LMS analog lowpass filter bandwidth (Hz)
bool m_lpfFIREnableRx0; //!< Rx[0] Enable LMS digital lowpass FIR filters bool m_lpfFIREnableRx0; //!< Rx[0] Enable LMS digital lowpass FIR filters
float m_lpfFIRBWRx0; //!< Rx[0] LMS digital lowpass FIR filters bandwidth (Hz) float m_lpfFIRBWRx0; //!< Rx[0] LMS digital lowpass FIR filters bandwidth (Hz)
uint32_t m_gainRx0; //!< Rx[0] Optimally distributed gain (dB) uint32_t m_gainRx0; //!< Rx[0] Optimally distributed gain (dB)
bool m_ncoEnableRx0; //!< Rx[0] Enable TSP NCO and mixing
int m_ncoFrequencyRx0; //!< Rx[0] Actual NCO frequency (the resulting frequency with mixing is displayed)
PathRxRFE m_antennaPathRx0; //!< Rx[0] Antenna connection PathRxRFE m_antennaPathRx0; //!< Rx[0] Antenna connection
RxGainMode m_gainModeRx0; //!< Rx[0] Gain mode: auto or manual RxGainMode m_gainModeRx0; //!< Rx[0] Gain mode: auto or manual
uint32_t m_lnaGainRx0; //!< Rx[0] Manual LAN gain uint32_t m_lnaGainRx0; //!< Rx[0] Manual LAN gain
@ -91,8 +91,6 @@ struct LimeSDRMIMOSettings
bool m_lpfFIREnableRx1; //!< Rx[1] Enable LMS digital lowpass FIR filters bool m_lpfFIREnableRx1; //!< Rx[1] Enable LMS digital lowpass FIR filters
float m_lpfFIRBWRx1; //!< Rx[1] LMS digital lowpass FIR filters bandwidth (Hz) float m_lpfFIRBWRx1; //!< Rx[1] LMS digital lowpass FIR filters bandwidth (Hz)
uint32_t m_gainRx1; //!< Rx[1] Optimally distributed gain (dB) uint32_t m_gainRx1; //!< Rx[1] Optimally distributed gain (dB)
bool m_ncoEnableRx1; //!< Rx[1] Enable TSP NCO and mixing
int m_ncoFrequencyRx1; //!< Rx[1] Actual NCO frequency (the resulting frequency with mixing is displayed)
PathRxRFE m_antennaPathRx1; //!< Rx[1] Antenna connection PathRxRFE m_antennaPathRx1; //!< Rx[1] Antenna connection
RxGainMode m_gainModeRx1; //!< Rx[1] Gain mode: auto or manual RxGainMode m_gainModeRx1; //!< Rx[1] Gain mode: auto or manual
uint32_t m_lnaGainRx1; //!< Rx[1] Manual LAN gain uint32_t m_lnaGainRx1; //!< Rx[1] Manual LAN gain
@ -105,14 +103,14 @@ struct LimeSDRMIMOSettings
uint32_t m_log2SoftInterp; uint32_t m_log2SoftInterp;
bool m_txTransverterMode; bool m_txTransverterMode;
qint64 m_txTransverterDeltaFrequency; qint64 m_txTransverterDeltaFrequency;
bool m_ncoEnableTx; //!< Tx Enable TSP NCO and mixing
int m_ncoFrequencyTx; //!< Tx Actual NCO frequency (the resulting frequency with mixing is displayed)
// Tx channel 0 // Tx channel 0
float m_lpfBWTx0; //!< Tx[0] LMS amalog lowpass filter bandwidth (Hz) float m_lpfBWTx0; //!< Tx[0] LMS amalog lowpass filter bandwidth (Hz)
bool m_lpfFIREnableTx0; //!< Tx[0] Enable LMS digital lowpass FIR filters bool m_lpfFIREnableTx0; //!< Tx[0] Enable LMS digital lowpass FIR filters
float m_lpfFIRBWTx0; //!< Tx[0] LMS digital lowpass FIR filters bandwidth (Hz) float m_lpfFIRBWTx0; //!< Tx[0] LMS digital lowpass FIR filters bandwidth (Hz)
uint32_t m_gainTx0; //!< Tx[0] Optimally distributed gain (dB) uint32_t m_gainTx0; //!< Tx[0] Optimally distributed gain (dB)
bool m_ncoEnableTx0; //!< Tx[0] Enable TSP NCO and mixing
int m_ncoFrequencyTx0; //!< Tx[0] Actual NCO frequency (the resulting frequency with mixing is displayed)
PathTxRFE m_antennaPathTx0; //!< Tx[0] Antenna connection PathTxRFE m_antennaPathTx0; //!< Tx[0] Antenna connection
// Tx channel 1 // Tx channel 1
@ -120,8 +118,6 @@ struct LimeSDRMIMOSettings
bool m_lpfFIREnableTx1; //!< Tx[1] Enable LMS digital lowpass FIR filters bool m_lpfFIREnableTx1; //!< Tx[1] Enable LMS digital lowpass FIR filters
float m_lpfFIRBWTx1; //!< Tx[1] LMS digital lowpass FIR filters bandwidth (Hz) float m_lpfFIRBWTx1; //!< Tx[1] LMS digital lowpass FIR filters bandwidth (Hz)
uint32_t m_gainTx1; //!< Tx[1] Optimally distributed gain (dB) uint32_t m_gainTx1; //!< Tx[1] Optimally distributed gain (dB)
bool m_ncoEnableTx1; //!< Tx[1] Enable TSP NCO and mixing
int m_ncoFrequencyTx1; //!< Tx[1] Actual NCO frequency (the resulting frequency with mixing is displayed)
PathTxRFE m_antennaPathTx1; //!< Tx[1] Antenna connection PathTxRFE m_antennaPathTx1; //!< Tx[1] Antenna connection
LimeSDRMIMOSettings(); LimeSDRMIMOSettings();

View File

@ -31,6 +31,9 @@ LimeSDRMIThread::LimeSDRMIThread(lms_stream_t* stream0, lms_stream_t* stream1, Q
for (unsigned int i = 0; i < 2; i++) { for (unsigned int i = 0; i < 2; i++) {
m_convertBuffer[i].resize(DeviceLimeSDR::blockSize, Sample{0,0}); m_convertBuffer[i].resize(DeviceLimeSDR::blockSize, Sample{0,0});
} }
m_vBegin.push_back(m_convertBuffer[0].begin());
m_vBegin.push_back(m_convertBuffer[1].begin());
} }
LimeSDRMIThread::~LimeSDRMIThread() LimeSDRMIThread::~LimeSDRMIThread()
@ -53,6 +56,7 @@ void LimeSDRMIThread::startWork()
if (LMS_StartStream(m_stream0) < 0) if (LMS_StartStream(m_stream0) < 0)
{ {
qCritical("LimeSDRMIThread::startWork: could not start stream 0"); qCritical("LimeSDRMIThread::startWork: could not start stream 0");
return;
} }
else else
{ {
@ -66,6 +70,8 @@ void LimeSDRMIThread::startWork()
if (LMS_StartStream(m_stream1) < 0) if (LMS_StartStream(m_stream1) < 0)
{ {
qCritical("LimeSDRMIThread::startWork: could not start stream 1"); qCritical("LimeSDRMIThread::startWork: could not start stream 1");
LMS_StopStream(m_stream0);
return;
} }
else else
{ {
@ -137,7 +143,6 @@ void LimeSDRMIThread::run()
lms_stream_meta_t metadata; //Use metadata for additional control over sample receive function behaviour lms_stream_meta_t metadata; //Use metadata for additional control over sample receive function behaviour
metadata.flushPartialPacket = false; //Do not discard data remainder when read size differs from packet size metadata.flushPartialPacket = false; //Do not discard data remainder when read size differs from packet size
metadata.waitForTimestamp = false; //Do not wait for specific timestamps metadata.waitForTimestamp = false; //Do not wait for specific timestamps
std::vector<SampleVector::const_iterator> vbegin;
int lengths[2]; int lengths[2];
m_running = true; m_running = true;
@ -160,11 +165,9 @@ void LimeSDRMIThread::run()
else else
{ {
std::fill(m_convertBuffer[0].begin(), m_convertBuffer[0].end(), Sample{0,0}); std::fill(m_convertBuffer[0].begin(), m_convertBuffer[0].end(), Sample{0,0});
lengths[0] = m_convertBuffer[0].size(); lengths[0] = m_convertBuffer[0].size() / (1<<m_log2Decim);
} }
vbegin.push_back(m_convertBuffer[0].begin());
if (m_stream1) if (m_stream1)
{ {
res = LMS_RecvStream(m_stream1, (void *) m_buf[1], DeviceLimeSDR::blockSize, &metadata, 1000); res = LMS_RecvStream(m_stream1, (void *) m_buf[1], DeviceLimeSDR::blockSize, &metadata, 1000);
@ -180,19 +183,18 @@ void LimeSDRMIThread::run()
else else
{ {
std::fill(m_convertBuffer[1].begin(), m_convertBuffer[1].end(), Sample{0,0}); std::fill(m_convertBuffer[1].begin(), m_convertBuffer[1].end(), Sample{0,0});
lengths[1] = m_convertBuffer[1].size(); lengths[1] = m_convertBuffer[1].size() / (1<<m_log2Decim);
} }
vbegin.push_back(m_convertBuffer[1].begin());
if (lengths[0] == lengths[1]) if (lengths[0] == lengths[1])
{ {
m_sampleFifo->writeSync(vbegin, lengths[0]); qDebug("LimeSDRMIThread::run: writeSync %d samples", lengths[0]);
m_sampleFifo->writeSync(m_vBegin, lengths[0]);
} }
else else
{ {
qWarning("LimeSDRMIThread::run: unequal channel lengths: [0]=%d [1]=%d", lengths[0], lengths[1]); qWarning("LimeSDRMIThread::run: unequal channel lengths: [0]=%d [1]=%d", lengths[0], lengths[1]);
m_sampleFifo->writeSync(vbegin, (std::min)(lengths[0], lengths[1])); m_sampleFifo->writeSync(m_vBegin, (std::min)(lengths[0], lengths[1]));
} }
} }

View File

@ -56,6 +56,7 @@ private:
lms_stream_t* m_stream1; lms_stream_t* m_stream1;
qint16 m_buf[2][2*DeviceLimeSDR::blockSize]; qint16 m_buf[2][2*DeviceLimeSDR::blockSize];
SampleVector m_convertBuffer[2]; SampleVector m_convertBuffer[2];
std::vector<SampleVector::const_iterator> m_vBegin;
SampleMIFifo* m_sampleFifo; SampleMIFifo* m_sampleFifo;
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators[2]; Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12> m_decimators[2];
unsigned int m_log2Decim; unsigned int m_log2Decim;

View File

@ -53,6 +53,7 @@ void LimeSDRMOThread::startWork()
if (LMS_StartStream(m_stream0) < 0) if (LMS_StartStream(m_stream0) < 0)
{ {
qCritical("LimeSDROutputThread::startWork: could not start stream 0"); qCritical("LimeSDROutputThread::startWork: could not start stream 0");
return;
} }
else else
{ {
@ -66,6 +67,8 @@ void LimeSDRMOThread::startWork()
if (LMS_StartStream(m_stream1) < 0) if (LMS_StartStream(m_stream1) < 0)
{ {
qCritical("LimeSDROutputThread::startWork: could not start stream 1"); qCritical("LimeSDROutputThread::startWork: could not start stream 1");
LMS_StopStream(m_stream0);
return;
} }
else else
{ {