USRP Hardware Driver and Device Manual  Version: 4.10.0.0-0-g2af4ddb9
UHD and USRP Manual
iq_dc_cal.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2026 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>
13 #include <complex>
14 #include <cstdint>
15 #include <memory>
16 #include <string>
17 #include <vector>
18 
19 namespace uhd { namespace usrp { namespace cal {
20 
32 class UHD_API iq_dc_cal : public container
33 {
34 public:
35  using sptr = std::shared_ptr<iq_dc_cal>;
36 
38  //
39  // This class supports two kinds of interpolation: nearest-neighbor, and
40  // linear.
41  //
42  // \param interp The new interpolation mode
43  // \throws uhd::value_error if the given interpolation mode is not
44  // supported.
45  virtual void set_interp_mode(const uhd::math::interp_mode interp) = 0;
46 
48  //
49  // This function will interpolate to return a valid coefficient for any
50  // given frequency.
51  virtual iq_dc_cal_coeffs_t get_cal_coeff(const double freq) const = 0;
52 
54  //
55  // This function will interpolate to return a valid group delay for any
56  // given frequency.
57  virtual double get_group_delay(const double freq) = 0;
58 
60  //
61  // This usually only needs to be called by calibration utilities.
62  //
63  // \param freq The frequency at which this coefficient is measured
64  // \param scaling_factor The amount by which the raw data should be scaled.
65  // \param icross The i cross coefficients
66  // \param qinline The q inline coefficients
67  // \param delay The group delay of this coefficient, in samples
68  // \param dc_offset_real The real part of the DC offset
69  // \param dc_offset_imag The imaginary part of the DC offset
70  virtual void set_cal_coeff(const double freq,
71  const double scaling_factor,
72  const std::vector<double> icross,
73  const std::vector<double> qinline,
74  const double delay = 0,
75  const double dc_offset_real = 0,
76  const double dc_offset_imag = 0) = 0;
77 
79  //
80  // This can be useful in order to drop existing cal data, and load an
81  // entirely new set with deserialize().
82  virtual void clear() = 0;
83 
85  static sptr make(
86  const std::string& name, const std::string& serial, const uint64_t timestamp);
87 
89  static sptr make();
90 };
91 
92 }}} // namespace uhd::usrp::cal
Definition: container.hpp:23
Definition: iq_dc_cal.hpp:33
virtual void set_cal_coeff(const double freq, const double scaling_factor, const std::vector< double > icross, const std::vector< double > qinline, const double delay=0, const double dc_offset_real=0, const double dc_offset_imag=0)=0
Update / set a calibration coefficient.
static sptr make(const std::string &name, const std::string &serial, const uint64_t timestamp)
Factory for new cal data sets.
static sptr make()
Default factory.
virtual void clear()=0
Clear the list of coefficients.
std::shared_ptr< iq_dc_cal > sptr
Definition: iq_dc_cal.hpp:35
virtual double get_group_delay(const double freq)=0
Return the group delay at a given frequency.
virtual iq_dc_cal_coeffs_t get_cal_coeff(const double freq) const =0
Return a calibration coefficient for a given frequency.
virtual void set_interp_mode(const uhd::math::interp_mode interp)=0
Choose interpolation mode.
#define UHD_API
Definition: config.h:87
interp_mode
Definition: interpolation.hpp:11
Definition: build_info.hpp:12
Definition: iq_dc_cal_coeffs.hpp:16