diff options
| author | Martin Braun <martin.braun@ettus.com> | 2020-03-31 21:38:13 -0700 | 
|---|---|---|
| committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-04-07 07:24:19 -0500 | 
| commit | d9f4d540ef334013eb404ce91b3b446e5fc917ff (patch) | |
| tree | e5b7b405f567d414b24f5acca2aae78bc27267a5 /host/lib/cal | |
| parent | ff17d7428be5af109a2a74f916271761505ebee7 (diff) | |
| download | uhd-d9f4d540ef334013eb404ce91b3b446e5fc917ff.tar.gz uhd-d9f4d540ef334013eb404ce91b3b446e5fc917ff.tar.bz2 uhd-d9f4d540ef334013eb404ce91b3b446e5fc917ff.zip | |
uhd: math: Add interpolation.hpp
- Moves linear_interp from cal to utils
- Moves the interp_mode enum class to interpolation.hpp
- Adds three interpolation methods for maps: at_interpolate_1d(),
  at_nearest(), at_lin_interp()
- Adds unit tests
Diffstat (limited to 'host/lib/cal')
| -rw-r--r-- | host/lib/cal/cal_python.hpp | 8 | ||||
| -rw-r--r-- | host/lib/cal/iq_cal.cpp | 2 | 
2 files changed, 6 insertions, 4 deletions
| diff --git a/host/lib/cal/cal_python.hpp b/host/lib/cal/cal_python.hpp index 39a13d94c..e8f19eef9 100644 --- a/host/lib/cal/cal_python.hpp +++ b/host/lib/cal/cal_python.hpp @@ -8,8 +8,8 @@  #define INCLUDED_UHD_CAL_PYTHON_HPP  #include <uhd/cal/database.hpp> -#include <uhd/cal/interpolation.hpp>  #include <uhd/cal/iq_cal.hpp> +#include <uhd/utils/interpolation.hpp>  std::vector<uint8_t> pybytes_to_vector(const py::bytes& data)  { @@ -59,9 +59,9 @@ void export_cal(py::module& m)                  database::write_cal_data(key, serial, pybytes_to_vector(data));              }); -    py::enum_<interp_mode>(m, "interp_mode") -        .value("NEAREST_NEIGHBOR", interp_mode::NEAREST_NEIGHBOR) -        .value("LINEAR", interp_mode::LINEAR); +    py::enum_<uhd::math::interp_mode>(m, "interp_mode") +        .value("NEAREST_NEIGHBOR", uhd::math::interp_mode::NEAREST_NEIGHBOR) +        .value("LINEAR", uhd::math::interp_mode::LINEAR);      py::class_<container, std::shared_ptr<container>>(m, "container")          .def("get_name", &container::get_name) diff --git a/host/lib/cal/iq_cal.cpp b/host/lib/cal/iq_cal.cpp index e1ed8c9cb..f5640b01e 100644 --- a/host/lib/cal/iq_cal.cpp +++ b/host/lib/cal/iq_cal.cpp @@ -8,10 +8,12 @@  #include <uhd/cal/iq_cal_generated.h>  #include <uhd/exception.hpp>  #include <uhd/utils/math.hpp> +#include <uhdlib/utils/interpolation.hpp>  #include <map>  #include <string>  using namespace uhd::usrp::cal; +using namespace uhd::math;  constexpr int VERSION_MAJOR = 1;  constexpr int VERSION_MINOR = 0; | 
