diff --git a/FMCTCSSRX.cpp b/FMCTCSSRX.cpp index d6a529a..de69ff5 100644 --- a/FMCTCSSRX.cpp +++ b/FMCTCSSRX.cpp @@ -109,18 +109,19 @@ uint8_t CFMCTCSSRX::setParams(uint8_t frequency, uint8_t threshold) bool CFMCTCSSRX::process(q15_t* samples, uint8_t length) { - float32_t data[RX_BLOCK_SIZE]; - ::arm_q15_to_float(samples, data, length); + //float32_t data[RX_BLOCK_SIZE]; + //::arm_q15_to_float(samples, data, length); for (unsigned int i = 0U; i < length; i++) { float32_t q2 = m_q1; m_q1 = m_q0; - m_q0 = m_coeff * m_q1 - q2 + data[i]; + m_q0 = m_coeff * m_q1 - q2 + float32_t(samples[i]) / 32768.0F; m_count++; if (m_count == N) { float32_t value = m_q0 * m_q0 + m_q1 * m_q1 - m_q0 * m_q1 * m_coeff; m_result = value >= m_threshold; + DEBUG4("CTCSS value / threshold / result", value, m_threshold, m_result); m_count = 0U; m_q0 = 0.0F; m_q1 = 0.0F;