Agc


#1

Hi,

Can I use the gr_agc code as a block in a flow graph?

I have an arbitrary float signal that I would like to always have the
same
voltage peak to peak regardless of the input signal. Is this possible?

I’m using gnuradio 2.8

Thanks!

Mike


#2

Mike,

I’ve used both the floating point and complex implementations of the AGC
block, and they work fine. For most signals, using (1e-4, 1, 1) will
adjust
the gain to output a signal at +1 and -1. The second term will be the
final
peak output value you will get. If I’m remembering correctly, the first
term
is the loop gain, which will determine the convergence speed of the AGC.
The
last term is the initial gain.

It’s a very straight-forward block to use.

Tom


#3

Tom R. wrote:

I’ve used both the floating point and complex implementations of the AGC
block, and they work fine. For most signals, using (1e-4, 1, 1) will adjust
the gain to output a signal at +1 and -1. The second term will be the final
peak output value you will get. If I’m remembering correctly, the first term
is the loop gain, which will determine the convergence speed of the AGC. The
last term is the initial gain.

It’s a very straight-forward block to use.

For an aviation band AM receiver, I’ve had to set the loop gain to 1e-3,
as the default is too slow to adjust between the rapid fire exchanges
between the aircraft pilot and air-traffic-control (at widely varying
power levels.)

More interestingly, I’m using complex_to_mag to demodulate a 32K sps
baseband channel as AM, then filtering/decimating the resulting audio.

If I set the AGC reference value (second parameter) to anything above
0.2 (including the default 1.0), the audio comes out distorted. It
sounds like clipping.

For a reference value, of say, 0.5, complex_to_mag should be outputting
peaks at |0.5+0.5j| which is ~0.71.

The FIR filter has a gain of 1.0, and the audio sink takes -1.0 to 1.0,
I believe. So where would the clipping come in? Am I off by a factor
of two or four somewhere in my calculations?

I guess I’ll dump an example to a filesink and look at the values
manually, unless there is some quicker way to see the statistics of a
stream of floats.

-Johnathan