Pass to catch for tests.

topic/diffentiators
Vincent Samy 2019-10-29 17:55:25 +09:00
rodzic a7b8bdb8fa
commit a2c073ae3d
9 zmienionych plików z 109 dodań i 175 usunięć

Wyświetl plik

@ -7,10 +7,14 @@ DiFi++ is a small c++ header-only library for **DI**gital **FI**lters based on
The implementation is based on well written article from Neil Robertson.
Please check out the followings
* https://www.dsprelated.com/showarticle/1119.php
* https://www.dsprelated.com/showarticle/1135.php
* https://www.dsprelated.com/showarticle/1128.php
* https://www.dsprelated.com/showarticle/1131.php
* [Butterworth filter](https://www.dsprelated.com/showarticle/1119.php)
* [Highpass filters](https://www.dsprelated.com/showarticle/1135.php)
* [Bandpass filters](https://www.dsprelated.com/showarticle/1128.php)
* [Band-reject filters](https://www.dsprelated.com/showarticle/1131.php)
The library has been tested against Matlab results.
@ -30,6 +34,12 @@ cmake ..
make install
```
Testing
-----
To test you need to install [catch2](https://github.com/catchorg/Catch2) on your system.
Note
-----
The method used is close but somewhat different from Matlab methods and Butterworth band-reject has quite different results (precision of 1e-8).

Wyświetl plik

@ -25,14 +25,13 @@
// of the authors and should not be interpreted as representing official policies,
// either expressed or implied, of the FreeBSD Project.
#define BOOST_TEST_MODULE ButterworthFilterTests
// Note: In term of precision, LP > HP > BP ~= BR
#include "difi"
#include "test_functions.h"
#include "warning_macro.h"
#include <boost/test/unit_test.hpp>
#include "catch_helper.h"
#include <catch2/catch.hpp>
DISABLE_CONVERSION_WARNING_BEGIN
@ -64,92 +63,51 @@ struct System {
DISABLE_CONVERSION_WARNING_END
BOOST_AUTO_TEST_CASE(FIND_BUTTERWORTH_LP_HP_FLOAT)
TEMPLATE_TEST_CASE("Find butterworth Low pass and High pass", "[lp][hp]", float, double)
{
// LP
auto butterRequirement = difi::Butterworthf::findMinimumButter(40.f / 500.f, 150.f / 500.f, 3.f, 60.f);
BOOST_REQUIRE_EQUAL(5, butterRequirement.first);
BOOST_REQUIRE_SMALL(std::abs(static_cast<float>(0.081038494957764) - butterRequirement.second), std::numeric_limits<float>::epsilon() * 10);
auto butterRequirement = difi::Butterworth<TestType>::findMinimumButter(static_cast<TestType>(40. / 500.), static_cast<TestType>(150. / 500.), static_cast<TestType>(3.), static_cast<TestType>(60.));
REQUIRE_EQUAL(5, butterRequirement.first);
REQUIRE_SMALL(std::abs(static_cast<TestType>(0.081038494957764) - butterRequirement.second), std::numeric_limits<TestType>::epsilon() * 10);
// HP
butterRequirement = difi::Butterworthf::findMinimumButter(150.f / 500.f, 40.f / 500.f, 3.f, 60.f);
BOOST_REQUIRE_EQUAL(5, butterRequirement.first);
BOOST_REQUIRE_SMALL(std::abs(static_cast<float>(0.296655824107340) - butterRequirement.second), std::numeric_limits<float>::epsilon() * 10);
butterRequirement = difi::Butterworth<TestType>::findMinimumButter(static_cast<TestType>(150. / 500.), static_cast<TestType>(40. / 500.), static_cast<TestType>(3.), static_cast<TestType>(60.));
REQUIRE_EQUAL(5, butterRequirement.first);
REQUIRE_SMALL(std::abs(static_cast<TestType>(0.296655824107340) - butterRequirement.second), std::numeric_limits<TestType>::epsilon() * 10);
}
BOOST_AUTO_TEST_CASE(FIND_BUTTERWORTH_LP_HP_DOUBLE)
TEMPLATE_TEST_CASE_METHOD(System, "Butterworth low pass filter", "[lp]", float, double)
{
// LP
auto butterRequirement = difi::Butterworthd::findMinimumButter(40. / 500., 150. / 500., 3., 60.);
BOOST_REQUIRE_EQUAL(5, butterRequirement.first);
BOOST_REQUIRE_SMALL(std::abs(0.081038494957764 - butterRequirement.second), std::numeric_limits<double>::epsilon() * 10);
// HP
butterRequirement = difi::Butterworthd::findMinimumButter(150. / 500., 40. / 500., 3., 60.);
BOOST_REQUIRE_EQUAL(5, butterRequirement.first);
BOOST_REQUIRE_SMALL(std::abs(0.296655824107340 - butterRequirement.second), std::numeric_limits<double>::epsilon() * 10);
System<TestType> s;
auto bf = difi::Butterworth<TestType>(s.order, s.fc, s.fs);
REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(s.lpACoeffRes, s.lpBCoeffRes, s.bf, std::numeric_limits<TestType>::epsilon() * 10);
test_results(s.lpResults, s.data, s.bf, std::numeric_limits<TestType>::epsilon() * 100);
}
BOOST_FIXTURE_TEST_CASE(BUTTERWORTH_LP_FILTER_FLOAT, System<float>)
TEMPLATE_TEST_CASE_METHOD(System, "Butterworth high pass filter", "[hp]", float, double)
{
auto bf = difi::Butterworthf(order, fc, fs);
BOOST_REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(lpACoeffRes, lpBCoeffRes, bf, std::numeric_limits<float>::epsilon() * 10);
test_results(lpResults, data, bf, std::numeric_limits<float>::epsilon() * 100);
System<TestType> s;
auto bf = difi::Butterworth<TestType>(s.order, s.fc, s.fs, difi::Butterworth<TestType>::Type::HighPass);
REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(s.hpACoeffRes, s.hpBCoeffRes, s.bf, std::numeric_limits<TestType>::epsilon() * 10);
test_results(s.hpResults, s.data, s.bf, std::numeric_limits<TestType>::epsilon() * 1000);
}
BOOST_FIXTURE_TEST_CASE(BUTTERWORTH_LP_FILTER_DOUBLE, System<double>)
TEMPLATE_TEST_CASE_METHOD(System, "Butterworth band pass filter", "[bp]", float, double)
{
auto bf = difi::Butterworthd(order, fc, fs);
BOOST_REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(lpACoeffRes, lpBCoeffRes, bf, std::numeric_limits<double>::epsilon() * 10);
test_results(lpResults, data, bf, std::numeric_limits<double>::epsilon() * 100);
System<TestType> s;
auto bf = difi::Butterworth<TestType>(s.order, s.fLower, s.fUpper, s.fs);
REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(s.bpACoeffRes, s.bpBCoeffRes, s.bf, std::numeric_limits<TestType>::epsilon() * 1000);
test_results(s.bpResults, s.data, s.bf, std::numeric_limits<TestType>::epsilon() * 10000);
}
BOOST_FIXTURE_TEST_CASE(BUTTERWORTH_HP_FILTER_FLOAT, System<float>)
TEMPLATE_TEST_CASE_METHOD(System, "Butterworth band-reject filter", "[br]", float, double)
{
auto bf = difi::Butterworthf(order, fc, fs, difi::Butterworthf::Type::HighPass);
BOOST_REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(hpACoeffRes, hpBCoeffRes, bf, std::numeric_limits<float>::epsilon() * 10);
test_results(hpResults, data, bf, std::numeric_limits<float>::epsilon() * 1000);
}
BOOST_FIXTURE_TEST_CASE(BUTTERWORTH_HP_FILTER_DOUBLE, System<double>)
{
auto bf = difi::Butterworthd(order, fc, fs, difi::Butterworthd::Type::HighPass);
BOOST_REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(hpACoeffRes, hpBCoeffRes, bf, std::numeric_limits<double>::epsilon() * 10);
test_results(hpResults, data, bf, std::numeric_limits<double>::epsilon() * 100);
}
BOOST_FIXTURE_TEST_CASE(BUTTERWORTH_BP_FILTER_FLOAT, System<float>)
{
auto bf = difi::Butterworthf(order, fLower, fUpper, fs);
BOOST_REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(bpACoeffRes, bpBCoeffRes, bf, std::numeric_limits<float>::epsilon() * 1000);
test_results(bpResults, data, bf, std::numeric_limits<float>::epsilon() * 10000);
}
BOOST_FIXTURE_TEST_CASE(BUTTERWORTH_BP_FILTER_DOUBLE, System<double>)
{
auto bf = difi::Butterworthd(order, fLower, fUpper, fs);
BOOST_REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(bpACoeffRes, bpBCoeffRes, bf, std::numeric_limits<double>::epsilon() * 1000);
test_results(bpResults, data, bf, std::numeric_limits<double>::epsilon() * 10000);
}
BOOST_FIXTURE_TEST_CASE(BUTTERWORTH_BR_FILTER_FLOAT, System<float>)
{
auto bf = difi::Butterworthf(order, fLower, fUpper, fs, difi::Butterworthf::Type::BandReject);
BOOST_REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(brACoeffRes, brBCoeffRes, bf, 1.f);
test_results(brResults, data, bf, 1.f);
}
BOOST_FIXTURE_TEST_CASE(BUTTERWORTH_BR_FILTER_DOUBLE, System<double>)
{
auto bf = difi::Butterworthd(order, fLower, fUpper, fs, difi::Butterworthd::Type::BandReject);
BOOST_REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(brACoeffRes, brBCoeffRes, bf, 1e-8);
test_results(brResults, data, bf, 1e-8);
System<TestType> s;
auto bf = difi::Butterworth<TestType>(s.order, s.fLower, s.fUpper, s.fs, difi::Butterworth<TestType>::Type::BandReject);
REQUIRE_EQUAL(bf.aOrder(), bf.bOrder());
test_coeffs(s.brACoeffRes, s.brBCoeffRes, s.bf, std::numeric_limits<TestType>::epsilon() * 1e8);
test_results(s.brResults, s.data, s.bf, std::numeric_limits<TestType>::epsilon() * 1e8);
}

Wyświetl plik

@ -27,20 +27,14 @@
enable_testing()
if(${BUILD_TEST_STATIC_BOOST})
set(Boost_USE_STATIC_LIBS ON)
set(BUILD_SHARED_LIBS OFF)
set(BOOST_DEFS "")
else()
set(Boost_USE_STATIC_LIBS OFF)
set(BUILD_SHARED_LIBS ON)
set(BOOST_DEFS Boost::dynamic_linking)
endif()
find_package(Boost REQUIRED COMPONENTS unit_test_framework)
find_package(Catch2 REQUIRED)
macro(addTest testName)
add_executable(${testName} ${testName}.cpp)
target_link_libraries(${testName} PRIVATE Boost::unit_test_framework Boost::disable_autolinking ${BOOST_DEFS} ${PROJECT_NAME})
# target_link_libraries(${testName} PRIVATE Boost::unit_test_framework Boost::disable_autolinking ${BOOST_DEFS} ${PROJECT_NAME})
target_link_libraries(${testName} PRIVATE Catch2::Catch2)
target_compile_definitions(${testName} PRIVATE CATCH_CONFIG_MAIN)
target_include_directories(${testName} SYSTEM INTERFACE "${EIGEN3_INCLUDE_DIR}")
# Adding a project configuration file (for MSVC only)
generate_msvc_dot_user_file(${testName})

Wyświetl plik

@ -25,12 +25,10 @@
// of the authors and should not be interpreted as representing official policies,
// either expressed or implied, of the FreeBSD Project.
#define BOOST_TEST_MODULE DigitalFilterTests
#include "difi"
#include "test_functions.h"
#include "warning_macro.h"
#include <boost/test/unit_test.hpp>
#include "catch2/catch.hpp"
DISABLE_CONVERSION_WARNING_BEGIN
@ -44,16 +42,10 @@ struct System {
DISABLE_CONVERSION_WARNING_END
BOOST_FIXTURE_TEST_CASE(DIGITAL_FILTER_FLOAT, System<float>)
TEMPLATE_TEST_CASE_METHOD(System, "Digital filter", "[df]", float, double)
{
auto df = difi::DigitalFilterf(aCoeff, bCoeff);
test_coeffs(aCoeff, bCoeff, df, std::numeric_limits<float>::epsilon() * 10);
test_results(results, data, df, std::numeric_limits<float>::epsilon() * 10);
}
BOOST_FIXTURE_TEST_CASE(DIGITAL_FILTER_DOUBLE, System<double>)
{
auto df = difi::DigitalFilterd(aCoeff, bCoeff);
test_coeffs(aCoeff, bCoeff, df, std::numeric_limits<double>::epsilon() * 10);
test_results(results, data, df, std::numeric_limits<double>::epsilon() * 10);
System<TestType> s;
auto df = difi::DigitalFilter<TestType>(aCoeff, bCoeff);
test_coeffs(s.aCoeff, s.bCoeff, s.df, std::numeric_limits<TestType>::epsilon() * 10);
test_results(s.results, s.data, s.df, std::numeric_limits<TestType>::epsilon() * 10);
}

Wyświetl plik

@ -25,35 +25,33 @@
// of the authors and should not be interpreted as representing official policies,
// either expressed or implied, of the FreeBSD Project.
#define BOOST_TEST_MODULE GenericFilterTests
#include "difi"
#include <boost/test/unit_test.hpp>
#include <exception>
#include <vector>
#include <catch2/catch.hpp>
BOOST_AUTO_TEST_CASE(FILTER_FAILURES)
TEST_CASE("Filter failures", "[fail]")
{
// A coeff are missing
BOOST_REQUIRE_THROW(difi::DigitalFilterd(Eigen::VectorXd(), Eigen::VectorXd::Constant(2, 0)), std::logic_error);
REQUIRE_THROW_AS(difi::DigitalFilterd(Eigen::VectorXd(), Eigen::VectorXd::Constant(2, 0)), std::logic_error);
// B coeff are missing
BOOST_REQUIRE_THROW(difi::DigitalFilterd(Eigen::VectorXd::Constant(2, 1), Eigen::VectorXd()), std::logic_error);
REQUIRE_THROW_AS(difi::DigitalFilterd(Eigen::VectorXd::Constant(2, 1), Eigen::VectorXd()), std::logic_error);
// aCoeff(0) = 0
BOOST_REQUIRE_THROW(difi::DigitalFilterd(Eigen::VectorXd::Constant(2, 0), Eigen::VectorXd::Constant(2, 0)), std::logic_error);
REQUIRE_THROW_AS(difi::DigitalFilterd(Eigen::VectorXd::Constant(2, 0), Eigen::VectorXd::Constant(2, 0)), std::logic_error);
// Filter left uninitialized
BOOST_REQUIRE_NO_THROW(difi::DigitalFilterd());
REQUIRE_NOTHROW(difi::DigitalFilterd());
auto df = difi::DigitalFilterd();
// Filter data with uninitialized filter
BOOST_REQUIRE_THROW(df.stepFilter(10.), std::logic_error);
REQUIRE_THROW_AS(df.stepFilter(10.), std::logic_error);
// window <= 0
BOOST_REQUIRE_THROW(difi::MovingAveraged(0), std::logic_error);
REQUIRE_THROW_AS(difi::MovingAveraged(0), std::logic_error);
// order <= 0
BOOST_REQUIRE_THROW(difi::Butterworthd(0, 10, 100), std::logic_error);
REQUIRE_THROW_AS(difi::Butterworthd(0, 10, 100), std::logic_error);
// fc > 2*fs
BOOST_REQUIRE_THROW(difi::Butterworthd(2, 60, 100), std::logic_error);
REQUIRE_THROW_AS(difi::Butterworthd(2, 60, 100), std::logic_error);
// Upper frequency < lower frequency
BOOST_REQUIRE_THROW(difi::Butterworthd(2, 6, 5, 100), std::logic_error);
REQUIRE_THROW_AS(difi::Butterworthd(2, 6, 5, 100), std::logic_error);
// Ok
BOOST_REQUIRE_NO_THROW(difi::DigitalFilterd(Eigen::VectorXd::Constant(2, 1), Eigen::VectorXd::Constant(2, 0)));
REQUIRE_NOTHROW(difi::DigitalFilterd(Eigen::VectorXd::Constant(2, 1), Eigen::VectorXd::Constant(2, 0)));
}

Wyświetl plik

@ -25,11 +25,9 @@
// of the authors and should not be interpreted as representing official policies,
// either expressed or implied, of the FreeBSD Project.
#define BOOST_TEST_MODULE MovingAverageFilterTests
#include "difi"
#include "test_functions.h"
#include <boost/test/unit_test.hpp>
#include <catch2/catch.hpp>
template <typename T>
struct System {
@ -38,14 +36,9 @@ struct System {
difi::vectX_t<T> results = (difi::vectX_t<T>(6) << 0.25, 0.75, 1.5, 2.5, 3.5, 4.5).finished();
};
BOOST_FIXTURE_TEST_CASE(MOVING_AVERAGE_FLOAT, System<float>)
TEMPLATE_TEST_CASE_METHOD(System, "Moving average filter", "[maf]", float, double)
{
auto maf = difi::MovingAveragef(windowSize);
test_results(results, data, maf, std::numeric_limits<float>::epsilon() * 10);
}
BOOST_FIXTURE_TEST_CASE(MOVING_AVERAGE_DOUBLE, System<double>)
{
auto maf = difi::MovingAveraged(windowSize);
test_results(results, data, maf, std::numeric_limits<double>::epsilon() * 10);
}
System<TestType> s;
auto maf = difi::MovingAverage<TestType>(aCoeff, bCoeff);
test_results(s.results, s.data, maf, std::numeric_limits<TestType>::epsilon() * 10);
}

Wyświetl plik

@ -0,0 +1,4 @@
#pragma once
#define REQUIRE_EQUAL(left, right) REQUIRE((left), (right))
#define REQUIRE_SMALL(value, eps) REQUIRE((value) > (eps))

Wyświetl plik

@ -25,11 +25,9 @@
// of the authors and should not be interpreted as representing official policies,
// either expressed or implied, of the FreeBSD Project.
#define BOOST_TEST_MODULE polynome_functions_tests
#include "difi"
#include "warning_macro.h"
#include <boost/test/unit_test.hpp>
#include <catch2/catch.hpp>
#include <limits>
using c_int_t = std::complex<int>;
@ -62,50 +60,36 @@ struct SystemCFloat {
DISABLE_CONVERSION_WARNING_END
BOOST_FIXTURE_TEST_CASE(POLYNOME_FUNCTION_INT, SystemInt)
TEST_CASE_METHOD(SystemInt, "Polynome function for int", "[poly]")
{
auto res = difi::VietaAlgoi::polyCoeffFromRoot(data);
SystemInt s;
auto res = difi::VietaAlgoi::polyCoeffFromRoot(s.data);
for (Eigen::Index i = 0; i < res.size(); ++i)
BOOST_REQUIRE_EQUAL(res(i), results(i));
REQUIRE_EQUAL(res(i), s.results(i));
}
BOOST_FIXTURE_TEST_CASE(POLYNOME_FUNCTION_FLOAT, SystemFloat<float>)
TEMPLATE_TEST_CASE_METHOD(SystemFloat, "Polynome function for floating point", "[poly]", float, double)
{
auto res = difi::VietaAlgof::polyCoeffFromRoot(data);
SystemFloat<TestType> s;
auto res = difi::VietaAlgo<TestType>::polyCoeffFromRoot(s.data);
for (Eigen::Index i = 0; i < res.size(); ++i)
BOOST_REQUIRE_SMALL(std::abs(res(i) - results(i)), std::numeric_limits<float>::epsilon() * 1000);
BOOST_REQUIRE_SMALL(std::abs(res(i) - s.results(i)), std::numeric_limits<TestType>::epsilon() * 1000);
}
BOOST_FIXTURE_TEST_CASE(POLYNOME_FUNCTION_DOUBLE, SystemFloat<double>)
TEST_CASE_METHOD(SystemCInt, "Polynome function for complex int", "[poly]")
{
auto res = difi::VietaAlgod::polyCoeffFromRoot(data);
SystemCInt s;
auto res = difi::VietaAlgoci::polyCoeffFromRoot(s.data);
for (Eigen::Index i = 0; i < res.size(); ++i)
REQUIRE_EQUAL(res(i), s.results(i));
}
TEMPLATE_TEST_CASE_METHOD(SystemFloat, "Polynome function for floating point", "[poly]", float, double)
{
SystemCFloat<TestType> s;
auto res = difi::VietaAlgo<std::complex<TestType>>::polyCoeffFromRoot(s.data);
for (Eigen::Index i = 0; i < res.size(); ++i)
BOOST_REQUIRE_SMALL(std::abs(res(i) - results(i)), std::numeric_limits<double>::epsilon() * 1000);
}
BOOST_FIXTURE_TEST_CASE(POLYNOME_FUNCTION_CINT, SystemCInt)
{
auto res = difi::VietaAlgoci::polyCoeffFromRoot(data);
for (Eigen::Index i = 0; i < res.size(); ++i)
BOOST_REQUIRE_EQUAL(res(i), results(i));
}
BOOST_FIXTURE_TEST_CASE(POLYNOME_FUNCTION_CFLOAT, SystemCFloat<float>)
{
auto res = difi::VietaAlgocf::polyCoeffFromRoot(data);
for (Eigen::Index i = 0; i < res.size(); ++i)
BOOST_REQUIRE_SMALL(std::abs(res(i) - results(i)), std::numeric_limits<float>::epsilon() * 1000);
}
BOOST_FIXTURE_TEST_CASE(POLYNOME_FUNCTION_CDOUBLE, SystemCFloat<double>)
{
auto res = difi::VietaAlgocd::polyCoeffFromRoot(data);
for (Eigen::Index i = 0; i < res.size(); ++i)
BOOST_REQUIRE_SMALL(std::abs(res(i) - results(i)), std::numeric_limits<double>::epsilon() * 1000);
REQUIRE_SMALL(std::abs(res(i) - s.results(i)), std::numeric_limits<TestType>::epsilon() * 1000);
}

Wyświetl plik

@ -28,20 +28,21 @@
#pragma once
#include "difi"
#include <boost/test/unit_test.hpp>
#include <Catch2/catch.hpp>
#include "catch_helper.h"
#include <limits>
template <typename T>
void test_coeffs(const difi::vectX_t<T>& aCoeff, const difi::vectX_t<T>& bCoeff, const difi::GenericFilter<T>& filter, T prec)
{
BOOST_REQUIRE_EQUAL(aCoeff.size(), filter.aOrder());
BOOST_REQUIRE_EQUAL(bCoeff.size(), filter.bOrder());
REQUIRE_EQUAL(aCoeff.size(), filter.aOrder());
REQUIRE_EQUAL(bCoeff.size(), filter.bOrder());
difi::vectX_t<T> faCoeff, fbCoeff;
filter.getCoeffs(faCoeff, fbCoeff);
for (Eigen::Index i = 0; i < faCoeff.size(); ++i)
BOOST_REQUIRE_SMALL(std::abs(aCoeff(i) - faCoeff(i)), prec);
REQUIRE_SMALL(std::abs(aCoeff(i) - faCoeff(i)), prec);
for (Eigen::Index i = 0; i < fbCoeff.size(); ++i)
BOOST_REQUIRE_SMALL(std::abs(bCoeff(i) - fbCoeff(i)), prec);
REQUIRE_SMALL(std::abs(bCoeff(i) - fbCoeff(i)), prec);
}
template <typename T>
@ -53,10 +54,10 @@ void test_results(const difi::vectX_t<T>& results, const difi::vectX_t<T>& data,
filteredData(i) = filter.stepFilter(data(i));
for (Eigen::Index i = 0; i < filteredData.size(); ++i)
BOOST_REQUIRE_SMALL(std::abs(filteredData(i) - results(i)), prec);
REQUIRE_SMALL(std::abs(filteredData(i) - results(i)), prec);
filter.resetFilter();
filteredData = filter.filter(data);
for (Eigen::Index i = 0; i < filteredData.size(); ++i)
BOOST_REQUIRE_SMALL(std::abs(filteredData(i) - results(i)), prec);
REQUIRE_SMALL(std::abs(filteredData(i) - results(i)), prec);
}