switch cyl_bessel_i defines to using statements
parent
84a2f2441d
commit
82bb4e48e1
|
@ -7,10 +7,10 @@ using namespace Xybrid::NodeLib;
|
|||
|
||||
#ifdef WITH_BOOST
|
||||
#include <boost/math/special_functions/bessel.hpp>
|
||||
#define cyl_bessel_i boost::math::cyl_bessel_i
|
||||
using boost::math::cyl_bessel_i;
|
||||
#else
|
||||
#include <cmath>
|
||||
#define cyl_bessel_i std::cyl_bessel_i
|
||||
using std::cyl_bessel_i;
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
@ -39,11 +39,9 @@ const std::array<std::array<double, LUT_TAPS>, LUT_STEPS> Xybrid::NodeLib::resam
|
|||
double sv = static_cast<double>(step) / LUT_STEPS;
|
||||
for (size_t tap = 0; tap < LUT_TAPS; tap++) {
|
||||
double x = static_cast<double>(tap) - sv;
|
||||
t[step][tap] = sinc(x-(LUT_TAPS/2-1)) * (cyl_bessel_i(0, KAISER_BETA * std::sqrt(1 - std::pow(((2 * (x+1)) / (LUT_TAPS)) - 1, 2))) / denom);
|
||||
t[step][tap] = sinc(x-(LUT_TAPS/2-1)) * (cyl_bessel_i(0, KAISER_BETA * std::sqrt(1 - std::pow(((2 * (x+1)) / (LUT_TAPS)) - 1, 2))) / denom);
|
||||
if (t[step][tap] != t[step][tap]) t[step][tap] = 0; // NaN guard
|
||||
//std::cout << "tap " << tap << ": " << t[step][tap] << " ";
|
||||
}
|
||||
//std::cout << "\n";
|
||||
}
|
||||
return t;
|
||||
}();
|
||||
|
|
Loading…
Reference in New Issue