mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-08 12:38:46 -04:00
UDP source plugin fixes
This commit is contained in:
parent
65b4930171
commit
1c36d07254
@ -431,16 +431,14 @@ void UDPSrc::apply(bool force)
|
||||
m_interpolator.create(16, m_config.m_inputSampleRate, m_config.m_rfBandwidth / 2.0);
|
||||
m_sampleDistanceRemain = m_config.m_inputSampleRate / m_config.m_outputSampleRate;
|
||||
|
||||
int gateNbSamples = m_config.m_inputSampleRate * (m_config.m_squelchGate == 0 ? 0.01 : m_config.m_squelchGate);
|
||||
int agcTimeNbSamples = m_config.m_inputSampleRate * 0.2; // Fixed 200 ms
|
||||
m_squelchThreshold = m_config.m_inputSampleRate * m_config.m_squelchGate;
|
||||
m_squelchThreshold = m_config.m_outputSampleRate * m_config.m_squelchGate;
|
||||
initSquelch(m_squelchOpen);
|
||||
m_agc.resize(agcTimeNbSamples, m_agcTarget);
|
||||
m_agc.setStepDownDelay(gateNbSamples);
|
||||
m_agc.setGate(gateNbSamples);
|
||||
m_agc.resize(m_config.m_outputSampleRate * 0.2, m_agcTarget); // Fixed 200 ms
|
||||
m_agc.setStepDownDelay( m_config.m_outputSampleRate * (m_config.m_squelchGate == 0 ? 0.01 : m_config.m_squelchGate));
|
||||
m_agc.setGate(m_config.m_outputSampleRate * 0.02);
|
||||
|
||||
m_inMovingAverage.resize(m_config.m_inputSampleRate * 0.01, 1e-10); // 10 ms
|
||||
m_amMovingAverage.resize(m_config.m_inputSampleRate * 0.25, 1e-10); // 25 ms
|
||||
m_inMovingAverage.resize(m_config.m_outputSampleRate * 0.01, 1e-10); // 10 ms
|
||||
m_amMovingAverage.resize(m_config.m_outputSampleRate * 0.25, 1e-10); // 25 ms
|
||||
m_outMovingAverage.resize(m_config.m_outputSampleRate * 0.01, 1e-10); // 10 ms
|
||||
}
|
||||
|
||||
@ -459,16 +457,15 @@ void UDPSrc::apply(bool force)
|
||||
|
||||
if ((m_config.m_squelchGate != m_running.m_squelchGate) || force)
|
||||
{
|
||||
int gateNbSamples = m_config.m_inputSampleRate * (m_config.m_squelchGate == 0 ? 0.01 : m_config.m_squelchGate);
|
||||
m_squelchThreshold = m_config.m_inputSampleRate * m_config.m_squelchGate;
|
||||
m_squelchThreshold = m_config.m_outputSampleRate * m_config.m_squelchGate;
|
||||
initSquelch(m_squelchOpen);
|
||||
m_agc.setStepDownDelay(gateNbSamples); // same delay for up and down
|
||||
m_agc.setGate(gateNbSamples);
|
||||
m_agc.setStepDownDelay(m_config.m_outputSampleRate * (m_config.m_squelchGate == 0 ? 0.01 : m_config.m_squelchGate)); // same delay for up and down
|
||||
m_agc.setGate(m_config.m_outputSampleRate * 0.02);
|
||||
}
|
||||
|
||||
if ((m_config.m_squelch != m_running.m_squelch) || force)
|
||||
{
|
||||
m_agc.setThreshold(m_config.m_squelch * (1<<30));
|
||||
m_agc.setThreshold(m_config.m_squelch*(1<<23));
|
||||
}
|
||||
|
||||
if ((m_config.m_udpAddressStr != m_running.m_udpAddressStr) || force)
|
||||
|
@ -227,8 +227,9 @@ void UDPSrcGUI::tick()
|
||||
{
|
||||
if (m_tickCount % 4 == 0)
|
||||
{
|
||||
m_channelPowerAvg.feed(m_udpSrc->getMagSq());
|
||||
double powDb = CalcDb::dbPower(m_channelPowerAvg.average());
|
||||
// m_channelPowerAvg.feed(m_udpSrc->getMagSq());
|
||||
// double powDb = CalcDb::dbPower(m_channelPowerAvg.average());
|
||||
double powDb = CalcDb::dbPower(m_udpSrc->getMagSq());
|
||||
ui->channelPower->setText(QString::number(powDb, 'f', 1));
|
||||
m_inPowerAvg.feed(m_udpSrc->getInMagSq());
|
||||
double inPowDb = CalcDb::dbPower(m_inPowerAvg.average());
|
||||
|
Loading…
Reference in New Issue
Block a user