mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-10 13:40:37 -04:00
NFM demod: use smootherstep function for squelch attack and decay
This commit is contained in:
parent
07c476f1d4
commit
68f742fad7
plugins/channelrx/demodnfm
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user