<< Chapter < Page | Chapter >> Page > |
The term inside the parentheses is equal to . The term outside the parentheses is not directly available to the assessment mechanism, though it can reasonably beapproximated by . Substituting the derivative into [link] and evaluating at gives the algorithm
Care must be taken when implementing [link] that does not approach zero.
Of course, of [link] is not the only possible goal for the AGC problem.What is important is not the exact form of the performance function, but where the performance function has its optimal points.Another performance function that has a similar error surface (peek ahead to [link] ) is
Taking the derivative gives
where the approximation arises from swapping the order of the differentiation and the averagingand where the derivative of is the signum or sign function, which holds as long as the argument is nonzero.Evaluating this at and substituting into [link] gives another AGC algorithm
Consider the “logic” of this algorithm. Suppose that is positive. Since is fixed,
Thus, if the average energy in exceeds , is decreased. If the average energy in is less than , is increased. The update ceases when , that is, where , as desired. (An analogous logic applies when is negative.)
The two performance functions [link] and [link] define the updates for the two adaptive elements in [link] and [link] . minimizes the square of the deviation of the power in from the desired power . This is a kind of “least square” performance function(hence the subscript LS). Such squared-error objectives are common, and will reappear in phase trackingalgorithms in Chapter [link] , in clock recovery algorithms in Chapter [link] , and in equalization algorithms in Chapter [link] . On the other hand, the algorithm resulting from has a clear logical interpretation (the stands for `naive'), and the update is simpler, since [link] has fewer terms and no divisions.
To experiment concretely with these algorithms,
agcgrad.m
provides an implementation in M
atlab .
It is easy to control the rate at which
changes by choice of stepsize:
a larger
allows
to change faster, while a smaller
allows
greater smoothing. Thus,
can be chosen by the system designer to
trade off the bandwidth of
(the speed at which
can track
variations in the energy levels of the incoming signal) versus theamount of jitter or noise. Similarly, the length over which
the averaging is done (specified by the parameter
lenavg
)
will also affect the speed of adaptation;longer averages imply slower moving, smoother estimates while
shorter averages imply faster moving, more jittery estimates.
n=10000; % number of steps in simulation
vr=1.0; % power of the inputr=sqrt(vr)*randn(n,1); % generate random inputs
ds=0.15; % desired power of outputmu=0.001; % algorithm stepsize
lenavg=10; % length over which to averagea=zeros(n,1); a(1)=1; % initialize AGC parameter
s=zeros(n,1); % initialize outputsavec=zeros(1,lenavg); % vector to store terms for averaging
for k=1:n-1 s(k)=a(k)*r(k); % normalize by a(k)
avec=[sign(a(k))*(s(k)^2-ds),avec(1:lenavg-1)]; % incorporate new update into avec a(k+1)=a(k)-mu*mean(avec); % average adaptive update of a(k)
end
agcgrad.m
minimize the performance function
by choice
of
(download file)
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?