System object: phased.TimeVaryingGain
Apply time varying gains to input signal
Y = step(H,X)
Y = step(H,X,L)
Starting in R2016b, instead of using the
to perform the operation defined by the System
object™, you can
call the object with arguments, as if it were a function. For example,
= step(obj,x) and
y = obj(x) perform
time varying gains to the input signal matrix
Y = step(
The process equalizes power levels across all samples to match a given
reference range. The compensated signal is returned in
be a column vector, a matrix, or a cube. The gain is applied to each
X independently. The number of rows
X cannot exceed the length of the loss vector
specified in the
the same dimensionality as
The size of the first dimension of this input matrix can vary to simulate a changing signal length, such as a pulse waveform with variable pulse repetition frequency.
addition, specifies the range loss,
Y = step(
L as a columns
vector. Use this argument only when you set the
'Input port'. The length of
be equal to or greater than the number of rows of
The object performs an initialization the first time the
is executed. This initialization locks nontunable
properties (MATLAB) and input specifications, such as dimensions, complexity,
and data type of the input data. If you change a nontunable property
or an input specification, the System
object issues an error.
To change nontunable properties or inputs, you must first call the
to unlock the object.
Apply time varying gain to a signal to compensate for signal power loss due to range.
First, create a signal with range loss. Set the reference loss to 16 dB.
rngloss = 10:22; refloss = 16; t = (1:length(rngloss))'; x = 1./db2mag(rngloss(:));
Then add gain to compensate for range loss.
gain = phased.TimeVaryingGain('RangeLoss',rngloss,'ReferenceLoss',refloss); y = gain(x);
Plot the signal with loss and the compensated signal.
tref = find(rngloss==refloss); stem([t t],[abs(x) abs(y)]) hold on stem(tref,x(tref),'filled','r') xlabel('Time (s)'); ylabel('Magnitude (V)') grid on legend('Before time varying gain','After time varying gain',... 'Reference range')