Main Content

Time Varying Gain

Time varying gain (TVG) control

  • Time Varying Gain block

Phased Array System Toolbox / Detection


The Time Varying Gain block applies a time-varying gain to input signals to compensate for geometric range loss at each range gate. Time varying gain (TVG) is sometimes called automatic gain control (AGC).



expand all

Input signal, specified as a vector or matrix.

The size of the first dimension of the input matrix can vary to simulate a changing signal length. A size change can occur, for example, in the case of a pulse waveform with variable pulse repetition frequency.

Data Types: double | single

Range loss, specified as a column vector. The length of p must be equal to or greater than the number of rows of X.

The process equalizes power levels across all samples to match a given reference range. The compensated signal is returned in Y. X can be a column vector, a matrix, or a cube. The gain is applied to each column in X independently. The number of rows in X cannot exceed the length of the loss vector specified in the RangeLoss property. Y has the same dimensionality as X. X can be single or double precision.


To enable this port, set Source of range losses parameter to Input port.

Data Types: double | single


expand all

Range-compensated Input signal, returned as a vector or matrix. The output has the same size as the input signal.

Data Types: double | single


expand all

Range loss source, specified as Property or Input Port.

Property Range losses are specified by the Range loss (dB) parameter.
Input port Range losses are specified using the input port L .

Loss at each input sample range, specified as a vector — elements correspond to the samples in the input signal. Units are in dB.

Specify the loss at a given reference range as a scalar. Units are in dB.

Block simulation, specified as Interpreted Execution or Code Generation. If you want your block to use the MATLAB® interpreter, choose Interpreted Execution. If you want your block to run as compiled code, choose Code Generation. Compiled code requires time to compile but usually runs faster.

Interpreted execution is useful when you are developing and tuning a model. The block runs the underlying System object™ in MATLAB. You can change and execute your model quickly. When you are satisfied with your results, you can then run the block using Code Generation. Long simulations run faster with generated code than in interpreted execution. You can run repeated executions without recompiling, but if you change any block parameters, then the block automatically recompiles before execution.

This table shows how the Simulate using parameter affects the overall simulation behavior.

When the Simulink® model is in Accelerator mode, the block mode specified using Simulate using overrides the simulation mode.

Acceleration Modes

Block SimulationSimulation Behavior
NormalAcceleratorRapid Accelerator
Interpreted ExecutionThe block executes using the MATLAB interpreter.The block executes using the MATLAB interpreter.Creates a standalone executable from the model.
Code GenerationThe block is compiled.All blocks in the model are compiled.

For more information, see Choosing a Simulation Mode (Simulink).

Programmatic Use

Block Parameter:SimulateUsing
Values:Interpreted Execution, Code Generation
Default:Interpreted Execution

Version History

Introduced in R2014b