Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 430b61c7 authored by Andy Hung's avatar Andy Hung
Browse files

Add capability for floating point Kaiser window filters



Change-Id: Idbb33248bbab2300c2650a4657d8fbc482a5d46c
Signed-off-by: default avatarAndy Hung <hunga@google.com>
parent 78136683
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -669,11 +669,12 @@ static inline void firKaiserGen(T* coef, int L, int halfNumCoef,
                sg.advance();
            }

            // (caution!) float version does not need rounding
            if (is_same<T, int16_t>::value) { // int16_t needs noise shaping
                *coef++ = static_cast<T>(toint(y, 1ULL<<(sizeof(T)*8-1), err));
            } else {
            } else if (is_same<T, int32_t>::value) {
                *coef++ = static_cast<T>(toint(y, 1ULL<<(sizeof(T)*8-1)));
            } else { // assumed float or double
                *coef++ = static_cast<T>(y);
            }
        }
    }