From 4c133c06d6ff8fd8bf14f6f9f8208cc69d8da5f3 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 28 Aug 2023 02:01:05 -0700 Subject: Slightly improve some all-pass filter coefficients --- core/uhjfilter.cpp | 12 ++++++------ 1 file 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 { static auto& Get() noexcept { return PShiftHq; } }; -constexpr float square(float x) noexcept -{ return x*x; } +constexpr float square(double x) noexcept +{ return static_cast(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 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 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 -- cgit v1.2.3