mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 13:47:01 -04:00
XTRX MIMO
This commit is contained in:
@@ -159,4 +159,52 @@ double DeviceXTRX::setSamplerate(double rate, double master, bool output)
|
||||
}
|
||||
|
||||
return m_inputRate;
|
||||
}
|
||||
}
|
||||
|
||||
bool DeviceXTRX::setSamplerate(double rate, uint32_t log2Decim, uint32_t log2Interp, bool output)
|
||||
{
|
||||
double master, rxRate, txRate;
|
||||
|
||||
if (output)
|
||||
{
|
||||
master = (log2Interp == 0) ? 0 : (rate * 4 * (1 << log2Interp));
|
||||
rxRate = (rate * 4 * (1 << log2Interp)) / (4 * (1 << log2Decim));
|
||||
txRate = rate;
|
||||
}
|
||||
else
|
||||
{
|
||||
master = (log2Decim == 0) ? 0 : (rate * 4 * (1 << log2Decim));
|
||||
rxRate = rate;
|
||||
txRate = (rate * 4 * (1 << log2Decim)) / (4 * (1 << log2Interp));
|
||||
}
|
||||
|
||||
m_masterRate = master;
|
||||
m_inputRate = rxRate;
|
||||
m_outputRate = txRate;
|
||||
|
||||
int res = xtrx_set_samplerate(
|
||||
m_dev,
|
||||
master,
|
||||
rxRate,
|
||||
txRate,
|
||||
XTRX_SAMPLERATE_FORCE_UPDATE,
|
||||
&m_clockGen,
|
||||
&m_actualInputRate,
|
||||
&m_actualOutputRate
|
||||
);
|
||||
|
||||
qDebug() << "DeviceXTRX::setSamplerate: sample rate set: "
|
||||
<< "rate: " << rate
|
||||
<< "log2Decim: " << log2Decim
|
||||
<< "log2Interp: " << log2Interp
|
||||
<< "output: " << output
|
||||
<< "res: "<< res
|
||||
<< "m_masterRate: " << m_masterRate
|
||||
<< "m_inputRate: " << m_inputRate
|
||||
<< "m_outputRate: " << m_outputRate
|
||||
<< "m_clockGen: " << m_clockGen
|
||||
<< "m_actualInputRate: " << m_actualInputRate
|
||||
<< "m_actualOutputRate: " << m_actualOutputRate;
|
||||
|
||||
return !(res < 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user