# 0.5 Sampling with automatic gain control  (Page 16/19)

 Page 16 / 19

The term ${a}^{2}{r}^{2}\left(kT\right)$ inside the parentheses is equal to ${s}^{2}\left[k\right]$ . The term $a{r}^{2}\left(kT\right)$ outside the parentheses is not directly available to the assessment mechanism, though it can reasonably beapproximated by $\frac{{s}^{2}\left[k\right]}{a}$ . Substituting the derivative into [link] and evaluating at $a=a\left[k\right]$ gives the algorithm

$a\left[k+1\right]=a\left[k\right]-\mu \text{avg}\left\{\left({s}^{2}\left[k\right]-{\mathbf{s}}^{2}\right),\frac{{s}^{2}\left[k\right]}{a\left[k\right]}\right\}.$

Care must be taken when implementing [link] that $a\left[k\right]$ does not approach zero.

Of course, ${J}_{LS}\left(a\right)$ 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

$\begin{array}{cc}\hfill {J}_{N}\left(a\right)& =\text{avg}\left\{|a|\left(\frac{{s}^{2}\left[k\right]}{3}-{\mathbf{s}}^{2}\right)\right\}\hfill \\ & =\text{avg}\left\{|a|\left(\frac{{a}^{2}{r}^{2}\left(kT\right)}{3}-{\mathbf{s}}^{2}\right)\right\}.\hfill \end{array}$

Taking the derivative gives

$\begin{array}{ccc}\hfill \frac{d{J}_{N}\left(a\right)}{da}& =& \frac{d\text{avg}\left\{|a|\left(\frac{{a}^{2}{r}^{2}\left(kT\right)}{3}-{\mathbf{s}}^{2}\right)\right\}}{da}\hfill \\ & \approx & \text{avg}\left\{\frac{d|a|\left(\frac{{a}^{2}{r}^{2}\left(kT\right)}{3}-{\mathbf{s}}^{2}\right)}{da}\right\}\hfill \\ & =& \text{avg}\left\{\text{sgn}\left(a\left[k\right]\right)\left({s}^{2}\left[k\right]-{\mathbf{s}}^{2}\right)\right\},\hfill \end{array}$

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 $a=a\left[k\right]$ and substituting into [link] gives another AGC algorithm

$a\left[k+1\right]=a\left[k\right]-\mu \phantom{\rule{4pt}{0ex}}\text{avg}\left\{\text{sgn}\left(a\left[k\right]\right)\left({s}^{2}\left[k\right]-{\mathbf{s}}^{2}\right)\right\}.$

Consider the “logic” of this algorithm. Suppose that $a$ is positive. Since $\mathbf{s}$ is fixed,

$\begin{array}{cc}\hfill \text{avg}\left\{\text{sgn}\left(a\left[k\right]\right)\left({s}^{2}\left[k\right]-{\mathbf{s}}^{2}\right)\right\}& =\text{avg}\left\{\left({s}^{2}\left[k\right]-{\mathbf{s}}^{2}\right)\right\}\hfill \\ & =\text{avg}\left\{{s}^{2}\left[k\right]\right\}-{\mathbf{s}}^{2}.\hfill \end{array}$

Thus, if the average energy in $s\left[k\right]$ exceeds ${\mathbf{s}}^{2}$ , $a$ is decreased. If the average energy in $s\left[k\right]$ is less than ${\mathbf{s}}^{2}$ , $a$ is increased. The update ceases when $\text{avg}\left\{{s}^{2}\left[k\right]\right\}\approx {\mathbf{s}}^{2}$ , that is, where ${a}^{2}\approx \frac{{\mathbf{s}}^{2}}{{r}^{2}}$ , as desired. (An analogous logic applies when $a$ is negative.)

The two performance functions [link] and [link] define the updates for the two adaptive elements in [link] and [link] . ${J}_{LS}\left(a\right)$ minimizes the square of the deviation of the power in $s\left[k\right]$ from the desired power ${\mathbf{s}}^{2}$ . 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 ${J}_{N}\left(a\right)$ has a clear logical interpretation (the $N$ 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 $a\left[k\right]$ changes by choice of stepsize: a larger $\mu$ allows $a\left[k\right]$ to change faster, while a smaller $\mu$ allows greater smoothing. Thus, $\mu$ can be chosen by the system designer to trade off the bandwidth of $a\left[k\right]$ (the speed at which $a\left[k\right]$ 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 $J\left(a\right)=\text{avg}\left\{|a|\left(\left(1/3\right){a}^{2}{r}^{2}-ds\right)\right\}$ by choice of $a$ (download file) `

how can chip be made from sand
is this allso about nanoscale material
Almas
are nano particles real
yeah
Joseph
Hello, if I study Physics teacher in bachelor, can I study Nanotechnology in master?
no can't
Lohitha
where is the latest information on a no technology how can I find it
William
currently
William
where we get a research paper on Nano chemistry....?
nanopartical of organic/inorganic / physical chemistry , pdf / thesis / review
Ali
what are the products of Nano chemistry?
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
da
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Bhagvanji
hey
Giriraj
Preparation and Applications of Nanomaterial for Drug Delivery
revolt
da
Application of nanotechnology in medicine
has a lot of application modern world
Kamaluddeen
yes
narayan
what is variations in raman spectra for nanomaterials
ya I also want to know the raman spectra
Bhagvanji
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
Nasa has use it in the 60's, copper as water purification in the moon travel.
Alexandre
nanocopper obvius
Alexandre
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Got questions? Join the online conversation and get instant answers!