fix compost rosenberg, iir_filter

This commit is contained in:
bolero-MURAKAMI 2012-12-08 00:23:45 +09:00
parent b44f7c8f2a
commit 0754fd0fad
2 changed files with 4 additions and 4 deletions

View file

@ -522,8 +522,8 @@ namespace sprout {
return Result( return Result(
sample, sample,
typename Result::second_type( typename Result::second_type(
sprout::remake<DelayA>(da, 2, sprout::tuples::get<1>(da), sample), sprout::remake<DelayA>(da, 2, sample, sprout::tuples::get<0>(da)),
sprout::remake<DelayB>(db, 2, sprout::tuples::get<1>(db), base) sprout::remake<DelayB>(db, 2, base, sprout::tuples::get<0>(db))
) )
); );
} }

View file

@ -16,9 +16,9 @@ namespace sprout {
inline SPROUT_CONSTEXPR typename sprout::float_promote<T>::type inline SPROUT_CONSTEXPR typename sprout::float_promote<T>::type
rosenberg_value(T x, T tau1, T tau2) { rosenberg_value(T x, T tau1, T tau2) {
typedef typename sprout::float_promote<T>::type type; typedef typename sprout::float_promote<T>::type type;
return x >= 0 && sprout::math::less_equal(x, tau1) return x >= 0 && x <= tau1
? 3 * sprout::detail::pow2<type>(x / tau1) - 2 * sprout::detail::pow3<type>(x / tau1) ? 3 * sprout::detail::pow2<type>(x / tau1) - 2 * sprout::detail::pow3<type>(x / tau1)
: sprout::math::greater(x, tau1) && sprout::math::less_equal(x, tau1 + tau2) : x > tau1 && x <= tau1 + tau2
? 1 - sprout::detail::pow2<type>((x - tau1) / tau2) ? 1 - sprout::detail::pow2<type>((x - tau1) / tau2)
: 0 : 0
; ;