diff --git a/plugins/channel/nfm/nfmdemod.cpp b/plugins/channel/nfm/nfmdemod.cpp index a1f9b41a8..25f7be1e4 100644 --- a/plugins/channel/nfm/nfmdemod.cpp +++ b/plugins/channel/nfm/nfmdemod.cpp @@ -113,8 +113,9 @@ void NFMDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter m_lastArgument = argument; */ - Complex d = conj(m_lastSample) * ci; - m_lastSample = ci; + Complex d = conj(m_m1Sample) * ci; + m_m2Sample = m_m1Sample; + m_m1Sample = ci; Real demod = atan2(d.imag(), d.real()); //Real demod = arctan2(d.imag(), d.real()); /* @@ -174,7 +175,7 @@ void NFMDemod::start() m_interpolatorRegulation = 0.9999; m_interpolatorDistance = 1.0; m_interpolatorDistanceRemain = 0.0; - m_lastSample = 0; + m_m1Sample = 0; } void NFMDemod::stop() diff --git a/plugins/channel/nfm/nfmdemod.h b/plugins/channel/nfm/nfmdemod.h index 702a68e01..dc8b76365 100644 --- a/plugins/channel/nfm/nfmdemod.h +++ b/plugins/channel/nfm/nfmdemod.h @@ -116,7 +116,8 @@ private: int m_squelchState; Real m_lastArgument; - Complex m_lastSample; + Complex m_m1Sample; + Complex m_m2Sample; MovingAverage m_movingAverage; AudioVector m_audioBuffer;