 |
USRP Hardware Driver and USRP Manual
Version: 4.9.0.0
UHD and USRP Manual
|
|
Go to the documentation of this file.
22 static const double PI = 3.14159265358979323846;
40 static const float SINGLE_PRECISION_EPSILON = 1.19e-7f;
41 static const double DOUBLE_PRECISION_EPSILON = 2.22e-16;
51 static constexpr
double FREQ_COMPARE_EPSILON = 1e-12;
53 namespace fp_compare {
68 template <
typename float_t>
97 template <
typename float_t>
100 template <
typename float_t>
103 template <
typename float_t>
106 template <
typename float_t>
109 template <
typename float_t>
112 template <
typename float_t>
118 template <
typename float_t>
120 template <
typename float_t>
122 template <
typename float_t>
124 template <
typename float_t>
126 template <
typename float_t>
128 template <
typename float_t>
131 template <
typename float_t>
133 template <
typename float_t>
135 template <
typename float_t>
137 template <
typename float_t>
139 template <
typename float_t>
141 template <
typename float_t>
169 static const float SINGLE_PRECISION_DELTA = 1e-3f;
170 static const double DOUBLE_PRECISION_DELTA = 1e-5;
173 static const double FREQ_COMPARISON_DELTA_HZ = 0.1;
176 namespace fp_compare {
191 template <
typename float_t>
205 template <
typename float_t>
207 template <
typename float_t>
209 template <
typename float_t>
211 template <
typename float_t>
213 template <
typename float_t>
215 template <
typename float_t>
220 template <
typename float_t>
222 template <
typename float_t>
224 template <
typename float_t>
226 template <
typename float_t>
228 template <
typename float_t>
230 template <
typename float_t>
233 template <
typename float_t>
235 template <
typename float_t>
237 template <
typename float_t>
239 template <
typename float_t>
241 template <
typename float_t>
243 template <
typename float_t>
256 return std::pow(10, (dB_val) / 10.0);
261 return 10 * std::log10(val);
272 template <
typename T>
277 return (T(0) < x) - (x < T(0));
292 double freq = std::fmod(requested_freq, rate);
293 if (std::abs(freq) > rate / 2.0)
UHD_INLINE bool operator==(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition: fp_compare_delta.ipp:64
UHD_INLINE bool operator>=(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition: fp_compare_delta.ipp:97
double lin_to_dB(const double val)
Definition: math.hpp:259
UHD_INLINE bool frequencies_are_equal(double lhs, double rhs)
Definition: math.hpp:248
An alias for fp_compare_epsilon, but with defaults for frequencies.
Definition: math.hpp:145
float_t _epsilon
Definition: math.hpp:79
#define UHD_INLINE
Definition: config.h:65
constexpr int sign(T x)
Returns the sign of x.
Definition: math.hpp:273
float_t _value
Definition: math.hpp:201
UHD_INLINE freq_compare_epsilon(const freq_compare_epsilon ©)
Definition: math.hpp:153
float_t _delta
Definition: math.hpp:202
Definition: build_info.hpp:12
UHD_INLINE bool operator<=(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition: fp_compare_delta.ipp:84
UHD_INLINE bool operator<(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition: fp_compare_delta.ipp:77
UHD_INLINE fp_compare_epsilon(float_t value)
UHD_INLINE fp_compare_delta(float_t value)
UHD_INLINE freq_compare_epsilon(double value)
Definition: math.hpp:148
double wrap_frequency(const double requested_freq, const double rate)
Return a wrapped frequency that is the equivalent frequency in the first.
Definition: math.hpp:290
UHD_INLINE bool operator>(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition: fp_compare_delta.ipp:90
float_t _value
Definition: math.hpp:78
UHD_INLINE void operator=(const fp_compare_epsilon ©)
Definition: fp_compare_epsilon.ipp:51
UHD_INLINE void operator=(const fp_compare_delta ©)
Definition: fp_compare_delta.ipp:56
UHD_INLINE ~fp_compare_epsilon()
Definition: fp_compare_epsilon.ipp:46
UHD_INLINE ~fp_compare_delta()
Definition: fp_compare_delta.ipp:51
UHD_INLINE bool operator!=(fp_compare_delta< float_t > lhs, fp_compare_delta< float_t > rhs)
Definition: fp_compare_delta.ipp:71
double dB_to_lin(const double dB_val)
Definition: math.hpp:254