mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-09-30 08:46:46 -04:00
NFM demod: use smootherstep function for squelch attack and decay
This commit is contained in:
parent
07c476f1d4
commit
68f742fad7
@ -277,8 +277,8 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Real squelchFactor = (Real) (m_squelchCount - m_squelchGate) / 480.0f;
|
Real squelchFactor = smootherstep((Real) (m_squelchCount - m_squelchGate) / 480.0f);
|
||||||
sample = demod * m_running.m_volume * squelchFactor * squelchFactor;
|
sample = demod * m_running.m_volume * squelchFactor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -244,6 +244,15 @@ private:
|
|||||||
PhaseDiscriminators m_phaseDiscri;
|
PhaseDiscriminators m_phaseDiscri;
|
||||||
|
|
||||||
void apply();
|
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
|
#endif // INCLUDE_NFMDEMOD_H
|
||||||
|
Loading…
Reference in New Issue
Block a user