summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/stream.hpp7
-rw-r--r--host/lib/usrp/cores/rx_dsp_core_200.cpp2
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_200.cpp2
3 files changed, 10 insertions, 1 deletions
diff --git a/host/include/uhd/stream.hpp b/host/include/uhd/stream.hpp
index cec2eee79..1fb846955 100644
--- a/host/include/uhd/stream.hpp
+++ b/host/include/uhd/stream.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011-2012 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -79,6 +79,11 @@ struct UHD_API stream_args_t{
* The args parameter is used to pass arbitrary key/value pairs.
* Possible keys used by args (depends on implementation):
*
+ * - fullscale: specifies the full-scale amplitude when using floats.
+ * By default, the fullscale amplitude under floating point is 1.0.
+ * Set the "fullscale" to scale the samples in the host to the
+ * expected input range and/or output range of your application.
+ *
* - peak: specifies a fractional sample level to calculate scaling with the sc8 wire format.
* When using sc8 samples over the wire, the device must scale samples
* (both on the host and in the device) to satisfy the dynamic range needs.
diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp
index 0996952ff..4b60f111c 100644
--- a/host/lib/usrp/cores/rx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp
@@ -241,6 +241,8 @@ public:
}
else throw uhd::value_error("USRP RX cannot handle requested wire format: " + stream_args.otw_format);
+ _host_extra_scaling *= stream_args.args.cast<double>("fullscale", 1.0);
+
this->update_scalar();
_iface->poke32(REG_RX_CTRL_FORMAT, format_word);
diff --git a/host/lib/usrp/cores/tx_dsp_core_200.cpp b/host/lib/usrp/cores/tx_dsp_core_200.cpp
index 7f02d59ca..2faf7c28b 100644
--- a/host/lib/usrp/cores/tx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/tx_dsp_core_200.cpp
@@ -192,6 +192,8 @@ public:
}
else throw uhd::value_error("USRP TX cannot handle requested wire format: " + stream_args.otw_format);
+ _host_extra_scaling /= stream_args.args.cast<double>("fullscale", 1.0);
+
this->update_scalar();
_iface->poke32(REG_TX_CTRL_FORMAT, format_word);