diff --git a/FM.cpp b/FM.cpp index ee060b1..17e6462 100644 --- a/FM.cpp +++ b/FM.cpp @@ -21,23 +21,15 @@ #include "FM.h" q15_t FILTER_COEFFS[] = { - -4, 0, 1, -2, -9, -15, -16, -11, -2, 4, 6, 1, -7, -15, - -17, -9, 3, 16, 21, 14, 0, -12, -14, -1, 21, 43, 51, 41, - 19, -1, -5, 14, 50, 85, 98, 81, 44, 9, 0, 28, 80, 130, - 147, 120, 60, 2, -17, 16, 88, 157, 178, 132, 39, -52, -90, -49, - 46, 140, 166, 96, -42, -182, -245, -195, -63, 67, 106, 7, -194, -399, - -496, -429, -238, -41, 26, -106, -396, -697, -843, -743, -444, -121, 12, -165, - -603, -1084, -1329, -1163, -629, -6, 320, 67, -759, -1803, -2474, -2204, -739, 1695, - 4421, 6556, 7363, 6556, 4421, 1695, -739, -2204, -2474, -1803, -759, 67, 320, -6, - -629, -1163, -1329, -1084, -603, -165, 12, -121, -444, -743, -843, -697, -396, -106, - 26, -41, -238, -429, -496, -399, -194, 7, 106, 67, -63, -195, -245, -182, - -42, 96, 166, 140, 46, -49, -90, -52, 39, 132, 178, 157, 88, 16, - -17, 2, 60, 120, 147, 130, 80, 28, 0, 9, 44, 81, 98, 85, - 50, 14, -5, -1, 19, 41, 51, 43, 21, -1, -14, -12, 0, 14, - 21, 16, 3, -9, -17, -15, -7, 1, 6, 4, -2, -11, -16, -15, - -9, -2, 1, 0, -4}; + 26, 19, 6, -7, -13, -7, 8, 27, 35, 22, -10, -48, -70, -60, -21, 24, + 41, 3, -84, -185, -243, -222, -129, -23, 15, -66, -257, -471, -591, -539, -332, -94, + 9, -134, -503, -926, -1160, -1035, -570, -5, 300, 64, -728, -1747, -2418, -2171, -732, 1688, + 4417, 6564, 7376, 6564, 4417, 1688, -732, -2171, -2418, -1747, -728, 64, 300, -5, -570, -1035, + -1160, -926, -503, -134, 9, -94, -332, -539, -591, -471, -257, -66, 15, -23, -129, -222, + -243, -185, -84, 3, 41, 24, -21, -60, -70, -48, -10, 22, 35, 27, 8, -7, + -13, -7, 6, 19, 26}; -const uint16_t FILTER_COEFFS_LEN = 201U; +const uint16_t FILTER_COEFFS_LEN = 101U; CFM::CFM() : m_filter(), diff --git a/FM.h b/FM.h index 26d18d7..963f29b 100644 --- a/FM.h +++ b/FM.h @@ -53,7 +53,7 @@ public: private: arm_fir_instance_q15 m_filter; - q15_t m_filterState[230U]; // NoTaps + BlockSize - 1, 201 + 20 - 1 plus some spare + q15_t m_filterState[130U]; // NoTaps + BlockSize - 1, 101 + 20 - 1 plus some spare CFMKeyer m_callsign; CFMKeyer m_rfAck; CFMCTCSSRX m_ctcssRX; diff --git a/FMCTCSSRX.cpp b/FMCTCSSRX.cpp index 728cc51..d6a529a 100644 --- a/FMCTCSSRX.cpp +++ b/FMCTCSSRX.cpp @@ -102,7 +102,7 @@ uint8_t CFMCTCSSRX::setParams(uint8_t frequency, uint8_t threshold) if (m_coeff == 0.0F) return 4U; - m_threshold = float32_t(threshold * threshold); + m_threshold = float32_t(threshold); return 0U; } diff --git a/SerialPort.cpp b/SerialPort.cpp index 45624da..1490c8c 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -101,7 +101,7 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U; #define HW_TYPE "MMDVM" #endif -#define DESCRIPTION "20200418 (D-Star/DMR/System Fusion/P25/NXDN/POCSAG/FM)" +#define DESCRIPTION "20200420 (D-Star/DMR/System Fusion/P25/NXDN/POCSAG/FM)" #if defined(GITVERSION) #define concat(h, a, b, c) h " " a " " b " GitID #" c ""