You are on page 1of 20

A high-performance, automatic gain control (AGC)

and dynamic range compression device for hi-fi audio systems


Glauco Masotti
Abstract
An automatic gain control (AGC) and dynamic range compression device for audio systems is presented
1
.
In one mode of operation, the device is capable of emulating manual regulation of the audio level, relieving
users from the tas of maing ad!ustments each time they change input source. In this modality the
ma"imum output amplitude is ept nearly constant over time, but #ith negligible alteration of the genuine
dynamic range of the input signal. $he introduced distortion, noise and other artifacts are belo# normal
audible perception. In other modes of operation, the device can also perform a certain amount of dynamic
range compression, acting more promptly to maintain the output signal close to the optimum desired level. In
any case, thans to some original solutions, the alteration of the real dynamics of the source is minimal,
compared to the results of common techni%ues. &ther inconveniences of typical AGC circuits are avoided as
#ell. $he gadget is also simple to use and self'adapting, it(s thus suitable for home use #ith hi'fi audio
systems.
Keywords: automatic gain control (AGC), overcoming common AGC defects, hifi audio system with
multiple sources, automatic volume leveling (AVL) upon switching input source, automatic adjustment of
audio level, dynamic range compression, audio compression, consumer audio products, electronic device,
circuit schematic, self-construction of electronic gadgets
Contents
1. Introduction
). *rinciple of operation and state of the art
+. Circuit description and analysis
,. *ractical reali-ation
.. Measured results
/. 0sage e"perience and conclusions
1eferences
1 I #as in doubt if this #or #as #orth a patent or not, because #hen I designed and built this device (!ust t#o months
ago), some of the solutions that I devised appeared to me, if not absolutely ne#, at least unusual. $hus I spent a fe#
days in an e"hausting search throughout patent databases, to ascertain if these ideas #ere really unprecedented or
not.
$he result of this search #as some#hat surprising. In fact I found three patents (in particular 02,11.3,1 and
02.+41+/5, but also to a less degree 02)44/44+,,44) #ere some solutions similar to those adopted in my design
appear, at least in concept, although #ith a different implementation and in different conte"ts. 6o#ever, #hat(s
really unbelievable for me is that (unless some omissions #ere intentional, but it(s hard to believe) the authors seem
not to have completely understood #hat they did7 In fact none of these patents recogni-e the positive implication of
certain solutions (in particular of one of them, #hich is the basic idea of this #or). It seems that they used certain
methods incidentally, in fact these are not the main focus of the patents and conse%uently they are not highlighted,
nor claimed. $herefore I have reasons to believe that #hat I am going to 8unveil9 you in this document it(s really
unprecedented, and therefore it(s a novelty.
:evertheless it(s also apparent that similar solutions, although unnoticed or not completely understood, already
appeared in the literature, in one form or another. $hat(s #hy, lie in other cases, I e"cluded the possibility of
patenting this #or, and I opted instead for publishing it.
!e"ruary #$%& (Last revised 'ay #$%&) (age % of #$
1. Introduction
;o you listen to music< ;o you have a hi'fi system #ith multiple sources<
Are you tired to ad!ust the volume pot every time you change station on your tuner, or commute the input of
your amplifier from C; to tape, or to a digital $= and radio receiver (;$=), or to the A0> input, #here you
connected your *C to listen to #eb radios<
?es, because, as you no#, each source has its typical signal level, and this is different for each one of them7
;o you #ant to listen to that tal sho#, or to that conference, #here one speas loudly and the other one
softly, #ithout missing a #ord<
Are you disturbed each time a commercial brea in loudly and forces you to reduce the volume<
;o you often mae records of music or movies, so that you have every time to ad!ust the optimum recording
level, to avoid clipping yet maintaining the best 2@: ratio<
&r do you even have, lie me, a modulator and a transmitter, to broadcast on cable your music to every room
of your house< In this case the amplitude of the input signal to the modulator #ould be yet more critical.
If your ans#er is yes to some of the above %uestions, then this device can simplify your life, maing your
listening e"perience more en!oyable.
0nfortunately it(s not an off the shelf product, I don(t no# of any consumer product #ith similar
characteristics. Aell, there are pro or semi'pro instruments #hich do audio compression, but #hat could be
useful is simply to add automatic gain control (AGC) to our hi'fi system, to obtain a nearly uniform audio
level from all sources.
$his device performs AGC for our audio system, i.e. it does something very similar to #hat #e do by
manually ad!usting the volume pot of our amplifier, or the recording level of our recorder, each time that #e
change source, e"cept that it does this automatically, precisely and %uicly.
I don(t no# #hy this function is not provided in standard consumer audio systems, perhaps because there is
the (#rong) belief that an AGC must necessarily alter too much the dynamic range of the original source,
introducing un#anted artifacts B1CD, lie 8pumping9 up and do#n the sound level in short term cyclic gain
variations (something referred also as 8breathing9), rising hiss during %uiet passages, distorting or maing
the sound 8duller9 by limiting the peas, etc.
Aell, I thin that all these defects can be eliminated by a proper design of the AGC circuit. I had the
ob!ective of avoiding all the above inconveniences in designing this device and, thans also to some original
solutions, I can tell you that I am very much en!oying the prototype that I built for myself.
I tested it #ith every ind of audio source, even #ith the most challenging passages of classical music, and I
could not perceive any audible difference in sound %uality bet#een the original signal and the one regulated
by the AGC (the device obviously has a bypass button, to e"clude it and listen directly from the original
source).
In fact the device can operate to preserve at most the dynamic range of each source, adapting the gain
#ithout introducing distortion, very much resembling manual level ad!ustment, nevertheless it can also
provide enough compression of the dynamic range of the source, if desired. $his can be useful particularly
#hen #e listen to spoen parts, rather than to music, because compressing the dynamic range enhances
speech intelligibility.
0sing a professional audio compression module for this tas it(s a sort of overill, for the problem at hand.
$hese instruments are designed for musicians and professional audio recording or broadcasting studios,
therefore they are e"pensive, they do not connect simply to a consumer hi'fi system, and they are difficult to
use, #ith a lot of settings to be ad!usted to obtain a good result, they cannot provide simplicity of use, thus
they don(t do the same !ob of this much simpler gadget.
6o#ever, if you no# about electronics, and you are an hobbyist, you can build this device yourself.
Everything you need to no# is e"plained in this document. $he electrical schematic of the circuit is
presented and discussed in detail, #ith an in'dept discussion of all relevant technical aspects, so that you
should recogni-e #hy certain original solutions adopted here can offer superior performance, #ith respect to
other no#n approaches.
!e"ruary #$%& (Last revised 'ay #$%&) (age # of #$
*ictures of the reali-ed prototype are sho#n and many practical suggestions for reali-ing the device #ithout
problems are given.
$he device can be built #ith %uite common parts, most of #hich can be found, at no cost, in old $= sets,
satellite receivers, recorders, etc., destined to recycling.
6ere you see a picture of the reali-ed prototype (Fig. 1).
Fig. 1
It(s that thing #ith the #hite cover placed over the cassette dec. Actually this latter is used !ust as a level
meter, for visual indication and to ad!ust the input level to the amplifier, to the modulator and to the 8Gine'
in9 input of the *C for digital recording purposes (I don(t use anymore the cassette dec recorder). 0ntil a
fe# days ago I had to ad!ust the 81EC GE=EG9 pot almost every time after changing source, no# I have
regulated it at the optimum level once and for all, thus I don(t touch it anymore, so that listening to many
sources is no more an hassle for me.
(Hy the #ay, you may have noticed that the case of the AGC module is recycled, in fact it #as the case of an
obsolete A;2G modem, I placed the AGC prototype inside it7 Ahat #as the bac of the modem no# it(s the
front of the AGC module. $he case offers perfect shielding and re%uired little mechanical #or for placing
all the components I)
!e"ruary #$%& (Last revised 'ay #$%&) (age ) of #$
$he ne"t figure (Fig. )) sho#s a (partial) scheme of my audio system and ho# I connected the AGC device
to it.
Fig. )
If the 8$A*E M&:I$&19 button is pressed, the amplifier sends to the speaers the signal processed by the
AGC. $he FM modulator, the =C1 (#hich is no# mainly used as an A@= repeater) and the input line of the
*C al#ays receive the processed signal instead (unless the bypass button of the AGC is pressed), via the lo#
impedance 8*6&:E29 output of the stereo cassette dec.
Hecause my e"perience #ith this gadget is so positive, I thought to share this result #ith you, publishing this
document.
!e"ruary #$%& (Last revised 'ay #$%&) (age & of #$
. !rinciple of operation and state of the art
$he device follo#s a feedbac design scheme, as used in AGC B1D and audio compression systems B)D. Its
conceptual and functional scheme is outlined in Fig. +.
Fig. +
$he input signal =
in
is fed to a =oltage Controlled Amplifier (=CA), #hose gain is proportional to the control
voltage =
Gain
. $his latter is determined by a feedbac chain composed of a series of functional modules. $he
first module is a Gevel detector, #hose output is proportional to the ma"imum level of the output signal =
&ut

(the pea level in our case). A lo# pass filter follo#s B+D, #hose purpose is to average and smooth the signal
of the previous stage, so that its output is proportional not to the instantaneous pea level of =
out
, but to a
short term moving average of it. $his measure is more correlated #ith the perceptual sensation of sound
intensity B,D. $he output of the filter is stored in a short term volatile storage, so that memory of the recent
level reached by the output is retained. $hus the regulation of the =CA is not immediately adapted to
changes of the output level, but only after a reasonable time. In this #ay a suitable amount of the original
dynamics of the input signal is preserved. $he stored signal is faced #ith the reference =
1ef
,#hich represent
the desired, 8ideal9 level of the output, and the difference bet#een the reference level and the currently
stored level is fed to an error amplifier. $he voltage =
Gain
that controls the =CA is thus proportional to this
error, i.e. the amplification #ill be bigger if the error increases and vice versa, so that the output level is
maintained close the desired level, even if the input level changes a lot over time.
A number of more or less good circuits of this ind, ranging from very basic solutions to moderately
sophisticated ones, can be found on the #eb, e.g. B.D, B/D, B3D, BCD, B)4D.
Most solutions are based on using a FE$ as a voltage controlled resistor, this approach is also used on op'
amp based Aein'bridge oscillators B5D, to stabili-e the amplitude of oscillation, and is also used here.
". Circuit description and analysis
$he schematic of Fig. , sho#s the circuit for one channel only, letJs assume it(s the 1 (right) channel, plus
the fe# parts #hich are shared, or #hich interface #ith the corresponding part of the G (left) channel.
For audio signal processing one HA1.)1C: per channel is employed. $his type of IC is particularly suited
for our purposes, because it features lo# noise, lo# distortion, and lo# offset.
Given the s#itch 21 is in the &: position (the other is the H?*A22 position), the input signal reaches the
non inverting input of IC1a though the coupling capacitor C1. $he input impedance is determined by 11@@1)
to a suitable .,K value. IC1a operates as an input buffer #ith unit gain. It is biased by 1), #hich is
!e"ruary #$%& (Last revised 'ay #$%&) (age * of #$
Fig. ,
connected to the =
L
@) line, so that the output #oring point is set in the middle of the available voltage
s#ing. 1+, on the feedbac path, compensates the voltage drops of input biasing currents at IC1a inputs, thus
minimi-ing the contribution to offset voltage at pin 1, #hich is desirable to be as close to 4 as possible, for
!e"ruary #$%& (Last revised 'ay #$%&) (age + of #$
proper operation of $1 as a voltage controlled resistor. IC1a drives the lo# impedance variable attenuator
made by 1, and the group $1, 1., 1/, of e%uivalent resistance 1f, #hich is the heart of the AGC. $he
impedance of the attenuator is imposed by the characteristics of the employed FE$, a common HF)./
():+C15, ):.,C/, etc.) type. $he minimal resistance, #hen =gs M 4, it(s around 1++N. $he introduced
attenuation is Av M 1f@(1fL1.), thus to achieve a ratio of min@ma" attenuation O 14, to allo# for an input
range of the pea level of all sources of at least )4 dH, a resistance of 1..K has been chosen for 1,. Aith this
value #e have a ma"imum attenuation of P 1) times ())dH), i.e. 1@1) Q Av Q 1.
$he follo#ing stage it(s the output buffer, #hich offers a fi"ed gain of 11 and thus compensates for the initial
attenuation and brings bac the signal to a good level for the follo#ing stages. 15 ensures stability, in case of
high capacitive loads and prevents damage to IC1, in case the output is shorted.
As #e #ill see, the AGC operates to maintain the output level to a sustained 1.3 =p (1.)1 =rms for a
sinusoidal #ave), this means that the signal level =ds, seen at pin . of IC1b and bet#een drain and source of
$1, is typically Q 1., m=, #hich is #ell inside the linear region of operation of the FE$, #hich, employing
feedbac resistors, e"tends to L@'1= #ith Q 4..R distortion B14D. $#o feedbac resistors of ,34K (1., 1/)
have been used, as suggested in the application note B14D.
$he signal at the output is also fed to the base of $), #hich is configured #ith e%ual loads on emitter and
collector. $his configuration is #ell no#n B11D, although seldom used, since the tube age B1)D, and provides
phase splitting. $he signal at the emitter is in phase #ith the input and that at the collector in opposition of
phase. $he circuit provides an almost unit gain at both outputs, provided the input impedance of the
follo#ing stages, particularly at the collector, is high enough to be considered a negligible load, and the hfe
of the transistor is high enough for the base current to be considered negligible, for this reason it(s better to
employ as $) a transistor #ith a high beta, lie the HC.,CC. Care should be taen also to correctly set the
operating point of the transistor, to allo# for ma"imum e"cursion of voltage at the outputs, in order to
accommodate also for large signals before clipping occurs7
$he loads for $) are essentially the bases of $+ and $,, #hich are connected as voltage follo#ers, thus
presenting a high impedance, but biased at interdiction, in this #ay they behave lie rectifying diodes, but
#ith a current gain. 0sing t#o transistors, rather than t#o simple diodes, #e have three advantagesI the first
has been already mentioned, it(s the higher input impedance, the second is that this allo#s for a fast attac
time (as #e #ill see later in greater detail) and the third is that the voltage drop represented by the =be of a
transistor is less variant than the voltage drop of a diode for the same amount of output current variation. In
our case the t#o transistors can sustain a load of less than )44N #ithout problems, and, for their emitter
current passing from 14 uA to 1 mA, their =be has a typical variation of only 144 m=, #hile the voltage drop
of a 1:,1,C diode for the same variation of current is of )+4 m=7
Hut #hat(s all this for< $he group composed by $), $+, $, and associated passive components acts as a full
#ave rectifier. In fact, being the outputs of $) in opposition of phase, one of them #ill al#ays be 8the
positive half #ave9, for any input #aveform, forcing either $) or $+ to conduction, if the pea voltage
e"ceeds the threshold of conduction of the transistors.
$o my no#ledge this solution for maing a full #ave rectifier is unedited, it can be my fault, but I have
never seen something similar
)
. $he concept is old, because po#er supply rectifiers, based on transformers
having a secondary #ith a central tap, do the same thing, but here #e have reali-ed this idea using a phase
splitter rather than an impractical transformer #ith a central tap. $his solution is also some#hat simpler than
one of the classical versions #hich employ at least t#o op'amps and t#o diodes, plus passive components.
Aell it(s not an ideal full #ave rectifier, it(s affected by the threshold of conduction of the t#o transistors, but,
as #e #ill see, this is not an inconvenient in our case, but something that #e can e"ploit7
It is #orth noting that most published pro!ects, employ a much simpler solution for detecting the signal level.
2ome use crude half #ave rectification, #hich may provide an incorrect result for asymmetric #aveforms,
moreover doubling the attac time for the same time constant of the lo#'pass filter #hich follo#s.
) At the time of my first #riting and #hen I designed the device this #as certainly true. 6o#ever (as cited in :ote 1) I
recently discovered that something similar is sho#n in patent 02,11.3,1, although the author implemented the
phase shifter differently, using t#o transistors and a more complicated bias scheme.
!e"ruary #$%& (Last revised 'ay #$%&) (age , of #$
&thers employ t#o diodes connected as a half'#ave voltage doubler (Fig. .).
Fig. .
$his solution responds both to positive and negative peas, but its result may not be so good7 In fact, even
considering a sinusoidal input and an ideal input source #ith 1gM 4, the circuit has an intrinsic rise time B1,D,
#hich in our case has the effect of lengthening the attac time. $hings get #orse if 1g O 4 and C) Q C1 (lie
it(s often seen), because the effect of the load 1
G
becomes greater B1.D. If 1g and 1
G
are not negligible, the
rise time #ill re%uire a greater number of cycles for an increasing input fre%uency (and #ith arbitrary input
#aveforms the result is even less predictable). Moreover the ripple is at input fre%uency, not at double the
input fre%uency lie in a full #ave rectifier, thus re%uiring greater filtering of the output. For all these reasons
I thin that the solution adopted here is better.
$he load of $+ and $, is the 1C lo#'pass filter made by 115L1)4 M 1 and the total capacity of
C5LC14LC11 M C. $he reason for using three capacitors rather than only one is that it(s possible in this #ay
to select the capacitors so that the total capacity #hich is used in the t#o channels is about the same,
overcoming the difficulty of finding electrolytics #ith lo# tolerance values. In my case I #as able to arrange
the triple for both channels #ith a tolerance Q )R7 In case your multimeter is not capable of measuring
capacities O 144 uF, lie mine, simply measure each capacitor one by one, and use another fi"ed 144 uF
capacitor placed in series during the measures.
$he output of the filter is the voltage =c across the capacitors, #hich, recalling the bloc scheme of Fig. +,
represents the detected signal level, used for regulating the attenuation Av abovementioned, in order to
maintain a nearly constant output level.
$he large capacity of +44 uF is used to allo# for a very long 8release time9 of the AGC, as #e #ill see. $he
time constant S M 1TC of the filter determines instead the 8attac time9 of the AGC.
In the prototype I have set S at about .+ ms, regulating 1 M 133N. $he shorter S the faster the output =c of
the filter #ill react to input signals. If #e mae S very short, e.g. using a very small capacity C, the circuit
#ill behave lie a pea detector, i.e. $+ and $, #ill be able to charge the capacitor to the pea value of the
signal even for short burst of sound, #hile, maing the time constant longer, only sustained sounds #ill be
able to charge C at, or very close to, the pea value. Hecause an increase in =c causes a decrease of Av, it is
not good to have abrupt changes of Av at every sound pea, because this #ill introduce audible distortion. I(s
thus better to have smooth variations of =c, even if the input changes abruptly #ith a burst of soundU this #ill
preserve sound fidelity, at the cost of occasionally e"ceeding, for very short intervals, the ma"imum
desirable pea value at the output. $his can be done by increasing S, thus decreasing the cut'off fre%uency of
the lo#'pass filter. &n the other hand #e cannot mae the time constant too big, because this #ould mae the
reaction time of the level detector so slo# that #e #ould be able to perceive the e"ceeding loudness during
the bursts of sound and the subse%uent reduction of amplitude operated by the device. 2etting the optimum
time constant it(s thus a choice of compromise. $he authors of the various pro!ects published in the #eb have
set this parameter to values ranging from as lo# as 1 ms to about 4.+97 I made a conservative choice in favor
of a relatively slo# attac time. I left S set at .+ ms after having tried values of appro"imately )44 and 144
ms. A time constant of )44 ms #as clearly too big, #hile setting the value at 144 ms #as satisfactory. $he .+
ms setting sounded as good as 144 ms, #ith no audible distortion, but #ith the advantage of eeping the
output more regulated, #ith no perceivable e"cess in loudness, even during the most critical passages of
classical music. I haven(t tried smaller values because I didnJt see the necessity for doing that and because,
even before introducing audible distortion, lo#er values #ould necessarily alter the original sound 8color9 to
a greater e"tent. If you #ant to eep things simple you may thus do the same choice as me and !ust place a
1C4N resistor in place of 115 and 1)4, other#ise you may #ant to e"periment #ith lo#er values, or
substitute 115 and the trimmer 1)4 #ith three resistances and a commutator, to set fast, mean and slo#
attac time as desired (lie I did for the release time, as #e #ill see belo#). $hree 51N resistors could
!e"ruary #$%& (Last revised 'ay #$%&) (age - of #$
perhaps be a good choice for this purpose.
I don(t have an oscilloscope to ascertain the real behavior of =c at attac time, but I tried to speculate #hat
may happen in a simple e"emplar caseI the sudden step from silence to a strong sinusoidal #ave e"ceeding
the ma"imum desirable output level. $he e"ample assumes S M 1, and a fre%uency of the incoming signal OO
1@)VS (the cut'off fre%uency of the lo#'pass filter). Aith the advertence that the %uantitative aspects of this
speculation may be very much appro"imated, and thus mainly the 8%ualitative9 aspects should be taen into
account, #hat may happen should resemble #hat depicted in Fig. / (I made this and other studies presented
here using some standard graphics tools and Graph B13DU I tae the occasion to acno#ledge the author).
Fig. /
$his behavior seems reasonable. If this speculation resembles reality, in this e"ample it taes P 1..S to
achieve a regulated output belo# L1.C dH of the final value and P ).)S belo# L1dH. $his could be a more
precise #ay to define the attac time, and seems to !ustify, in our case, a conventional assumption of the
attac time as )S.
It also appears clearly that a full #ave rectifier contributes a lot in reducing the attac time. Also the
e"ponential increase of =c seems appropriate, because most of the gain reduction is actuated as soon as the
perturbation starts, but at the same time #ithout introducing distortion
+
.
+ $herefore this solution seems advantageous #ith respect to using a linear step#ise increment of =c at attac time,
lie most of ancient and recent digital systems do (e.g. see the already cited patent 02)44/44+,,44) .
!e"ruary #$%& (Last revised 'ay #$%&) (age . of #$
Hut let(s advance in analy-ing the schematic of the device. After the capacitors of the filter #e find $. and
$/, configured as a current mirror. $heir function is to slo#ly discharge the capacitors C5, C14, C11 (let(s
call them C for sae of brevity). $he capacitors C represent an analog memory that store =c, #hich, as #e
have seen, is the detected ma"imum level of the output signal. Aithout $. and $/ this 8memory9, the 8short
term storage9 of Fig. +, #ould last too long. In fact only the tiny base current of $3 (Q , nA) and the leaage
currents #ill contribute to discharge C. Although, in general, electrolytic capacitors may have a non
negligible leaage current, good capacitors usually have a very lo# leaage current. $o build up the total
capacity C, I used some 3'C year old, 144uF capacitors e"tracted from a not #oring *C motherboard.
$esting the leaage current of each capacitor at 1) =, #ith my $E:MA 3)'33,. multimeter, I #as not able to
measure it, this means that the current should be Q /4 nA, other#ise, #ith a resolution of 4.1 uA, I should
have seen some blining of the least significant digit, isn(t it< Moreover the leaage current at 14R of the
operating voltage can be as lo# as +R of the leaage at rated voltage B1+D, thus #e may have values of P.nA
for the total leaage of C. $hen #e should tae into account the leaage of the reversely biased EH !unctions
of $+ and $,, plus the biasing current of $3. In the realistic hypothesis that all discharge currents sum up to
14 nA, as Wt M W=TC@I, #e #ould need to #ait +4449 (i.e. .4() for a variation of =c of only 144 mv7
2uch a persistent memory is clearly too long lasting. $his means that the AGC #ould regulate the output
#ith a gain set for a certain input source, #ith a certain level, #hen in the meantime the situation may have
completely changed. $here is thus the necessity, after a reasonable time, to 8forget9 old situations, if #e #ant
that the AGC automatically adapts to the ne# ones. $his 8reasonable time9 is #hat is called the 8release
time9 of the AGC.
I thin that not only the time for erasing the memory is important, but also the pace of this process7 $his is a
very important issue #hich can influence dramatically the performance of the AGC, but #hich is very much
neglected. In fact, all of the schematics that I have seen
,
, including integrated solutions B15D, simply use a
resistor for discharging C. $his implies that the capacitor is discharged #ith an e"ponential la#, but this is
not good at all7 In fact, as #e #ill see, an e"ponential decay of =c causes a proportional e"ponential decrease
of =gs, #hich increases the total gain A of the audio chain too soon.
Fig. 3
, $his #as #ritten after the reali-ation of the prototype, before discovering the patents already cited in :ote 1.
!e"ruary #$%& (Last revised 'ay #$%&) (age %$ of #$
Get(s anticipate here one of the measured results obtained #ith the prototype. $he la# of variation of A as a
function of =gs, has been e"perimentally determined and is sho#n in Fig. 3. Considering this response, it(s
easy to deduce that, if #e start from a condition of strong input signal, #hich forces =gsM4 to obtain
ma"imum attenuation, and then a %uiet passage follo#s, the initial %uic decrease of =c, typical of an
e"ponential decay, as sho#n #ith the red line in Fig. C, #ill also cause a %uic increase of A.
;espite a large time constant for the release time, this la# of variation #ill cause the gain of the AGC to
increase too %uicly, rendering this %uite passage at an unnatural levelU also the noise floor #ill raise %uicly,
causing the phenomenon of audible hiss cited in the introduction.
Fig. C
Get(s see #hat happens instead if #e impose a linear la# of variation for =c (#hich is represented by the
green line in Fig. C) and conse%uently for =gs. Gooing at Fig. C, #e see that, at the time the value of the
linear la# halves, the value of the e"ponential la# is reduced to less than 1@14 of the total e"cursion. In
practical terms this means an increase in gain of . dH #ith the linear la# and of about 1C dH #ith the
e"ponential la#7 $he e"ponential la# implies that most of the gain change occurs at the beginning of the
release time, #hile for the linear la# it(s the opposite7 A linear la# #ill thus preserve much more of the
dynamics of the original signal, particularly in the first part of the release time. Aith a linear la# the AGC
#ill ade%uate its gain mainly at the end of the release period, in case no other strong signal arrives in the
mean#hile. $his #ould probably be the case #hen #e s#itch from a strong source to a #ea one, and this
seems to me a more correct and 8intelligent9 behavior of the AGC.
$his argument e"plains #hy $. and $/ are configured as a current mirror. $o linearly discharge a capacitor
#e need to dra# a constant current from it, this is e"actly #hat $/ does7 $he current of $/ is imposed by the
current in $., #hich is set by the resistance net#or 1)1..1)/. $he trimmer 1)) balances the currents of
corresponding $. in the 1 and G channels, in order to have nearly e%ual release times for both channels. In
case of a perfectly symmetric correspondence of component characteristics, the voltage across 1)+ #ould be
e"actly =
L
@), in practice #e have to compensate for the resulting total unbalance of the t#o circuits.
!e"ruary #$%& (Last revised 'ay #$%&) (age %% of #$
Assuming the central pin of the s#itch 2) (connected to 1)+) is appro"imately at =
L
@), by selecting a total
series resistance of 14, )4 or +4MN, #e can set a discharge current of .,., )3).. and 1C) nA for $. and
conse%uently for $/ collector. In any case these values are much greater than the total estimated leaage
current of 14 nA.
$he voltage =c is fed to the base of $3. 1ecalling Fig. +, this is the input of the error amplifier, #hich also
sets implicitly the voltage reference. In fact #e can #rite this relationI
=c P ma"(=pL, X=p'X) ' =be1 QM =be) L =e
#here =pL and =p' are the positive and negative peas of the signals, =be1 is the base'emitter voltage drop
at conduction of $+ and $,, =be) is the base'emitter voltage of $3 and =e is the biasing voltage at the
emitter of $3. Arbitrarily setting =e M 4.//=, the above relation impliesI
ma"(=pL, X=p'X) QM =be) L =be1 L =e P 4..) L 4..) L 4.// M 1.3=
thus this is the detected output pea level that the AGC #ill eep nearly constant.
Hy changing the reference voltage =e #e are able to increase or decrease the output level. In our case 1.3=
seems a suitable value, it corresponds to the output level of a strong but not e"aggerated source, i.e. #ell
above the noise floor of subse%uent stages, and thus capable of delivering a high 2@: ratio to the speaers,
but #ithout introducing appreciable distortion.
$he 4.// volt reference contribute to diminish the influence of variations of =be1 and =be) in the e%uation,
but, to stabili-e further the output level, =e is temperature compensated, #ith the help of ;) and ;+.
In fact =e M =r Y )T=d. At the operating current of P +4 uA, #e can estimate a change in =d of '1.5 m=@ZC,
thus =e increases of L+.C m=@ZC, #hich compensates the decrease of =be)L=be1, conse%uently
=be)L=be1L=e sums up to a nearly constant value, over a #ide domain of ambient temperature.
Assuming a variation of =c of '144 m= (#hich should reflect a similar variation of =p at the output,
corresponding to '4..+ dH over 1.3=) for passing =gs from 4 to '+.5= (#hich seems to be the typical cut'off
voltage for $1, i.e. =gs'off), an average leaage current of 14 nA, and a 4.55 gain for the current mirrors, for
each position of 2), #e #ill have a correspondent release time of .,./9, 1439 and 1.C9 ()( +C9), #hich seems
%uite good for our purposes.
$he shorter period should be suitable for listening to spoen parts, #hich re%uire, not to compromise
intelligibility of #ords, a %uic adaptation of gain upon changes in loudness of the speaers, the longer
period instead is suitable for classical music, characteri-ed by a large dynamic range spanned in long
intervals of time, #hile the intermediate period should be best for pop music, a good compromise bet#een
the re%uirement of preserving the dynamic range of each song and of adapting the gain to level changes from
one song to another.
*lease note that these are very long release times, compared to #hat is normally seen in published pro!ects.
2hort release time and e"ponential decay la# may be responsible for most of the AGC defects lamented by
their detractors.
Aith the introduction of a linear la# of decay, #hich is probably the main innovation of this pro!ect
.
, and the
adoption of relatively long release times, I believe that most of the inconveniences of former AGC solutions
has been overcome.
. In reality here applies #hat I #rote in :ote 1. As #e have seen, a linear la# implies the use of a current sin (or
source), something #hich is not customarily done.
6o#ever in 02,11.3,1 a preferred embodiment is described #here the discharge of the storage capacitor is
provided by a current sin. Hut this fact is left as a neglected detail, no comment on it7
Also in 02.+41+/5 a linear decay is used, but apparently in an incidental #ay, because the positive implications of
this design are not highlighted, nor claimed. 6o#ever an array of current sins is used for discharging the storage
capacitor, #ith the purpose of varying the attac or release time, something that the authors could have done also
using an array of resistors, because the reasons of their choice are not e"plained. :evertheless the authors #roteI
/0he e1ternal capacitor 2 is constantly "eing discharged "y a programma"le current sin3 2 0he slow current
drain 2 allows for a slow linear voltage decay as compared to the e1ponential decay caused "y the discharge
resistor in prior art circuits4.
Finally in 02)44/44+,,44 a digital AGC implementation is presented, #here a 8linear staircase decay9 (thus
resembling a plain linear decay) is used at release time. Hut also here the advantages of using a linear la# of decay
are not mentioned. $herefore, although the solution presented here has some similar precedents, and thus it(s not
patentable, it appears that the recognition (or should I say the discovery<) and the e"plicitation of its advantages, as I
made here, it(s a novelty, #hich should imply a reconsideration of this solution in future pro!ects.
!e"ruary #$%& (Last revised 'ay #$%&) (age %# of #$
It is #orth noting that, #hen s#itching from a high level source to a lo# level one, the device #ould tae the
entire release time for adapting the gain to the ne# source, ho#ever, if #e #ant a sudden adaptation, #e can
push the reset button 2+, #hich has the effect of %uicly discharge the storage capacitors.
$3 and $C are connected as a high'gain dc coupled amplifier. In fact $3 is a )2C1))) type, characteri-ed by
a high current gain even at very lo# collector current, the load at the collector, given the very high value of
1)C, is substantially e%uivalent to hie of $C, then, in operating conditions, the resistance 1f of $1 #ill be lo#
(Q +K), thus the e%uivalent output load of $C is 1
G
P 1.@@1/M)+.K, #hich is a high resistance.
;, rises a bit the biasing voltage of $C emitter, so that $3 is able to drive $C to interdiction. $he dynamic
resistance of ;, at the operating current (P144 uA), is negligible (P /). N), compared to the resistance at the
collector. $herefore $C is #ithout appreciable negative feedbac. Also the total resistance 1e seen at the
emitter of $3 doesn(t provide sufficient negative feedbac. In fact it turns out that the total gain of $3 plus $C
(#hich, as a result of some measures, should be P 1444), is too high for the feedbac loop of the AGC. An
e"cessive gain implies that the response curve of the AGC becomes too flat, variations of the output level,
and conse%uently of =c, are limited to a fe# millivolts, thus long release times #ould be impossible to
reali-e. $5, 1+4 and 1+1, serve the purpose of overcoming this problem. $hey introduce additional negative
feedbac, so that the overall gain of the error amplifier (made by $3, $C and $5) can be reduced to the
desired value (i.e. =gs'off@144m= P +5). $5 is a high current gain emitter follo#er, #hich copies the output
of the error amplifier (the collector of $C) introducing a negligible load, 1+1 then applies a negative
feedbac to the emitter of $3. In this configuration the gain of the amplifier #ith feedbac can be grossly
estimated as Af P 1 L 1+1@1e, #here 1e is the e%uivalent emitter resistance of $3, given by 1)5@@()T1dL1r),
1d is the differential resistance of the diodes at the operating current and 1r is the resistance seen from the
central pin of trimmer 1+,.
An e"act calculation of 1+1 is %uite complicated, because there are many interfering effects to tae into
account. $he e"act value of the open loop'gain of $3 and $C should be determined, as #ell as the variation in
the implicit reference level caused by an increase in =be of $+, $,, $3 #hen also the output level increases,
plus the e"act value of the e%uivalent resistance 1e at the emitter of $3 should be calculated.
For a common 1:,1,C diode, from the given characteristic curves, #e can estimate 1d P 1..K at +.uA, but
this is a %uite appro"imate estimate, moreover the current through ;) and ;+ diminishes as the output
increases, thus 1d of the diodes increases, causing the gain of the error amplifier to become smaller, and the
variation over the entire operating range of )3..+/ uA may be non negligible. Ae also have 1r, #hich
obviously varies #ith regulation of the trimmer7 Although a value of 1r P14.,K can be predicted for having
=rM1.3/= at the central pin (I save you he details of the calculations), a substantial difference, determined by
variability of component characteristics, may arise in practice.
For all these reasons the value of 1+1 has been determined e"perimentally, choosing among the standard
values. A value of +54K gave the best results, in substantial agreement #ith the desired variation of =c.
$he range of currents flo#ing in the main paths of the circuit are reported in the schematic. It is interesting to
note that, as the voltage at the collector of $C rises, the current in $5 also diminishes, approaching 4,
therefore also the current flo#ing from the base of $5 approaches 4U nevertheless even a very small current
may cause =gs to go positive for a fe# m= (e.g. a tiny )4nA current, flo#ing though )+.K, causes a drop of
,.3 m=). Although the FE$ $1 can sustain a small positive bias of the *: !unctions #ithout damage B1,D,
there is no purpose for having =gs O 4, so it(s better to avoid to operate $1 in this region. $he diode ;., as
long as =d Q =be (#hich is true for most diodes at operating currents around ) uA, lie in this case, ho#ever
the use of a lo# voltage drop diode is recommended here, as selected common type or a M*G4/[ type),
starts conducting before the emitter of $5 goes to =
L
@) L =be, thus $5 becomes interdicted before its base
voltage goes O =
L
@), so that =gs is effectively limited to be QM 4. $he connection of the collector of $C to the
gate of $1 closes the control loop.
$he device re%uires a single L1)= po#er supply, only about 1).. mA are dra#n. C. is placed at the =
L
input
for further filtering and decoupling. $he =
L
@) voltage, re%uired for biasing the op'amps and $1, is derived
from a simple resistive divider. $he current dra#n from the the =
L
@) line is Q ,+ uA, therefore, #ith 111 and
11) set at +.5K, the ma"imum voltage variation is Q 'C, m=, so that it can be neglected. $he large capacitors
C+ and C, provide abundant filtering for hum and other possible noise sources.
$he entire circuit is enclosed in a shielded case and po#ered by a small e"ternal L1)= po#er supply. In this
!e"ruary #$%& (Last revised 'ay #$%&) (age %) of #$
#ay #e avoid the introduction of additional hum noise, via parasitic coupling #ith dispersed fields of the
po#er transformer or of po#er lines.
#. !ractical reali$ation
$he prototype has been built on a small C.."3.. cm pre'drilled base. $he disposition of parts is sho#n in
Fig. 5.
Fig. 5
As it can be noted, a large part of the available space is taen by the large +'#ay s#itch 2) (#hich #as once
part of an old $EAC cassette dec). :ote the t#o HA1.)1C: on the left side, the po#er supply capacitors at
the bottom edge, and the battery of 144 uF capacitors on the right side of the picture, close to them #e have
the 1)4 trimmers, to regulate the attac time, and the t#o \$., $/] couples (the current mirrors) on the
bottom'right side. $he trimmer #ith the #hite cap close to the po#er supply capacitors is 1)), and is thus
for balancing the release time of the 1 and G channel. &n the upper'right side #e have the t#o 1+, trimmers,
to regulate the output level.
In assembling the circuit I used a ne#, at least for me, method. I placed all the components on the base,
fi"ing the leads (not the component bodies7), from time to time, #ith a small amount of cyanoacrylate glue.
*olymeri-ed cyanoacrylate glue has in fact e"cellent dielectric properties. $his seems a good alternative to
bending the leads or pre'solder them to fi" the components to the base. &nce terminated the disposition of all
components I #as able to flip the base upside do#n, #ithout the inconvenience of some components
dropping do#n, and solder everything. ?ou may say 8but #hat if you have to dismount and tae a component
out to substitute it or modify it(s position< ;oesn(t the glue mae it difficult or impossible to do so<9. $he
!e"ruary #$%& (Last revised 'ay #$%&) (age %& of #$
fact is that this type of glue is very sensitive to temperature, heated above 1)4Z it looses most of its
mechanical resistance, so that, #ith the help of the solder, it(s possible to dismount components #ithout
e"cessive difficulty, as long as there is not to much glue and you don(t let it to cool do#n again. ?ou may
occasionally have to clean up the holes of the base clogged by the glue to reuse them ho#ever, but, all in all,
I thin that the balance is positive.
Fig. 14
Fig. 14 sho#s the base assembled on the chassis, together #ith the cables (note the small plastic bridge used
to secure them) and the bypass s#itch 21 (#hich comes from the same old cassette dec as 2)). Also this
s#itch #as fi"ed #ith cyanoacrylate glue, #ithout the need to further drill the chassis.
$hen the case #as closed by placing the plastic cover, #hich has an internal metallic mesh, so that the circuit
is completely shielded. $he last step is to mae the e"ternal connections to the po#er supply and to the audio
system. $he final aspect is as sho#n in Fig. 1.
!e"ruary #$%& (Last revised 'ay #$%&) (age %* of #$
%. &easured results
Fig. 11 sho#s the measured transfer response of the AGC #ith a continuous sinusoidal input.
Fig. 11
First of all #e can observe a very close match (#hich goes even beyond my initial e"pectations7) bet#een
the 1 and G curve of response. Ae can recogni-e an initial region, #hich corresponds to a very lo# input
level, #here the AGC in inactive and the device has in effect all the available gain of 11. $hen #e have an
almost flat region, #here the AGC performs its action, #hich e"tends appro"imately from 14, to 1,4, m=,
and a final region, of high input level, up to 1/)4 m=, or slightly more, #here the AGC operates at the
minimum possible gain of 11@1). It is not advisable to operate the device #ith input signals higher than this,
because, !ust passed this level, the voltage =e at the emitter of $3 rises above 1=, $3 is no more able to eep
$C at interdiction, =gs starts gro#ing and so does the gain, so that the output becomes a large saturated
signal7
!e"ruary #$%& (Last revised 'ay #$%&) (age %+ of #$
It(s interesting to -oom'in the flat region, #hich is sho#n in more detail in Fig. 1).
Fig. 1)
Ae note that, #hen the AGC starts operating, there are non'linear effects of the A(=gs) characteristics (the
characteristics of the 1 channel is also sho#n in the graph, superimposed to the response curve), that appear
clearly in the graph. $hese effects are due to the transistors in the feedbac loop that !ust start conducting,
they are all in a nee of their characteristic curves. $he response is probably made #orse by the fact that the
load at the collector of $C is initially e%uivalent to 1/ (not 1/@@13), because #hen =gs is slightly bigger than
=gs'off the resistance 1f of $1 is high, so that the gain of the error amplifier is initially higher than re%uired,
causing a flatter response, #hich the non'linear effects turn into a slightly negative slope7
Fig. 1+
!e"ruary #$%& (Last revised 'ay #$%&) (age %, of #$
$his is not a big deal (in fact #e are taling of a difference of 4.) dH, moreover useful sources are not in this
region, at least in my case), ho#ever, if you are interested in lineari-ing this part of the curve, improving
overall response, a simple 1.K resistor, lie sho#n in Fig. 1+, in parallel #ith $1 #ill probably be sufficient.
$his #ill reduce the ma"imum available gain to 14, rather than 11, but this also should not be a problem,
because even a gain of 14 should be enough for all ind of sources. If you try this let me no# your results.
6o#ever, returning to Fig. 1), if #e fit a line to the measured values #hich e"tends throughout the entire
domain of regulation, #e see that the variation of the 8ideali-ed9 output (the green line) corresponds to 3.
m= rms, i.e. 14/ m=p for a sine #ave, a result %uite in agreement #ith the e"pected 144 m=p e"cursion.
$he response in dH of the device, as sho#n in Fig. 1,, rather than in a linear scale, is even more interesting.
Fig. 1,
Ae can see that the entire useful input range of )).C dH is restricted to a nearly uniform level contained in
^4.3 dH. If #e consider a reduced domain of 'C.C dH to L1.+) dH around the 4 dH level, #hich contains most
of the input sources (at least in my case), the variation of the output level is reduced further to '4.,, L4.) dH,
#hich, IM6&, it(s a %uite good result.
I also measured the ma"imum release time. I fed to the AGC a strong input signal, corresponding to the
ma"imum regulated level, so that =gsM4, then I %uicly reduced the input to the minimum regulated level,
i.e. an input level producing =gs P =gs'off, and I measured the time re%uired for the AGC to bring the
!e"ruary #$%& (Last revised 'ay #$%&) (age %- of #$
output bac to a regulated level. After ad!usting 1)) to match the results of the 1 and G channels (#hich
#ere in origin %uite unbalanced), the release time, as defined above, #as ,)9 and ,19 in fast mode, C/9 and
C,9 in mean mode, 1,C9 and 1+39 in slo# mode, respectively for the 1 and G channel. $here is thus still a
difference bet#een the 1 and G channel of L).,R in fast and mean mode, and of LCR in slo# mode.
2pending more time in t#eaing 1)) I #ould have probably achieved a better match, but this differences are
not relevant in practice.
$hese durations are not far to #hat desired and calculated above. In fact the average difference is '),R in
fast mode, ')4R in mean mode, and '14R in slo# mode. $his difference, #ith respect to e"pected values, is
probably mainly due to the fact that the current mirrors $. and $/ are far from ideal. In fact it(s difficult to
reali-e good current mirrors #ith discrete components. In our case it appears that the current gain of at least
one mirror is O 1, particularly #hen the current is higher. It(s something that may happen if the Ic(=be)
characteristic of $. and $/ doesn(t match perfectly. $his forced me to increase the current of the other
channel, in order to balance them, so that the measured release times are shorter that e"pected. Ae should
achieve better results using $. and $/ from a same substrate, using t#o matched integrated couples or a
matched transistor array (e.g. one $6A$ +44 can provide the t#o matched couples re%uired), but I have used
t#o (much cheaper) discrete transistors recycled from an old analog satellite receiver instead7 (Maybe you
consider this insane, but I have a certain satisfaction in giving a ne# life to old things, reusing them in an
ingenious #ay rather than thro#ing them a#ay.)
Although I tried to match $. and $/ for similar =be and hfe under a specific test condition, this is not a
guarantee for a perfect match, moreover I could achieve only a %uite appro"imate match for the t#o selected
couples.
Another source of divergence are the real values of the passive components 1),, 1)., 1)/ and C5, C14,
C11. Although I tried to match them, lie I said above, some differences #ith respect to ideal values still
arise. Also the real leaage currents are most liely greater than previously estimated. All these
discrepancies, summed together, lead to the measured results.
:evertheless these results are completely satisfactory in practical terms, as already pointed out in the
introduction.
'. (sage e)perience and conclusions
Finally, a fe# #ords on my direct usage e"perience.
First of all I #as positively surprised because the device has not added perceivable noise to the audio chain.
$o say the truth, once I firstly connected the gadget to the audio system, and carefully listening to the output
#ith earphones, a tiny (apparently 144 6-) hum #as audible, but I #as able to eliminate it completely #ith a
cleaner disposition of the cables, avoiding interlacing or pro"imity of signal cables #ith any cable related to
po#er supply, and #ith an additional ground path, !oining the case of the AGC #ith the case of the amplifier.
$hen I must say, once again, that I am very much satisfied #ith the performances of the device. I already
resumed the reasons in the introduction, but let me stress here the absence of audible distortion and of
artifacts, particularly operating the device in slo# mode. &nly #hen listening #ith careful attention to critical
passages, and operating the device in mean or fast mode, it(s possible to note some alteration to the original
dynamics of the music, but faster modes are e"actly intended for producing a certain amount of dynamic
compression of the original signal.
If you build another instance of this device for your personal use, I #ill be glad to hear from you and about
your e"perience
/
. $his #ill be particularly true if you can provide further insight in the functioning of the
device (e.g. because you tested it #ith an instrumentation more sophisticated than mine), if you discover
some errors in this document, if you mae some improvements to the circuit, or if you re'elaborate it for a
commercial version of the device. In this latter case I #ish you success #ith this business and I #ill be
curious to see you version of the product.
/ ?ou can contact me atI glauco dot masotti at virgilio dot it
!e"ruary #$%& (Last revised 'ay #$%&) (age %. of #$
*eferences.
B1D ' Automatic gain control. httpI@@en.#iipedia.org@#ii@Automatic_gain_control
B)D ' ;ynamic range compression. httpI@@en.#iipedia.org@#ii@;ynamic_range_compression
B+D Y Go# pass filter. httpI@@en.#iipedia.org@#ii@Go#'pass_filter
B,D Y A:;C))3@;, 8Compandor Application Automatic Gain Control9, *aul Gee, &: 2emiconductor
###.onsemi.com@pub@Collateral@A:;C))3';.*;F
B.D ' Audio Compression Amplifier @AGC, [im Keith.
httpI@@###.electroschematics.com@5,44@audio'compressor'agc@
B/D ' Automatic Gain Control Circuit, *opescu Marian.
httpI@@###.electroschematics.com@)1+)@automatic'gain'control@
B3D ' Audio compressor, G. Mayes.
httpI@@graffiti.virgin.net@l!mayes.mal@comp@comp.htm
BCD ' AGC amplifier features /4'dH dynamic range, [ulius Foit, August ,, )44., E;:.
httpI@@###.embedded.com@design@analog@,+))545@AGC'amplifier'features'/4'dH'dynamic'range
B5D ' &p Amp Circuit Collection, :ational 2emiconductor, Application :ote +1.
###.ti.com@##@en@bobpease@assets@A:'+1.pdf
B14D Y A:14., 8FE$s As =oltage'Controlled 1esistors9, 2iliconi" application note, 1553,
httpI@@pdf1.alldatasheet.com@datasheet'pdf@vie#@1/133,@=I26A?@A:14..html
B11D Y $ransistors $utorial, httpI@@###.sente".ca@Pmec155.@tutorial@"tor@"tor)@"tor).html
B1)D ' =alve $echnology ' A *ractical Guide, httpI@@###.r'type.org@articles@art'414p.htm
B1+D ' Aluminum Electrolytic Capacitors ' General $echnical Information, E*C&2.
httpI@@###.ele.tut.fi@teaching@ele'+144@l4C45@tehol@oheismat@elo.pdf
B1,D ' $he !unction field'effect transistor ([FE$). httpI@@courses.engr.illinois.edu@ece+,+@!fet.pdf
B1.D ' =oltage multipliers. httpI@@###.allaboutcircuits.com@vol_+@chpt_+@C.html
B1/D ' =oltage Multiplier 1ise $ime, [ohn ;unn.
httpI@@licn.typepad.com@my_#eblog@)411@4+@voltage'multiplier'rise'time'!ohn'dunn'consultant'
ambertec'pe'pc.html
B13D Y Graph ' *lotting of mathematical functions, Ivan [ohansen. httpI@@###.pado#an.d@
B1CD ' Gimiting vs. Compression vs. AGC
httpI@@###.dvinfo.net@forum@all'things'audio@+1,//'limiting'vs'compression'vs'agc.html
B15D Y GM,51C, 2tereo Audio Amp #ith AGC Control
httpI@@###.alldatasheet.com@datasheet'pdf@pdf@5./1)@:2C@GM,51C.html
B)4D ' 2ynthesi-ing an Audio AGC Circuit, *hil Anderson.
###.arrl.org@files@file@`E>_:e"t_Issue@2ep'&ct_)414@AndersonR)42ept'&ct.pdf
!e"ruary #$%& (Last revised 'ay #$%&) (age #$ of #$

You might also like