Please see the first link above to see the original circuit and its analysis.
This article examines how to modify the circuit to achieve the following goals.
Design goals: RF attenuation and wider AGC rangeThis AGC circuit by Courtney Hall (WA5SNZ) was originally designed for audio-only. That is, it takes an input signal at audio, amplifies it, then based on the amplified AF output, finally attenuates the original input AF signal to achieve the automatic-gain-control action. The attenuation of the input signal is achieved by using a transistor as a variable resistance. This variable resistance then forms the bottom half of a a voltage divider with the top resistance having a fixed value. The variable bottom resistance formed by the transistor causes more or less of attenuation of the input signal as required.
This article examines how to modify the circuit to achieve the following goals.
- AGC control of RF signals instead of AF signals. The improved circuit should be able to attenuate incoming RF signals (somewhere in the HF range from 2 to 30 MHz), instead of attenuating incoming AF signals. This requires analysis of the frequency response of the attenuator transistor stage, and modification of the transistor's bias.
- Increased range of the AGC action, but without increasing the supply voltage (1.2 volts). This can be achieved by using two attenuator stages in cascade. However, this increases the circuit complexity.
The AGC circuit is planned to be used as part of a single-conversion shortwave superheterodyne receiver. The AGC can control the signal strength at either of the following two locations in the signal processing chain:
- At the very beginning of the chain, to regulate the strength of the RF signal before it enters the first RF amplifier
- Or, after the frequency conversion first stage, to regulate the signal strength at the intermediate frequency, before it enters the first intermediate-frequency amplifier.
In theory the first option would be better, as it attenuates strong signals before they have a chance to overload any of the following stages. The second option has the disadvantage that strong signals are only attenuated after the mixer, meaning that the mixer itself may be subject to overload. However, for a portable receiver with a small whip antenna, signal levels are likely to be low anyway, meaning that either option is probably acceptable.
Design requirements: Only 2N3904s and 1.2 volts
Though many AGC circuits can be found on the Internet, none fits my particular requirements. The primary requirements of my design work are:
- Use only 2N3904 transistors.
- Use a supply voltage of 1.2 volts.
These are simply personal preferences for my own circuit design work. There aren't many commercial radio receiver circuits designed to work off of only 1.2 volts, so for me it is an interesting and lesser-explored design challenge. Practical benefits of a 1.2-volt supply include the following.
- 1.2-volt batteries are physically small.
- 1.2-volt rechargeable batteries and are cheaply and readily available for purchase.
- Use of only one battery for the power supply makes it easy to replace or recharge the single battery. A higher supply voltage would require either multiple batteries or a larger and/or more-expensive battery.
For the current design work, I am willing to accept an increase in circuit complexity -- even a significant increase in complexity -- to keep the design within these requirements.
Behavior of the existing circuit
Regarding the original AGC circuit by Hall, the fundamental design challenge is its operation at the low supply voltage of 1.5 volts. Such a low supply voltage makes it difficult to generate a sufficient AGC control voltage. The variation in the AGC control voltage must be large enough to so that it can generate a sufficiently wide variation in the AGC control current, that is in turn fed into the base of the transistor that is used to attenuate the input signal.
The Hall design is able to achieve a sufficiently wide range of AGC voltage and AGC current, even when running off of only 1.5 volts. But the low-voltage performance of Hall's circuit comes at the expense of circuit complexity; Hall's original 1.5-volt design requires 6 transistors.
Brief review of Hall's original 1.5-volt design
A small supply voltage of 1.5 volts means the AGC control voltage range is limited. A limited AGC voltage range then means that the AGC control current range is limited. A limited AGC control current then means that the base current of the attenuator transistor can vary only slightly. This finally means that the amount of achievable attenuation by the attenuator transistor is limited, which means that the AGC might not be able to sufficiently attenuate a large input signal.
Hall's original circuit is innovative because it uses a low-voltage detector that requires only 1.5 volts of supply voltage, but is still able to generate a wide-ranging AGC control current that can achieve a wide range of attenuation of the input signal. Again, see the first post in this series for details: http://qrp-gaijin.blogspot.jp/2015/09/12-volt-audio-based-agc-for.html.
However, the low supply voltage requires 3 transistor stages to sufficiently amplify the input AF signal to drive the detector. Furthermore, the low-voltage detector requires 2 transistors and 1 diode. The attenuator transistor is the final transistor required in the original circuit, for a total of 6 transistors.
Brief review of my 1.2-volt version of the AGC circuit (generating maximum 50 uA of AGC current)
By replacing all transistors with 2N3904 transistors, replacing the detector diode with a 1N4148, and reducing the supply voltage to 1.2 volts, I could confirm in a hardware prototype that the circuit still operated with good AGC action.
However, the reduced supply voltage significantly reduced the range of AGC control current, and therefore significantly reduced the range of AGC action. By inserting a microammeter in series with the base of the attenuator transistor, I could measure the generated AGC current in the 1.2-volt case and the 1.5-volt case. In the 1.5-volt case, large input signals generated more than 100 microamps of AGC current. But in the case of my 1.2-volt circuit, even very large input signals generated a maximum of only 50 microamps of AGC current. This maximum of 50 microamps also agreed very well with LTspice simulations of the circuit.
This 50-microamp maximum AGC current results in a reduced AGC action compared to the 1.5-volt case. Nevertheless, in practice the AGC action was noticeable and well-behaved in terms of attack time, release time, and subjective judgment of the audible AGC action. Therefore, it was decided to use this functioning circuit as a basis for further improvements.
Improving the circuit
Design process using the LTspice circuit simulator
To improve the circuit and achieve the previously-stated goals, the circuit behavior was again analyzed in LTspice. Since we know that the maximum AGC current that can be generated is 50 microamps, we can divide the design process into two parts.
- Design of the attenuator stages. Assume that we have a detector capable of generating an AGC current from 0 microamps to 50 microamps. Then, analyze the behavior of the attenuator transistor to determine the attenuation in dB, for a given AGC current. Also analyze the frequency response of the attenuation behavior; as we shall see below, the attenuation changes with frequency.
- Design of the detector stages. Analyze the input-vs-output behavior of the detector stages. Determine the required range of input AF voltage, in order to generate the desired range (0 microamps to 50 microamps) of output AGC current.
Given the requirements of the AGC detector and the AGC attenuator, then we can design the rest of the receiver as follows. The design proceeds "backwards" from the AGC detector to earlier signal-processing stages. In other words, the input requirements for the later stages dictate the output requirements for the earlier stages.
- The AF amplifier (preceding the AGC detector) should be designed to provide enough output voltage to properly drive the AGC detector.
- The RF detector (preceding the AF amplifier) should be designed to provide enough output voltage to properly drive the AF amplifier.
- The RF amplifier (preceding the RF detector) should be designed to provide enough RF signal voltage to the detector, so that in turn the detector can provide enough AF output voltage to drive the AF amplifier.
- For a superheterodyne receiver, if we want to apply the AGC action to the signals at the Intermediate Frequency (IF), then above-used term "RF" actually refers to signal processing at the fixed-frequency IF. For example, if we are designing a superheterodyne receiver with a 2 MHz IF, then we need to design a 2 MHZ detector stage and 2 MHz RF amplifier stages according to the above guidelines.
This article will only cover the design of the AGC attenuator stages and the AGC detector stages. Design of the other stages like the AF amplifier, RF (IF) detector, and RF (IF) amplifier will perhaps be covered in a future article.
Analysis and design of the attenuator stages
Let's start with the analysis of the attenuator transistor stage from the original Hall circuit. The variable voltage divider is formed by R1 as the top resistance and Q1 as the variable bottom resistance. The input voltage is applied at the top of R1, and the output voltage is taken at the junction of R1 and Q1. R2 serves to bleed off excess charge from the Q1 emitter, which accumulates due to C1 and C2. Note that the NPN transistor is connected "reversed", with the collector grounded instead of the emitter. This gives better AGC performance due to a lower offset voltage in this configuration (see Hall's original article for details).
Original attenuator circuit behavior
In the below circuit simulation, the input AGC current into the Q1 base is varied from 0 microamps to 50 microamps to observe the amount of signal attenuation. An AC (frequency-domain) analysis is performed, sweeping from 100 kHz to 30 MHz. The results are shown in the following image.
Attenuation increases with increasing AGC current, as is expected.
As previously mentioned, the Hall circuit was designed for attenuation of AF signals. At 100 kHz (extreme left-edge of the graph) and lower frequencies in the audible range, in the case of no AGC current (green line, corresponding to 0 microamps) the input signal is practically fully available with almost 0 dB attenuation. For increasing AGC current, the attenuation steadily increases up to a maximum of almost 40 dB. This is a moderately good AGC range for AF signals.
However, the frequency response of the circuit is not ideal for attenuation of RF signals. At higher frequencies, even with no AGC current (0 microamps), the attenuation increases with increasing frequency. This is due to the parasitic capacitances of the bipolar transistor Q1. These parasitic capacitances provide an alternative path to ground for the RF signals, and therefore reduce the RF resistance of Q1. The lower RF resistance of Q1, in comparison with the fixed top resistance R1, leads to lower voltage at the R1/Q1 junction, which therefore results in increased attenuation (even with no AGC current) at higher frequencies. This is undesirable and will lead to reduced sensitivity at higher RF frequencies.
More uniform attenuation from 100 kHz to 30 MHz
To increase the uniformity of the RF attenuation, we can reduce the value of R1. Then, the lower RF resistance of Q1 will be proportionally less, leading to more uniformity in the frequency response. However, this also means that the range of attenuation that can be achieved is reduced. In the below simulation, we have reduced R1 to 100 ohms. The attenuation behavior is then almost constant from 100 kHz to 30 MHz. However, the range of attenuation has been severely reduced: only about 5 dB of attenuation can be achieved over the full range of the AGC control current. Nevertheless, this approach might be acceptable for an AGC-controlled RF stage. The range of attenuation can be increased by cascading several attenuator stages in sequence, as will be seen below.
Attenuation at the specific frequency of 2 MHz
For a superheterodyne receiver, we can choose to apply the AGC only at the intermediate frequency. In this case, we do not need to worry about the attenuation behavior at all frequencies from 100 kHz to 30 MHz. We only need to worry about the attenuation behavior at the specific intermediate frequency. For example, assume we choose an IF of 2 MHz. Then, if we change R1 to 10k, the simulation shows the following attenuation behavior at 2 MHz.
With zero microamps of AGC current, the input signal suffers almost no attenuation at 2 MHz. Increasing AGC current leads to full attenuation of almost 40 dB -- which is about the same range of AGC behavior as the original attenuator circuit achieved at audio frequencies.
Of course, at higher frequencies the attenuation again suffers the undesired increase in attenuation, as shown below, where the attenuation behavior with R1=10k is plotted from 100 kHz to 30 MHz.
But again, because for a superheterodyne we are interested only in the behavior at the IF of 2 MHz, we do not need to worry about the degraded response at higher frequencies.
Increasing the AGC range by cascading 2 attenuator stages
We can increase the range of the AGC by connecting 2 attenuator stages in cascade as follows. The initially attenuated signal -- attenuated by the R1/Q1 voltage divider -- is then fed into the R3/Q2 voltage divider for further attenuation.
In this cascade circuit, the condition with no AGC current nevertheless results in a small attenuation of about 3 dB. This is undesirable, but the zero-AGC-current attenuation is small enough to be acceptable.
Advantageously, the maximum attenuation has approximately doubled, to around 75 dB, giving an attenuation range from 3 dB to 75 dB, representing about a 72 dB range. This is a good AGC range that should be able to adequately attenuate the majority of signals that are expected (for a shortwave receiver) to arrive into the IF amplifier stage.
Note that we require two separate control currents -- one to drive each of the attenuator transistors Q1 and Q3. We cannot split the small AGC current among both transistors, because the low-voltage AGC detector (when powered by a 1.2-volt power supply) cannot generate enough current to drive both attenuator transistors. Therefore, we require two separate AGC detectors (both driven from the same AF amplifier). This results in a considerable increase in circuit complexity, because each AGC detector requires two transistors, for a total of 6 transistors to implement the AGC: 2 attenuator transistors, and 4 transistors for the required 2 AGC detectors.
If we are willing to cascade three attenuator transistors, then we can achieve a more than 100 dB range of attenuation at 2 MHz from the same 50 microamps of control current -- again, using a separate control current (and a separate 2-transistor AGC detector) to drive each of the three attenuator transistors. The zero-AGC-current attenuation increases to around 7 dB in this case, with the maximum attenuation being about 113 dB, for a more-than-100 dB range of attenuation. The simulation results for the three-cascaded-attenuator case are shown below.
Analysis and design of the AGC detector stages
The second design step (and the last to be considered in this article) concerns the design of the AGC detector stage. One AGC stage requires two transistors: one to sense the incoming AF voltage, and a second one that serves as a voltage buffer and current amplifier, to drive the attenuator transistor.
As mentioned in the previous section, we require one AGC detector stage (2 transistors) for each attenuator transistor. Since each attenuator stage is driven by its own AGC detector, and since each AGC detector is driven from the same AF amplifier, we can consider each AGC detector as operating independently of the other AGC detectors, since they all fan-out from the same AF amplifier and should operate independently and in parallel. Therefore, the further analysis presented below will only consider the design of a single AGC detector, as the behavior should not change even if we add additional AGC detectors that fan-out from the same AF amplifier. Note however that later, when we design the AF amplifier (a topic for a future article), we must ensure that it has enough power to drive all of the connected AGC detector stages.
Again, we know (based on previous microammeter measurements on the physical prototype circuit) that the AGC current ranges from 0 microamps to 50 microamps. The goal of this design step is to determine the required AF input voltage to generate generate AGC currents ranging from 0 to 50 microamps. Furthermore, the generated AGC current must be generated very quickly (on the order of tens of milliseconds), so that the AGC circuit responds quickly to strong incoming signals. A short response time (i.e. a fast attack time) is important to enable the AGC to attenuate strong signals quickly before they have a chance to overload the AF amplifier, and before they have a chance to produce dangerously-loud audio output for the listener.
Required AF input voltage
The below image shows the AGC detector circuit. Q2 and D1 form the detector itself, while Q3 is a voltage follower amplifier that amplifies the current to drive the attenuator transistor Q1. The operation of the detector, whereby C3 accumulates voltage and D1 allows that voltage to further increase the base bias, has already been explained in a previous posting (http://qrp-gaijin.blogspot.jp/2015/09/12-volt-audio-based-agc-for.html).
Here, we are interested in analyzing the input-vs-output behavior of the AGC detector.
In the below diagram, the area within the dotted box represents circuit components that have been omitted. These omitted circuit components must convert the incoming RF signal to an AF signal; that is, the RF signal must be detected. Furthermore, the resulting detected AF signal must then be amplified, to produce the AF voltage that is then fed into the input of the AGC detector Q2. The details of the RF detection and AF amplification do not concern us at the moment. Therefore these components are omitted, and in the simulation, the voltage source V2 generates a sine wave having frequency 1 kHz to simulate the output of the AF amplifier.
In order to measure the input-to-output behavior of the detector Q2/Q3, the amplitude of the signal generated by V2 is varied over a range from 350 mV to 600 mV. The lower bound of 350 mV was chosen somewhat arbitrarily. The upper bound is chosen as the maximum peak AC signal voltage that can be generated by a 1.2-volt supply; assuming the final AF amplifier transistor is biased to have 600 mV at the collector with no input signal, then the collector voltage can swing a maximum of 600 mV in either the positive or the negative direction.
The resulting AGC control current, measured at the base of V1, is shown below.
As can be seen, the maximum possible AGC current -- generated by the maximum Q2 input AF voltage of 600 mV -- is around 50 uA. Lower values of input AF voltage result in correspondingly slower build-up of AGC current and a lower final value of AGC current. At the lowest levels of input AF voltage (350 mV), essentially no AGC current is generated even after 5 seconds.
Attack time of the AGC detector
Although the previous graph shows the input-vs-output behavior of the AGC detector over a time span of 5 seconds, we are actually not interested in the behavior over such a long time span. Instead, we are interested in the AGC detector behavior after a few tens of milliseconds, because for a fast AGC response time (fast AGC attack time) we want a sufficiently-large AGC current to be developed after only a few tens of milliseconds, so that large signals are very quickly attenuated.
By zooming into the above graph we can observe the AGC behavior at the millisecond timescale.
The above graph shows that for the maximum AF input signal voltage (corresponding to the upper-most blue trace), the full AGC current is generated after approximately 80 ms. So we can conclude that the attack time of this AGC detector is about 80 ms, which is reasonably fast.
Zooming in the graph further around the 80 ms mark, we can then more closely observe the input-to-output behavior, shown in the below graph.
The top-most trace in the above graph corresponds to an input AF voltage of 600 mV. Each subsequently lower trace corresponds to an AF input voltage that is 10 mV lower. Therefore, the bottom-most, non-zero trace (the purple trace) corresponds to an AF input voltage of 510 mV. All other traces -- corresponding to AF input voltages between 350 mV and 500 mV -- yield essentially zero AGC current after 80 ms.
Therefore, we can conclude that for an attack time of 80 ms, the input AF voltage that is fed into the AGC detector should lie between 500 mV and 600 mV (but see the next paragraph about delayed AGC). This range of input AF voltages will result in the full range of AGC current from 0 uA to 50 uA. And as we saw previously, by cascading two attenuator stages, each driven with an AGC current of 0 uA to 50 uA, we can achieve an effective AGC range of 72 dB.
Furthermore, input AF voltages below 500 mV will not be attenuated at all. This useful property allows implementing delayed AGC. Delayed AGC means that weak signals are subject to no attenuation at all, whereas strong signals are attenuated. This is desirable, because when listening to weak signals we want no attenuation applied. By designing the AF amplifier appropriately, we can arrange for "weak" signals (for an arbitrary definition of weak) lie below the 500 mV threshold, whereas "strong" signals (for an arbitrary definition of strong) lie above the 500 mV threshold and are attenuated.
Release time of the AGC detector
By slightly modifying the above simulation, we can also measure the release time of the AGC detector. The simulation is modified as follows:
- The input AF signal voltage is varied from 500 mV to 600 mV.
- The input AF signal is cut off (set to zero amplitude) after 2 seconds.
After 2 seconds, with the AF input signal cut off, the AGC control current slowly returns to zero as the bias on the Q2 base slowly leaks off through R3. By measuring the amount of time it takes for the AGC current to drop back to zero, we can determine the AGC release time.
As can be seen in the above graph, after 2 seconds, the AGC control current slowly decreases and drops to zero at about 4 seconds. In other words, after reaching its maximum, the AGC control current takes 2 seconds to recover (drop to zero). So the AGC release time is about 2 seconds.
The AGC release time can be changed by altering R3 and/or C3. However, this will also affect the AGC attack time.
Conclusion and future work
This article analyzed my 1.2-volt version of Hall's low-voltage AGC circuit, and modified the circuit for improved performance at 2 MHz. The results are:
- When using the AGC circuit to attenuate higher-frequency RF signals, to reduce unwanted attenuation in the zero-AGC-current condition, the top resistor R1 of the voltage divider R1/Q1 should be reduced to compensate for the lower RF resistance of Q1.
- 72 dB of AGC range at 2 MHz can be achieved by cascading two input attenuator stages. More cascaded stages can achieve even greater attenuation.
- AF input voltages (fed into the AGC detector) that lie between 500 mV and 600 mV will be attenuated, with 500 mV resulting in almost no attenuation, and 600 mV resulting in maximum attenuation.
- AF input voltages below 500 mV will result in almost no attenuation (over a time span of several seconds). This allows implementing delayed AGC and preventing attenuation of weak signals.
- AGC attack time is around 80 milliseconds.
- AGC release time is around 2 seconds.
Future design work will concentrate on the omitted circuit components in this article: design of the RF (IF) detector and the AF amplifier.
The following additional information will be worked into this article in the future. For now, this is just a brief list of notes.
- Discussion of one AF amplifier driving several fanned-out detectors: the AGC detectors draw minimal current, so a fairly standard AF amp should have no problem driving several AGC detectors.
- Attack time of AGC depends on frequency of input AF signal; higher frequency=faster attack. But for typical AF frequencies (100 Hz to 10,000 Hz) the attack time is always less than one second.
- Onset of delayed AGC is complicated to calculate. An estimate of 500 mV was given, based on the AGC attenuator behavior after 80 ms. However, weak signals generating less than 500 mV AF voltage will still, given enough time, develop an AGC control current that will eventually attenuate the signal. A better estimate can be found by analysis of the 5-second behavior (not the 80 ms behavior) of the attenuator: follow each individual input trace individually to determine exactly the threshold input AF voltage that generates a greater-than-1 uA control current after 5 seconds (where 1 uA is arbitrarily chosen as the smallest AGC current that will begin to attenuate the input signal).
- Transient (time-domain) simulations should be used to double-check the AC (frequency-domain) simulations presented in this article. Transient analyses can capture non-linear effects and distortion and are more representative of the actual behavior of the circuit -- but they take much longer to run.
- The attenuation figures calculated by the above simulations assume that the input impedance of the following stage is infinite and does not load the attenuator transistor at all. This is of course impossible. A too-low input impedance of the post-attenuator amplifier stage will further attenuate the signal and will reduce the range of possible attenuation (because it provides an alternate current path around the attenuator transistor, thereby "bypassing" some of the attenuation effect).
- The suggested strategy -- of reducing the top resistor of the R1/Q1 divider to adapt the audio-frequency attenuator circuit to a good attenuation range at the radio-frequency of 2 MHz -- may not be the only way to improve the 2-MHz response. An additional amplifier stage might be used instead, and simulations are being run to check this. Again, this article presents a simplified view of the AGC by omitting the surrounding circuitry. A future article will include simulations of a more complete circuit, with the eventual goal being to simulate the behavior of an entire AGC-controlled IF strip.