diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index d2b4aceb6..e2713c884 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -277,8 +277,8 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto } else { - Real squelchFactor = (Real) (m_squelchCount - m_squelchGate) / 480.0f; - sample = demod * m_running.m_volume * squelchFactor * squelchFactor; + Real squelchFactor = smootherstep((Real) (m_squelchCount - m_squelchGate) / 480.0f); + sample = demod * m_running.m_volume * squelchFactor; } } } diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index 9a02f47e6..ee1a6e24f 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -244,6 +244,15 @@ private: PhaseDiscriminators m_phaseDiscri; void apply(); + + float smootherstep(float x) + { + double x3 = x * x * x; + double x4 = x * x3; + double x5 = x * x4; + + return (float) (6.0*x5 - 15.0*x4 + 10.0*x3); + } }; #endif // INCLUDE_NFMDEMOD_H