aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/super_recv_packet_handler.hpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-07-08 11:58:51 -0700
committerJosh Blum <josh@joshknows.com>2011-07-08 11:58:51 -0700
commit54229a06d1e4c05158ef9517fd61e61204363ed6 (patch)
tree9102001f3a60d3af433d5b257ed213cd3faa9fdf /host/lib/transport/super_recv_packet_handler.hpp
parentaa6b340f436acf4c0cad80416f69312ecfe3f29f (diff)
downloaduhd-54229a06d1e4c05158ef9517fd61e61204363ed6.tar.gz
uhd-54229a06d1e4c05158ef9517fd61e61204363ed6.tar.bz2
uhd-54229a06d1e4c05158ef9517fd61e61204363ed6.zip
usrp: added software scale factor adjustment
Diffstat (limited to 'host/lib/transport/super_recv_packet_handler.hpp')
-rw-r--r--host/lib/transport/super_recv_packet_handler.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp
index d79e0b2c0..15bd78242 100644
--- a/host/lib/transport/super_recv_packet_handler.hpp
+++ b/host/lib/transport/super_recv_packet_handler.hpp
@@ -74,6 +74,7 @@ public:
{
this->resize(size);
set_alignment_failure_threshold(1000);
+ this->set_scale_factor(1/32767.);
}
//! Resize the number of transport channels
@@ -153,6 +154,11 @@ public:
return boost::mutex::scoped_lock(_mutex);
}
+ //! Set the scale factor used in float conversion
+ void set_scale_factor(const double scale_factor){
+ _scale_factor = scale_factor;
+ }
+
/*******************************************************************
* Receive:
* The entry point for the fast-path receive calls.
@@ -238,6 +244,7 @@ private:
std::vector<void *> _io_buffs; //used in conversion
size_t _bytes_per_item; //used in conversion
std::vector<uhd::convert::function_type> _converters; //used in conversion
+ double _scale_factor;
//! information stored for a received buffer
struct per_buffer_info_type{
@@ -558,7 +565,7 @@ private:
}
//copy-convert the samples from the recv buffer
- _converters[io_type.tid](buff_info.copy_buff, _io_buffs, nsamps_to_copy_per_io_buff, 1/32767.);
+ _converters[io_type.tid](buff_info.copy_buff, _io_buffs, nsamps_to_copy_per_io_buff, _scale_factor);
//update the rx copy buffer to reflect the bytes copied
buff_info.copy_buff += bytes_to_copy;