aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmosdr
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2013-06-09 20:19:17 +0200
committerDimitri Stolnikov <horiz0n@gmx.net>2013-06-09 20:19:17 +0200
commit02f38ca90813582607f6ba790a5800817cd288ae (patch)
treec554431b01b1747f0224de3cca6e3d7b1dee8903 /include/osmosdr
parent656a9a014f5dd6d27f3f3c0a7a4bbee616485969 (diff)
uhd: implement dc correction
Diffstat (limited to 'include/osmosdr')
-rw-r--r--include/osmosdr/sink.h20
-rw-r--r--include/osmosdr/source.h35
2 files changed, 39 insertions, 16 deletions
diff --git a/include/osmosdr/sink.h b/include/osmosdr/sink.h
index f6f304f..a4b52c4 100644
--- a/include/osmosdr/sink.h
+++ b/include/osmosdr/sink.h
@@ -234,29 +234,23 @@ public:
*/
virtual std::string get_antenna( size_t chan = 0 ) = 0;
- enum IQBalanceMode {
- IQBalanceOff = 0,
- IQBalanceManual,
- IQBalanceAutomatic
- };
-
/*!
- * Set the RX frontend IQ balance mode.
+ * Set the TX frontend DC offset value.
+ * The value is complex to control both I and Q.
*
- * \param mode iq balance correction mode: 0 = Off, 1 = Manual, 2 = Automatic
+ * \param offset the dc offset (1.0 is full-scale)
* \param chan the channel index 0 to N-1
*/
- virtual void set_iq_balance_mode( int mode, size_t chan = 0 ) = 0;
+ virtual void set_dc_offset( const std::complex<double> &offset, size_t chan = 0 ) = 0;
/*!
- * Set the RX frontend IQ balance correction.
+ * Set the TX frontend IQ balance correction.
* Use this to adjust the magnitude and phase of I and Q.
*
- * \param correction the complex correction value
+ * \param balance the complex correction value
* \param chan the channel index 0 to N-1
*/
- virtual void set_iq_balance( const std::complex<double> &correction,
- size_t chan = 0 ) = 0;
+ virtual void set_iq_balance( const std::complex<double> &balance, size_t chan = 0 ) = 0;
/*!
* Set the bandpass filter on the radio frontend.
diff --git a/include/osmosdr/source.h b/include/osmosdr/source.h
index 2d0da3b..081c6de 100644
--- a/include/osmosdr/source.h
+++ b/include/osmosdr/source.h
@@ -234,6 +234,36 @@ public:
*/
virtual std::string get_antenna( size_t chan = 0 ) = 0;
+ enum DCOffsetMode {
+ DCOffsetOff = 0,
+ DCOffsetManual,
+ DCOffsetAutomatic
+ };
+
+ /*!
+ * Set the RX frontend DC correction mode.
+ * The automatic correction subtracts out the long-run average.
+ *
+ * When disabled, the averaging option operation is reset.
+ * Once in Manual mode, the average value will be held constant until
+ * the user re-enables the automatic correction or overrides the
+ * value by manually setting the offset.
+ *
+ * \param mode dc offset correction mode: 0 = Off, 1 = Manual, 2 = Automatic
+ * \param chan the channel index 0 to N-1
+ */
+ virtual void set_dc_offset_mode( int mode, size_t chan = 0) = 0;
+
+ /*!
+ * Set the RX frontend DC offset value.
+ * The value is complex to control both I and Q.
+ * Only set this when automatic correction is disabled.
+ *
+ * \param offset the dc offset (1.0 is full-scale)
+ * \param chan the channel index 0 to N-1
+ */
+ virtual void set_dc_offset( const std::complex<double> &offset, size_t chan = 0 ) = 0;
+
enum IQBalanceMode {
IQBalanceOff = 0,
IQBalanceManual,
@@ -252,11 +282,10 @@ public:
* Set the RX frontend IQ balance correction.
* Use this to adjust the magnitude and phase of I and Q.
*
- * \param correction the complex correction value
+ * \param balance the complex correction value
* \param chan the channel index 0 to N-1
*/
- virtual void set_iq_balance( const std::complex<double> &correction,
- size_t chan = 0 ) = 0;
+ virtual void set_iq_balance( const std::complex<double> &balance, size_t chan = 0 ) = 0;
/*!
* Set the bandpass filter on the radio frontend.