summaryrefslogtreecommitdiffstats
path: root/host/tests
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-05-23 13:37:05 -0700
committerJosh Blum <josh@joshknows.com>2011-06-14 17:27:46 -0700
commit86f12cd1c1c606bbfbc6f0ddbd98166fe9251a13 (patch)
tree94cb1723707957dc0ff7288220ff24c6ca6bbb9e /host/tests
parentfb85b0c9eb5a50a16e7568140d144650794774de (diff)
downloaduhd-86f12cd1c1c606bbfbc6f0ddbd98166fe9251a13.tar.gz
uhd-86f12cd1c1c606bbfbc6f0ddbd98166fe9251a13.tar.bz2
uhd-86f12cd1c1c606bbfbc6f0ddbd98166fe9251a13.zip
uhd: added scaling factor to conversion routines
Diffstat (limited to 'host/tests')
-rw-r--r--host/tests/convert_test.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/host/tests/convert_test.cpp b/host/tests/convert_test.cpp
index d1c2b7625..ff37d4a0a 100644
--- a/host/tests/convert_test.cpp
+++ b/host/tests/convert_test.cpp
@@ -55,12 +55,12 @@ template <typename Range> static void loopback(
//convert to intermediate type
convert::get_converter_cpu_to_otw(
io_type, otw_type, input0.size(), output0.size()
- )(input0, output0, nsamps);
+ )(input0, output0, nsamps, 1/32767.);
//convert back to host type
convert::get_converter_otw_to_cpu(
io_type, otw_type, input1.size(), output1.size()
- )(input1, output1, nsamps);
+ )(input1, output1, nsamps, 32767.);
}
/***********************************************************************
@@ -207,12 +207,12 @@ BOOST_AUTO_TEST_CASE(test_convert_types_fc32_to_sc16){
//convert float to intermediate
convert::get_converter_cpu_to_otw(
io_type_in, otw_type, input0.size(), output0.size()
- )(input0, output0, nsamps);
+ )(input0, output0, nsamps, 1/32767.);
//convert intermediate to short
convert::get_converter_otw_to_cpu(
io_type_out, otw_type, input1.size(), output1.size()
- )(input1, output1, nsamps);
+ )(input1, output1, nsamps, 32767.);
//test that the inputs and outputs match
for (size_t i = 0; i < nsamps; i++){
@@ -247,12 +247,12 @@ BOOST_AUTO_TEST_CASE(test_convert_types_sc16_to_fc32){
//convert short to intermediate
convert::get_converter_cpu_to_otw(
io_type_in, otw_type, input0.size(), output0.size()
- )(input0, output0, nsamps);
+ )(input0, output0, nsamps, 32767.);
//convert intermediate to float
convert::get_converter_otw_to_cpu(
io_type_out, otw_type, input1.size(), output1.size()
- )(input1, output1, nsamps);
+ )(input1, output1, nsamps, 1/32767.);
//test that the inputs and outputs match
for (size_t i = 0; i < nsamps; i++){