[USRP-users] Gain distribution surprise

Marc Epard mepard at me.com
Wed Sep 12 18:34:59 EDT 2012


We've created a receiver daughterboard with two RF gain stages. The first ranges from 0 to 31 dB in steps of 1 dB. The second ranges from 0 to 18 dB in steps of 6 dB. Surprisingly (to me, anyway), the distribution algorithm in gain_group.cpp sometimes sends gain to the ADC gain stage even when there is more gain available in our RF stages. I added logging to gain_group.cpp to uncover this. The source is enclosed.

I also added two tests to gain_group_test.cpp to demonstrate this behavior (source enclosed). Prioritizing the course stage works as expected, prioritizing the fine gain stage does not. The test log output follows.

Am I misunderstanding how it should work? It's not a big deal as we can easily work around this by explicitly setting the two gains ourselves.

-Marc

7/15 Testing: gain_group_test
7/15 Test: gain_group_test
Command: "C:/Users/Yeager/Projects/Impulse/uhdlib/build/tests/Release/gain_group_test.exe"
Directory: C:/Users/Yeager/Projects/Impulse/uhdlib/build/tests
"gain_group_test" start time: Sep 12 16:42 Central Daylight Time
Output:
----------------------------------------------------------
Win32; Microsoft Visual C++ version 10.0; Boost_104700; UHD_003.004.001-0-unknown

Running 4 test cases...
gain groups course, fine
gain groups fine, course
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [31 != 32]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [31 != 33]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [31 != 34]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [31 != 35]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [37 != 38]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [37 != 39]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [37 != 40]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [37 != 41]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [43 != 44]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [43 != 45]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [43 != 46]
C:/Users/Yeager/Projects/Impulse/uhdlib/tests/gain_group_test.cpp(199): error in "test_gain_group_fine_course": check gg->get_value() == gain failed [43 != 47]

*** 12 failures detected in test suite "Master Test Suite"
<end of output>
Test time =   0.05 sec
----------------------------------------------------------
Test Failed.
"gain_group_test" end time: Sep 12 16:42 Central Daylight Time
"gain_group_test" time elapsed: 00:00:00
----------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gain_group_test.cpp
Type: application/octet-stream
Size: 6115 bytes
Desc: not available
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120912/8cad2f5b/attachment.cpp>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gain_group.cpp
Type: application/octet-stream
Size: 8105 bytes
Desc: not available
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120912/8cad2f5b/attachment-0001.cpp>
-------------- next part --------------




More information about the USRP-users mailing list