diff options
author | Chris Robinson <[email protected]> | 2023-08-28 02:01:05 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-08-28 02:01:05 -0700 |
commit | 4c133c06d6ff8fd8bf14f6f9f8208cc69d8da5f3 (patch) | |
tree | 77e2646c6c27b254957e37ab6a5c93d8ad45cae4 | |
parent | 8a94d286a585d84e57bdc8ca99a081a8a572e629 (diff) |
Slightly improve some all-pass filter coefficients
-rw-r--r-- | core/uhjfilter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/uhjfilter.cpp b/core/uhjfilter.cpp index df50956a..d56d9b9d 100644 --- a/core/uhjfilter.cpp +++ b/core/uhjfilter.cpp @@ -29,23 +29,23 @@ template<> struct GetPhaseShifter<UhjLength512> { static auto& Get() noexcept { return PShiftHq; } }; -constexpr float square(float x) noexcept -{ return x*x; } +constexpr float square(double x) noexcept +{ return static_cast<float>(x*x); } /* Filter coefficients for the 'base' all-pass IIR, which applies a frequency- * dependent phase-shift of N degrees. The output of the filter requires a 1- * sample delay. */ constexpr std::array<float,4> Filter1Coeff{{ - square(0.6923878f), square(0.9360654322959f), square(0.9882295226860f), - square(0.9987488452737f) + square(0.6923878), square(0.9360654322959), square(0.9882295226860), + square(0.9987488452737) }}; /* Filter coefficients for the offset all-pass IIR, which applies a frequency- * dependent phase-shift of N+90 degrees. */ constexpr std::array<float,4> Filter2Coeff{{ - square(0.4021921162426f), square(0.8561710882420f), square(0.9722909545651f), - square(0.9952884791278f) + square(0.4021921162426), square(0.8561710882420), square(0.9722909545651), + square(0.9952884791278) }}; } // namespace |