diff options
author | Martin Braun <martin.braun@ettus.com> | 2015-01-15 18:00:44 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-01-27 11:03:44 +0100 |
commit | 339396411d866cea375134a10698c9f8edcb78a0 (patch) | |
tree | fdb1408abc11d00ec628b633a565bfccfe13b0a0 /gr-uhd/include/gnuradio/uhd/usrp_source.h | |
parent | 500517ac00946f0288b6df8aef873793796694a4 (diff) |
uhd: Normalized gain ranges
Diffstat (limited to 'gr-uhd/include/gnuradio/uhd/usrp_source.h')
-rw-r--r-- | gr-uhd/include/gnuradio/uhd/usrp_source.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/gr-uhd/include/gnuradio/uhd/usrp_source.h b/gr-uhd/include/gnuradio/uhd/usrp_source.h index 75e8f8b844..478c875aaa 100644 --- a/gr-uhd/include/gnuradio/uhd/usrp_source.h +++ b/gr-uhd/include/gnuradio/uhd/usrp_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2010-2014 Free Software Foundation, Inc. + * Copyright 2010-2015 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -223,6 +223,24 @@ namespace gr { size_t chan = 0) = 0; /*! + * Set the normalized gain. + * + * The normalized gain is always in [0, 1], regardless of the device. + * 0 corresponds to minimum gain (usually 0 dB, but make sure to read the device + * notes in the UHD manual) and 1 corresponds to maximum gain. + * This will work for any UHD device. Use get_gain() to see which dB value + * the normalized gain value corresponds to. + * + * Note that it is not possible to specify a gain name for this function. + * + * \throws A runtime_error if \p norm_gain is not within the valid range. + * + * \param norm_gain the gain in fractions of the gain range (must be 0 <= norm_gain <= 1) + * \param chan the channel index 0 to N-1 + */ + virtual void set_normalized_gain(double norm_gain, size_t chan = 0) = 0; + + /*! * Get the actual dboard gain setting. * \param chan the channel index 0 to N-1 * \return the actual gain in dB @@ -239,6 +257,19 @@ namespace gr { size_t chan = 0) = 0; /*! + * Returns the normalized gain. + * + * The normalized gain is always in [0, 1], regardless of the device. + * See also set_normalized_gain(). + * + * Note that it is not possible to specify a gain name for this function, + * the result is over the entire gain chain. + * + * \param chan the channel index 0 to N-1 + */ + virtual double get_normalized_gain(size_t chan = 0) = 0; + + /*! * Get the actual dboard gain setting of named stage. * \param chan the channel index 0 to N-1 * \return the actual gain in dB |