1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-13 03:41:47 -05:00

UDP source plugin: AM with DV block optimization

This commit is contained in:
f4exb 2017-08-20 22:51:22 +02:00
parent 8a16e99e48
commit 872fa9bd20

View File

@ -273,11 +273,11 @@ void UDPSrc::feed(const SampleVector::const_iterator& begin, const SampleVector:
}
else if (m_running.m_sampleFormat == FormatAMNoDCMono)
{
m_amMovingAverage.feed(inMagSq);
if (m_squelchOpen)
{
FixReal demod = (FixReal) ((sqrt(inMagSq) - sqrt(m_amMovingAverage.average())) * agcFactor * m_running.m_gain);
double demodf = sqrt(inMagSq);
m_amMovingAverage.feed(demodf);
FixReal demod = (FixReal) ((demodf - m_amMovingAverage.average()) * agcFactor * m_running.m_gain);
m_udpBufferMono->write(demod);
m_outMovingAverage.feed((demod * demod) / 1073741824.0);
}