[USRP-users] Problems with setting gain
sean.nowlan at gtri.gatech.edu
Tue Apr 9 14:28:35 EDT 2013
I noticed there's a function called set_value in utils/gain_group.cpp
that recursively sets gains to different gain elements. Is it possible
the extra call to set_value() (shown in uhd.log previously sent) is due
to floating point rounding error on gain_left_to_distribute?
On 04/09/2013 02:06 PM, Sean Nowlan wrote:
> Update 2: I enabled UHD logging and attached an excerpt from uhd.log.
> It shows that the gain gets set to 10 dB, as I requested, but then
> something else calls set_tx_gain() immediately after and overwrites
> it. The only thing I can think of is that something happens when
> gr_uhd_usrp_sink::start() gets called, but I can't say what that might
> be. As far as I can tell, fetching the tx_streamer, setting the send
> mode, etc. wouldn't have any affect on the gain setting.
> On 04/09/2013 01:15 PM, Sean Nowlan wrote:
>> Update: upgrading to 3.5.2 (including reflashing firmware and FPGA) did not fix the problem.
>> Sean Nowlan<sean.nowlan at gtri.gatech.edu> wrote:
>>> I am having trouble with setting gain consistently on the WBX board.
>>> Sometimes it is set correctly as requested. Many times it is set to the
>>> minimum gain for WBX (0 dB) and occasionally it is set to the maximum
>>> (31 dB).
>>> I've observed this problem in several of my own applications, but I also
>>> observed it using GNU Radio's benchmark_tx. Some examples:
>>> ./benchmark_tx.py -m cpm --excess-bw=3 --non-differential -r 2e5 -M 10
>>> -f 1.36e9 --tx-amplitude=0.2 --tx-gain=10
>>> ./benchmark_tx.py -m gmsk --bt=3 --non-differential -r 2e5 -M 10 -f
>>> 1.36e9 --tx-amplitude=0.2 --tx-gain=10
>>> ./benchmark_tx.py -m bpsk --non-differential -r 2e5 -M 10 -f 1.36e9
>>> --tx-amplitude=0.2 --tx-gain=10
>>> I verified that my GNU Radio application is producing samples with
>>> "sane" values, i.e., complex floats with I and Q in [-1.0, 1.0] and with
>>> typical values in [-0.2, 0.2]. The problem doesn't go away if I remove
>>> IQ & DC calibration files (mv ~/.uhd ~/.uhd_backup). Power cycling the
>>> USRP doesn't help.
>>> My application follows the paradigm of a Python script generated by GRC.
>>> In the top block __init__() function I instantiate a uhd_usrp_sink
>>> object and set its freq and gain. Then I instantiate other GNU Radio
>>> objects and connect them. Finally in the main function I call start() on
>>> my top block. I called get_gain() after setting it in __init__() and
>>> verified it was set correctly. However in the main function when I call
>>> get_gain() again, sometimes the value is changed to 0 or 31. I can force
>>> it to behave by setting the gain again, but it concerns me that the
>>> value is getting blown away in some cases and I don't know the root cause.
>>> My next step will be to upgrade to the 3.5.2 release and see if the
>>> problem goes away, but I wanted to get this message on the list as soon
>>> as I could.
>>> USRP N200 r4
>>> WBX r3
>>> GNU C++ version 4.6.3
>>> Boost 104800
>>> UHD 3.5.0 (003.005.000-0-g5cb9779d)
>>> GNU Radio 3.6.2
>>> Thanks for your help!
>>> USRP-users mailing list
>>> USRP-users at lists.ettus.com
>> USRP-users mailing list
>> USRP-users at lists.ettus.com
> USRP-users mailing list
> USRP-users at lists.ettus.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the USRP-users