Forum: GNU Radio TVRX gain troubles

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C95d4135a6fd5a14a3cdbe7430a26b00?d=identicon&s=25 Andrew Lutomirski (Guest)
on 2009-04-07 22:52
(Received via mailing list)
Attachment: gain_test_090407.png (5 KB)
Attachment: usrp_receive.cc (10 KB)
Attachment: avg_power (442 Bytes)
Hi-

I'm having trouble with the gain control on a TVRX (actually, on a
whole bunch of TVRX's).  There are two problems:

1. The effect of the gain setting is far from linear.  I measured this
with the attached program, at 1 dB increments of requested gain, with
antennas (with LNAs) attached to both channels.  (I'm not completely
sure I have the full scale right, but that's just an offset.)  I get
essentially identical results using usrp_rx_cfile.py and a little
Python script to do the same calculation (also attached).

2. The system acts like there's some kind of automatic gain control.
My setup is an antenna (with built-in LNA), connected through a
combiner, to the USRP.  On the other input to the combiner is a signal
generator.  The entire setup is duplicated on sides A and B.  I did
two runs.  First, I had the signal generator on and the antenna
connected.  Then I replaced the antenna with a terminator and left the
signal generator on.  (The USRP was tuned to 106MHz and the signal was
a sine wave at 106.25MHz.)  The power I see in MATLAB at 0.25MHz from
center is dramatically (12 dB) less with the antenna connected.

Any ideas what's going on?

This occurs with gnuradio trunk r10579.  I'm updating now and will try
again with a newer trunk shortly.

Thanks,
Andy
3596cfe1d579c65b9babd35e8787977c?d=identicon&s=25 Matt Ettus (Guest)
on 2009-04-07 23:26
(Received via mailing list)
Andrew Lutomirski wrote:
> Python script to do the same calculation (also attached).
The gain vs. gain setting is always going to be somewhat nonlinear, as
you have seen.  There are 3 stages of gain control -- RF, IF, and PGA.
The only one you can expect to be perfectly linear is the PGA (the last
20 dB).

The reason you see the first two plateaus in the gain curve is that at
the high end of the range of each of those gain settings, the gain amps
become nonlinear is twofold --

First, the gain range becomes more nonlinear near the top of each
variable gain amp.  You could compensate for this in the gain setting
function in the daughterboard code if you like, by reducing the amount
of gain we try to get from each stage.

Second, if your signal is strong enough, it will cause saturation in the
frontend.

The formula we use in the daughterboard code for the TVRX is by no means
optimal.  What it does is first add gain to the RF, until that is maxed
out.  Once that happens, it adds gain to the IF.  Once that is maxed
out, it puts the remaining gain in the PGA.

Every application will have different requirements.  For example, if
there is a strong inband interferer, you will need to reduce the gain.
You might also want to distribute the gain differently, instead of
putting it all up front.


> 2. The system acts like there's some kind of automatic gain control.
> My setup is an antenna (with built-in LNA), connected through a
> combiner, to the USRP.  On the other input to the combiner is a signal
> generator.  The entire setup is duplicated on sides A and B.  I did
> two runs.  First, I had the signal generator on and the antenna
> connected.  Then I replaced the antenna with a terminator and left the
> signal generator on.  (The USRP was tuned to 106MHz and the signal was
> a sine wave at 106.25MHz.)  The power I see in MATLAB at 0.25MHz from
> center is dramatically (12 dB) less with the antenna connected.
>  > http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

There is nothing automatic unless you implement it.  What you are seeing
is compression of your signal from strong nearby stations when you
attach the antenna.  Since you are in the FM band, it is likely that one
or more very strong stations are nearby.

Matt
This topic is locked and can not be replied to.