Convert the Goertzel algorithm to Q15 and Q31.

This commit is contained in:
Jonathan Naylor
2020-04-19 16:52:11 +01:00
parent 85816d5bec
commit f7e5c2436c
2 changed files with 99 additions and 75 deletions
+5 -5
View File
@@ -27,16 +27,16 @@ public:
uint8_t setParams(uint8_t frequency, uint8_t threshold);
bool process(q15_t* samples, uint8_t length);
bool process(const q15_t* samples, uint8_t length);
void reset();
private:
float32_t m_coeff;
float32_t m_threshold;
q31_t m_coeffDivTwo;
uint16_t m_threshold;
uint16_t m_count;
float m_q0;
float m_q1;
q31_t m_q0;
q31_t m_q1;
bool m_result;
};