USRP Hardware Driver and USRP Manual  Version: 4.6.0.0
UHD and USRP Manual
iq_cal.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2020 Ettus Research, a National Instruments Brand
3 //
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 //
6 
7 #pragma once
8 
9 #include <uhd/cal/container.hpp>
10 #include <uhd/config.hpp>
12 #include <complex>
13 #include <memory>
14 #include <string>
15 
16 namespace uhd { namespace usrp { namespace cal {
17 
24 class UHD_API iq_cal : public container
25 {
26 public:
27  using sptr = std::shared_ptr<iq_cal>;
28 
30  //
31  // This class supports two kinds of interpolation: Nearest-neighbour, and
32  // linear.
33  //
34  // \param interp The new interpolation mode
35  // \throws uhd::value_error if the given interpolation mode is not
36  // supported.
37  virtual void set_interp_mode(const uhd::math::interp_mode interp) = 0;
38 
40  //
41  // This function will interpolate to return a valid coefficient for any
42  // given frequency.
43  virtual std::complex<double> get_cal_coeff(const double freq) const = 0;
44 
46  //
47  // This usually only needs to called by calibration utilities.
48  //
49  // \param freq The frequency at which this coefficient is measured
50  // \param coeff The value that is stored
51  // \param suppression_abs The amount of impairment suppression this
52  // coefficient provides, in dB.
53  // \param suppression_delta The difference of impairment power between
54  // applying this coefficient and applying none, in
55  // dB.
56  virtual void set_cal_coeff(const double freq,
57  const std::complex<double> coeff,
58  const double suppression_abs = 0,
59  const double suppression_delta = 0) = 0;
60 
62  //
63  // This can be useful in order to drop existing cal data, and load an
64  // entirely new set with deserialize().
65  virtual void clear() = 0;
66 
68  static sptr make(
69  const std::string& name, const std::string& serial, const uint64_t timestamp);
70 
72  static sptr make();
73 };
74 
75 }}} // namespace uhd::usrp::cal
std::shared_ptr< iq_cal > sptr
Definition: iq_cal.hpp:27
Definition: container.hpp:22
Definition: build_info.hpp:12
interp_mode
Definition: interpolation.hpp:11
#define UHD_API
Definition: config.h:87
Definition: iq_cal.hpp:24