From 0754fd0fad75bfa92149b3552f528b941678202a Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sat, 8 Dec 2012 00:23:45 +0900 Subject: [PATCH] fix compost rosenberg, iir_filter --- sprout/compost/utility/iir_filter.hpp | 4 ++-- sprout/compost/utility/rosenberg.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sprout/compost/utility/iir_filter.hpp b/sprout/compost/utility/iir_filter.hpp index 4a860c50..a5724cb3 100644 --- a/sprout/compost/utility/iir_filter.hpp +++ b/sprout/compost/utility/iir_filter.hpp @@ -522,8 +522,8 @@ namespace sprout { return Result( sample, typename Result::second_type( - sprout::remake(da, 2, sprout::tuples::get<1>(da), sample), - sprout::remake(db, 2, sprout::tuples::get<1>(db), base) + sprout::remake(da, 2, sample, sprout::tuples::get<0>(da)), + sprout::remake(db, 2, base, sprout::tuples::get<0>(db)) ) ); } diff --git a/sprout/compost/utility/rosenberg.hpp b/sprout/compost/utility/rosenberg.hpp index d584b737..7918bde4 100644 --- a/sprout/compost/utility/rosenberg.hpp +++ b/sprout/compost/utility/rosenberg.hpp @@ -16,9 +16,9 @@ namespace sprout { inline SPROUT_CONSTEXPR typename sprout::float_promote::type rosenberg_value(T x, T tau1, T tau2) { typedef typename sprout::float_promote::type type; - return x >= 0 && sprout::math::less_equal(x, tau1) + return x >= 0 && x <= tau1 ? 3 * sprout::detail::pow2(x / tau1) - 2 * sprout::detail::pow3(x / tau1) - : sprout::math::greater(x, tau1) && sprout::math::less_equal(x, tau1 + tau2) + : x > tau1 && x <= tau1 + tau2 ? 1 - sprout::detail::pow2((x - tau1) / tau2) : 0 ;