**One of the most common topologies in electronic design is the Automatic Gain Control (AGC). In this post we will study what is its operating modes, its basic topology and its most common use. We will also make to its simulation in MatLab, using SIMULINK, understanding better its behavior.**

**LINEAR AMPLIFIERS**

One of the most common blocks in an electronic system is the linear amplifier. This is a device where the output signal is directly proportional to the input. As the output level is greater than the input, the block increase the signal level, then it is an amplification. If the output level was lower than the input level, then we would speak of a level reduction or attenuation.

The linear amplifiers usually have a fixed gain, which is the proportionality constant between the input and the output signals, and a variable gain, where this ratio can be controlled an external control voltage v_{c}.

This voltage is a variable that also depends on time, although under conditions of free control, done by the user, once the control value is chosen, this variable becomes stationary with time and the amplifier becomes fixed gain.

However, the input signals may have oscillations due to the propagation channel, and increase or decrease in value as a function of time. If the amplifier has a fixed gain, the output will follow lineary the input variations.

In general, conventional amplifiers usually have a fixed gain with an external regulation that can be controlled by the user. However, within communication systems there may be cases in which it is always necessary to ensure that the output takes a fixed value. And for this it is needed to use an Automatic Gain Control (AGC).

**THE AUTOMATIC GAIN CONTROL**

The AGC is a feedback system, which uses the output variable, taking a sample, and processes it properly generating a control voltage vc(t) that varies the output level, keeping it fixed against the input variations.

The typical AGC block diagram can be seen in the following figure

It consists of a variable voltage amplifier, which is expressed by the formula seen in the previous section, an envelope detector, because the amplitude of the signal * v_{out}* contains the information of the variation of the input signal, since vout is proportional a

*, a comparator, which compares the detected signal with a reference signal vref, which is the one that will govern the appropriate output level in vout and an integrating filter, which provides the control variable.*

**v**_{in}By varying * v_{in}* at time

*, the VGA is in a steady state, behaving like a linear gain amplifier. This causes a variation in the output signal*

**t**_{0}*that follows the input*

**v**_{out}*. This variation is detected by the envelope detector, causing a change in the comparator output, which, when integrated, modifies the value of*

**v**_{in}*, adapting it so that*

**v**_{c}*is corrected and starts to match the value before the change.*

**v**_{out}It is a dynamic process: the vin and vout signals vary temporarily but keeping a stationary envelope level. For example, a pure sine wave has a constant envelope varying in [-1, 1] intervale

When a change in the envelope is detected at a certain time, the peak value of the amplitude changes and is detected by the detector, which initiates a temporary feedback process that does not affect the waveform, but does affect its amplitude.

**CONTROL MECHANISMS IN AN AGC**

Returning to the system in Fig. 1, where the VGA has a gain represented by the expression

In this expression the temporal domain is removed, because at this moment we are not interested in the temporal variation of * v_{c}*, since if there is no variation in

*,*

**v**_{in}*remains stationary.*

**v**_{c}The input signal is the next

and the output signal is

This signal will pass through the envelope detector, the output of which is a signal that is proportional to the amplitude of the input signal, where * k* is the proportionality constant. Therefore, the output signal of the envelope detector will be

This signal is passed through a logarithmic amplifier, since the dependence of * v_{E}* on

*is exponential. Since the base is natural, we choose the natural logarithm as the logarithmic amplifier, and we can get an output voltage*

**v**_{c}*whose expression is*

**v**_{2}In this expression we can verify that * k* and

*are constant values, and that*

**g**_{0}*and*

**a***are the ones that can vary with respect to time. If we now include the temporal variation of*

**v**_{c}*, we will have that the expression is*

**a**Therefore a variation of a is compensated by a variation of vc so that v2 returns to the value before the change in a.

Making the comparison between the voltage * v_{2}(t)* and

*, which is a fixed value and that will fix the output level on the amplifier, we have a signal*

**v**_{R}*that has the following expression*

**v**_{1}This signal is passed through a low-pass filter that integrates it, getting * v_{C}(t)*. If the filter has a transfer function

*, what we do is a convolution of the signal*

**h(t)***with*

**v**_{1}

**h(t)**And then

In the temporal domain, convolution is a dynamic integral equation, so if we use the Laplace domain, we will transform that convolutional response to a response in the domain of the complex variable * s*, which is linear. Using this domain, the equation above is now

which is the Laplace transform. Studying the value of * V_{1}(s)* if the output has a value an amplitude

**b**removing the dependency with * k* and with

*. Thus, making the same steps as in the previous case, we will have to*

**g**_{0}The first term is the quotient of two functions, one of them depends on the output amplitude and the other depends on the input amplitude. If we choose **k****· g_{0} = 1**, we will get

And being * y(t)* and

*voltage values, we can apply the dB definition, which is*

**x(t)**and then

removing the temporary domain and turning the system into a totally linear system. Then we will have to

being the transfer function in dB of the variation between the output and input amplitudes.

If the filter used is an integrating filter with a pole at the origin (low-pass filter), like this

the expression will be

Now suppose that the input envelope **A _{dB}** changes 1 dB, increasing or decreasing. The new envelope is

**A’**, and the output envelope,

_{dB}(s)**B’**. Then:

_{dB}(s)And having

since feedback must always respond in the same way. Substituting the expression for the input variation in the previous expression we have

Se we can calculate **B’ _{dB}(s)** multiplying by the transfer function

And knowing that the first term is **B _{dB}(s)**, the expression will be the next

The above equation links the new envelope **B’ _{dB}(s)** with the former

**B**. And being a transient response, applying the inverse transformation it is got

_{dB}(s)Lt’s study this result: When 1 dB (instant **t=0**) is increased, the expresion is **b’ _{dB}(t)**

**–b**, because at

_{dB}(t)=+δ(t)=+1**t=0**the filter

**h(t)**has not worked yet. Therefore, at this time the difference between the new and the initial envelope is 1 dB. When

**t**is increasing, there is an decreasing exponential response due to the second term of the previous expression, ans when the time is increasing more, the difference between

**b’**and

_{dB}(t)**b**is decreasing (inicially

_{dB}(t)**b’**) until both are equal.

_{dB}(t)>b_{dB}(t)Conversely, decreasing the input envelope 1dB, then **b’ _{dB}(t)**

**–b**, and the final envelope decreases this value for the same reason, and the operation is the inverse of the previous case.

_{dB}(t)=-δ(t)=-1From this it follows that when the input envelope rises or falls 1 dB, the output envelope, at the initial moment, tends to rise or fall following the variation of the input envelope, but when time passes, the output envelope stabilizes until it reaches the initial value **y _{dB}(t)**.

The AGC time response is **α·C/e **es **τ=1/α·C, **which is a constant time. When this constant is high, the AGC changes slowly, but being low, the AGC changes fastly. A compromise with the AGC response time is required in signals that also contain nominal variations for their content, such as analogue audio or video signals, so as not to confuse a level variation with a variation of that content.

**CONCLUSION**

In this entry we have been able to verify what is the theoretical behavior of the AGC block diagram, studying its response in the Laplace domain and in the temporal domain. We have reached a transfer relationship that allows us to relate the variations of the output signal to the input signal and how we can calculate the AGC response time, which we will have to include through the integrating filter and the study of the variation constant of the amplifier gain.

In the next post we will study this system using **SIMULINK**.

**REFERENCES**

- Benjamin C. Kuo; “Automatic Control Systems”; 2nd ed.; Englewood Cliffs, NJ; Prentice Hall; 1975
- Pere Matí i Puig; “Subsistemas de radiocomunicaciones analógicos”;Universitat Oberta de Catalunya;2010