mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-05-07 13:37:48 +00:00
Simplify the calculations.
This commit is contained in:
parent
82dcc44a2d
commit
e8ed77241c
4 changed files with 7 additions and 22 deletions
|
|
@ -91,10 +91,9 @@ m_rxLevelInverse(1)
|
|||
{
|
||||
}
|
||||
|
||||
uint8_t CFMCTCSSRX::setParams(uint8_t frequency, uint8_t threshold, q15_t rxLevel)
|
||||
uint8_t CFMCTCSSRX::setParams(uint8_t frequency, uint8_t threshold, uint8_t level)
|
||||
{
|
||||
// Calculate 1/rxLevel
|
||||
m_rxLevelInverse = q31_t(q15Division(65535 /* This value should be 32767 (q15 1). But this does not work.*/, rxLevel));
|
||||
m_rxLevelInverse = 255 / q15_t(level);
|
||||
|
||||
m_coeffDivTwo = 0;
|
||||
|
||||
|
|
@ -115,7 +114,7 @@ uint8_t CFMCTCSSRX::setParams(uint8_t frequency, uint8_t threshold, q15_t rxLeve
|
|||
|
||||
CTCSSState CFMCTCSSRX::process(q15_t sample)
|
||||
{
|
||||
q63_t sample31 = q31_t(sample) * m_rxLevelInverse;
|
||||
q31_t sample31 = q31_t(sample) * m_rxLevelInverse;
|
||||
|
||||
m_result = m_result & (~CTS_READY);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue