USRP Hardware Driver and USRP Manual Version: 4.1.0.1
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
10#include <uhd/config.hpp>
12#include <complex>
13#include <memory>
14#include <string>
15
16namespace uhd { namespace usrp { namespace cal {
17
24class UHD_API iq_cal : public container
25{
26public:
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
Definition: container.hpp:23
Definition: iq_cal.hpp:25
virtual void set_interp_mode(const uhd::math::interp_mode interp)=0
Choose interpolation mode.
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 set_cal_coeff(const double freq, const std::complex< double > coeff, const double suppression_abs=0, const double suppression_delta=0)=0
Update / set a calbration coefficient.
std::shared_ptr< iq_cal > sptr
Definition: iq_cal.hpp:27
virtual std::complex< double > get_cal_coeff(const double freq) const =0
Return a calibration coefficient for a given frequency.
virtual void clear()=0
Clear the list of coefficients.
#define UHD_API
Definition: config.h:70
interp_mode
Definition: interpolation.hpp:11
Definition: build_info.hpp:12