From 876c257aaf1622db2e1483e24b0decbe4e68d06e Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 5 Oct 2015 00:54:14 +0200 Subject: [PATCH] Optimize AM demod --- plugins/channel/am/amdemod.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/channel/am/amdemod.cpp b/plugins/channel/am/amdemod.cpp index 600a931fd..fb475f090 100644 --- a/plugins/channel/am/amdemod.cpp +++ b/plugins/channel/am/amdemod.cpp @@ -72,14 +72,17 @@ void AMDemod::feed(const SampleVector::const_iterator& begin, const SampleVector for (SampleVector::const_iterator it = begin; it != end; ++it) { - Complex c(it->real() / 32768.0, it->imag() / 32768.0); + //Complex c(it->real() / 32768.0, it->imag() / 32768.0); + Complex c(it->real(), it->imag()); c *= m_nco.nextIQ(); if (m_interpolator.interpolate(&m_interpolatorDistanceRemain, c, &ci)) { - m_sampleBuffer.push_back(Sample(ci.real() * 32767.0, ci.imag() * 32767.0)); + //m_sampleBuffer.push_back(Sample(ci.real() * 32767.0, ci.imag() * 32767.0)); + m_sampleBuffer.push_back(Sample(ci.real(), ci.imag())); Real magsq = ci.real() * ci.real() + ci.imag() * ci.imag(); + magsq /= (1<<30); m_movingAverage.feed(magsq); m_magsq = m_movingAverage.average();