Main Content


Automatically adjusts gain to maintain output waveform amplitude


serdes.AGC System object™ applies an adaptive variable gain to the input waveform to achieve a desired RMS output voltage. Averaging the RMS voltage over a specified number of symbols, serdes.AGC performs automatic gain control (AGC) by increasing or decreasing the gain, or keeping the gain constant.

To adjust the gain of the input signal:

  1. Create the serdes.AGC object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?



agc = serdes.AGC returns an AGC object that modifies an input waveform according to the root-mean-squared property of the AGC block.

agc = serdes.AGC(Name,Value) sets properties using one or more name-value pairs. Enclose each property name in quotes. Unspecified properties have default values.

Example: agc = serdes.AGC('TargetRMSVoltage',0.5) returns an AGC object with an output RMS voltage of 0.5 V.


expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.


AGC operating mode, specified as 0 or 1. Mode determines if the AGC adjusts the gain of input baseband signal or acts as a pass-through.

Mode ValueAGC ModeAGC Operation
0Offserdes.AGC is bypassed, the input waveform remains unchanged.
1Onserdes.AGC adjusts gain of input waveform to maintain TargetRMSVoltage in the output waveform.

Data Types: double

Desired RMS voltage of the output waveform, specified as a nonnegative real scalar in the range [0, 10] in volts. Setting the TargetRMSVoltage to 0 results in an all zero output.

Data Types: double


Time of a single symbol duration, specified as a positive real scalar in seconds.

Data Types: double

Uniform time step of the waveform, specified as a real positive scalar in seconds.

Data Types: double

Modulation value that specifies the modulation scheme, the number of logic levels in the encoded signal, specified as 2, 3, 4, 8, or 16.

Modulation ValueModulation Scheme
2Non-return to zero (NRZ)
3Three-level pulse amplitude modulation (PAM3)
4Four-level pulse amplitude modulation (PAM4)
8Eight-level pulse amplitude modulation (PAM8)
16Sixteen-level pulse amplitude modulation (PAM16)


According to IBIS BIRD (Buffer Issue Resolution Document) 213, IBIS-AMI models support any level of signaling from PAM2 (NRZ) to upwards, collectively known as PAMn. If your EDA tool supports it, you can export IBIS-AMI models supporting modulation schemes NRZ, PAM3, PAM4, PAM8, or PAM16.

Data Types: double

Maximum allowed AGC gain, specified as a positive real scalar. MaxGain provides a stable startup of the adaptive algorithm.

Data Types: double

Averaging length, specified as a positive real integer. AveragingLength defines the number of symbol over which the RMS calculation of the input signal is made.

Data Types: double

Input wave type form:

  • 'Sample' — A sample-by-sample input signal.

  • 'Impulse' — An impulse response input signal.

  • 'Waveform' — A bit-pattern waveform type of input signal, such as pseudorandom binary sequence (PRBS).

Data Types: char



y = agc(x)

Input Arguments

expand all

Input baseband signal. If the WaveType is set to 'Sample', the input signal is a sample-by-sample signal specified as a scalar. If the WaveType is set to 'Impulse', the input signal is an impulse response vector signal.

Output Arguments

expand all

Gain adjusted output signal. If the input signal is a sample-by-sample signal specified as a scalar, the output is also scalar. If the input signal is an impulse response vector signal, the output is also a vector.

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:


expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object


collapse all

Use a serdes.AGC system object™ to reduce the amplitude of a waveform signal to maintain an rms voltage of 0.25 V.

Create a signal with two sinusoids, one at 250 Hz, and the other at 340 Hz. The sampling frequency is 800 Hz. The signal is corrupted with additive zero-mean random noise.

Fs = 10000;
L = 1000;
t = (0:L-1)'/Fs;
x = sin(2*pi*250*t) + 0.75*cos(2*pi*340*t);         % Original signal
y = x + .5*randn(size(x));                          % Noisy signal

Find the frequency components of the signal using serdes.AGC.

agcblock = serdes.AGC('TargetRMSVoltage',0.25);
z = agcblock(y);

Plot the input and modified waveforms.

figure, plot(t,y,t,z)
legend('AGC input','AGC output')
title('Example Application of the Automatic Gain Control SerDes block');
xlabel('time [seconds]');


[1] Design and Operation of Automatic Gain Control Loops for Receivers in Modern Communication Systems,

Extended Capabilities

Version History

Introduced in R2019a

See Also

| |