Tuesday, November 27, 2007

An Audio Preamplifier





Fig. 1 shows a typical single-ended inverting audio amplifier that might be used in low cost amplifiers for medium level inputs such as an electret microphone or as a hi-z headset amplifier. Depending on the quality of the op-amp utilized the circuit is capable of low harmonic distorsion (better than -60db) and depending on the external components and op-amp bandwidth we could obtain 20 to 20KHZ response within +/- 2 db or better flatness.

We present this amplifier to use as an example of analyzing gain and phase with a equation based method using typical math solving software, e.g., Mathcad ™ or Matlab ™.

The closed loop gain can be easily determined using our previous article on the inverting amplifier as

G = - Zf / Zin

Working in the frequency domain we can define the quantity s as

s = j *2*Pi*f

where j is the square-root of -1, Pi is 3.14159…, and f is the frequency of interest.

To simplify the equations we will define the following quantities (refer to Fig. )

Zcb = 1 / (s*Cb)

Zca = 1 / (s*Ca)

which are the impedances of the capacitors Ca and Cb. Then the net parallel impedance of the feedback loop is

Zf = Rb*Zcb / (Rb + Zcb)



and Zin = Ra + Zca

So we can now calculate the value of G versus frequency using one of the math software packages that will handle the complex number calculations.

Now in order to get a gain versus frequency response in practical numerical values that can be plotted in the traditional manner, that is voltage decibels vs. positive frequency, we first find the absolute value of the gain function (again using a software package) as

Gabs = G

Then the gain function can be calculated vs. frequency in terms of decibels as

Gdb = 20* log (Gabs)

and we can determine phase shift vs. frequency if we want to from

P = arg (G)

where arg is called the argument of the complex value of G (vs. frequency) and yields the phase vs. frequency. We will probably want to convert the phase computed above which is in the units of radians to the units of degrees and we would use the following equation:

Pdeg = 180*P / Pi

Using a software package the values computed at each frequency increment can be plotted vs. frequency and the cut-off frequencies, flatness, and phase can be determined from the plot or data generated.

An example of a typical design for a gain of ten amplifier would use a quality op-amp which is available from a number of reputable manufacturers, and a positive and negative supply voltages of at least +/- 3 volts or higher if a larger output signal is needed. The following components are suggested for the gain of ten preamp:

Ra = 1K
Ca = 22MFD
Rb = 10K
Cb = 470PF
I simulated this circuit with a Linear Technology ™ LTC6241 op-amp with excellent results, but as I mentioned a number of quality op-amps that would work are available from a number manufacturers.

Tuesday, November 20, 2007

What Does Feedback do?


How does amplifier feedback help?



Consider again our classical feedback amplifier in Fig. 1. We have the feedback amplifier equation:

Gcl = A / (1 + A * beta)

where Gcl is the closed loop gain of the amplifier with a feedback loop, A is the intrinsic gain of the amplifier (without the feedback loop), beta is the reciprocal of the external loop gain elements for example in the case of the inverting op-amp beta is

beta = Rin / Rf


One effect of feedback that we can calculate is the effect on gain accuracy. We can show that if we differentiate the gain vs. the intrinsic amplifier gain A, we have the equation

dGcl /dA = 1/ (1 + 2A*beta +A^2 * beta^2)

Let’s say that a particular op-amp had an intrinsic gain of 80db. This corresponds to a gain value of 10,000 ! And let’s say that the external gain of the amplifier is 10, or beta is 0.1. Then the above equation evaluates with this data to

dGcl/A = 1/ (1 + 2*10000*0.1 + 100000000 * 0.01) = 1/(1+ 2000 + 1000000) = 0.000001

We see two things from the above calculation. First the closed loop gain sensitivity to the amplifier intrinsic gain is only one part in a million. Second, we can approximate the result with a simple equation:

dGcl/A ~ 1 / ( A*beta)^2

So the larger we can make the product A*beta the less gain error sensitivity we will have.

For another example, in the case of the buffer amplifier with a beta of 1.0 and an intrinsic gain of 10,000, the gain error would only be 1 part in 100,000,000 ! In actual practice, this accuracy is not really achieved because of input offset voltage and bias or offset current errors. But the calculation shows that the great value of the operational amplifier is its insensitivity to amplifier intrinsic gain and that its gain is accurately determined by the external gain elements, e.g., Rin and Rf.

Another effect of feedback is the reduction of some of the distortion that may be generated by the amplifier as long as the distortion is inside the loop of the amplifier and its feedback path. Assume that there is some change in the output of the amplifier that is not the result of the input signal and is therefore an unwanted distortion product of some kind. We want to find out how much the feedback loop will do to correct this output variation, or what is the delta change applied to the input to correct or partially correct the variation? A way to answer this question is to find the derivative of Vin with respect to Vout using our gain equation from analysis of the circuit of Fig. 1. We have that

Vout = Vin * A / (1+A*beta)

or

Vin = Vout * (1+A*beta) / A

and then

dVin/dVout = (1+A*beta) / A

which we can re-write as

dVin = ((1/A) + beta) * dVo

For the large values of intrinsic gain A, we can approximate dVin as

dVin ~ beta * dVo = dVout / (1/beta) = (1/Gcl)* dVout

Here we see that if we have a closed loop gain Gcl of 10, our feedback correction will be about 10% of the output error. So if we had a distortion of 1.0% due to the intrinsic amplifier our net output distortion would be reduced to 0.9% (maybe enough to get our design to meet specifications.) If we have a unity gain buffer, we would have a correction of approximately 100% meaning that we should have almost zero distortion out of a unity gain buffer amplifier with the feedback loop.

Sunday, November 18, 2007

Inverting Amplifier Feedback





Fig. 1 shows an ideal feedback amplifier that represents the inverting amplifier circuit configuration of Fig. 2. The inverting amplifier has similar feedback calculations to the non-inverting amplifier. As a matter of fact the loop gains are identical (A*beta) and this is the quantity that is important to stability.

To calculate the loop gain we need to adjust the amplifier gain with the factor R2/(R1+R2). Ref. Intersil Application Note AN9415.3. Referring to Fig. 1, we calculate A as

A = Ai * R2 / (R1 + R2)

where Ai is the intrinsic gain of the op-amp, R1 is the inverting input resistance or impedance, and R2 is the feedback resistance or impedance. The feedback beta is R1/ R2 for the inverting amplifier so our loop gain calculation is

A*beta = Ai * (R2 / (R1+R2)) * (R1/R2)

Canceling out R2 we have

A*beta = Ai * R1/(R1+R2)

Now we have a similar equation for the inverting amplifier as:



G = Ai / (1 +A*beta)

The stability of the amplifier is governed again by the denominator 1+A*beta. When the denominator is 0, i.e., when A*beta = -1, then we have an unstable amplifier, if the signal is greater than unity (within the bandwidth) of the amplifier. Note that in this case the feedback is shifted 180 degrees in phase so that the feedback is now positive instead of negative. This is why it is necessary to “roll-off” loop gain to less than unity before the frequency is reached where the phase has naturally shifted to the positive feedback condition (as will usually happen if there is more than one pole in the amplifier response.)
Also, when there is more than one pole in the frequency response, the roll-off of loop gain to the unity gain threshold (also called the "cross-over frequency") or less, should begin before the second pole of the response of the amplifier is reached. In the Bode plot of the loop gain vs. frequency this is evidenced by a slope of -20db per decade of frequency at the unity gain cross-over frequency. If this is achieved the amplifier is usually stable.

The closed loop gain for the inverting amplifier is different from the non-inverting amplifier as we noted before. The closed loop gain is

Gcl = -R2/R1























Friday, November 16, 2007

How does op-amp feedback work?


Fig. 1 shows an ideal linear time invariant feedback amplifier where the basic amplifier A (an amplifier with intrinsic or basic gain A) is in a circuit with an ideal negative feedback block B = beta. The circuit is ideal with no time delays and the feedback signal received at the summing node is exactly180 degrees out of phase with the input signal Vin. The feedback therefore subtracts from the input signal Vin --instead of in-phase with the input which would add to the signal strength and be an unstable condition (if A is unity or greater.) In-phase feedback is called positive feedback and is generally not found in op-amp or amplifier circuits but is commonly employed in comparator circuits to provide hysteresis. Vs is the voltage sum of the input signal and the signal A* B = A(beta).

We can now do some simple algebra to find the overall amplifier gain including the feedback.

Vout = Vs *A

Vs = Vin – B*Vout

Vin = Vs + B*Vout

The gain G can be written as

G = Vout / Vin = A*Vs/(Vs + B*Vs*A)

Canceling out Vs from the numerator and denominator (Vs not = 0) we have

G = A / (1 + B *A)

The last equation is the classical ideal feedback amplifier gain equation.

We can use the same equation for op-amps when we equate B with beta. Recall that beta for a simple op-amp circuit is

beta = Rin / (Rin + Rf)

So then we can write from the above that


G = A/ (1+A*(Rin / (Rin+Rf))

Dividing the numerator and denominator be A (A not = 0), we have


G =1/ ((1/A)+Rin/(Rin+Rf))

Now since A is usually a very large value we have an amplifier for which gain is not dependent on A but the external components Rin and Rf:

G = (Rf + Rin) / Rin = 1 / beta

where beta is the quantity for op-amps we discussed in the previous article.

Tuesday, November 13, 2007

What Affects Bandwidth of an Op-amp Cicuit?


How do we relate the various quantities we talked about in the previous article? Fig. 1 above relates the quantities on a gain vs. frequency plot – sometimes called a Bode plot.
The graph shows an example of what a typical plot would look like for any given voltage op-amp. As you note, the maximum gain vs. frequency for the op-amp intrinsic gain is a strong function of frequency, usually falling off at a rate of 20DB per decade with increase in frequency, starting at approximately 10 to 100 HZ. We can extend the bandwidth of our op-amp circuit by actually attenuating the maximum amplifier intrinsic gain using the beta factor to multiply it by a number less than 1. For example if we reduced the gain by the factor beta (A *beta or 60DB reduction), we achieve the target gain of 20DB out to approximately 5KHZ. So larger values of beta reduce gain but increase the flat bandwidth.

Monday, November 12, 2007

What is Op-amp Noise Gain?


The attenuation factor of the output signal at the summing point of the amplifier (the negative input terminal of the op-amp) is called beta (a Greek letter) and is given by the ordinary divider equation as

beta = Rin / (Rin + Rfb)

The so-called “loop gain” (more precisely the open loop gain) is the gain around the loop as the product of the intrinsic open-loop gain of the op-amp itself and the attenuation factor beta, as

Go = A * beta = A * Rin / (Rin + Rf)

For the inverting circuit, the signal gain is given more exactly with a correction factor for the finite gain of the op-amp itself and we can write the corrected signal gain as

Gs = - (Rfb / Rin ) * (1/ (1 + (1/Go))

Looking at the equation above the last one we can see that the quantity Go takes into account the finite gain of the op-amp and the beta factor.

Let the gain correction factor be written as gcf, then we can write Gs as

Gs = - (Rfb / Rin) * gcf

where gcf is approximately 1.0 or a little less than 1.0.
For the non-inverting amplifier, we still have the same value for beta or the attenuation factor from the output to the summing point as

beta = Rin / (Rfb + Rin)

and we will have the same correction factor for signal gain as we had above. Therefore the non-inverting signal gain is given by


Gs_ni = ((Rin + Rfb) / Rin) * gcf


So what is noise gain? Noise gain is defined as the inverse of the beta factor or

NG = 1 / beta

In the case of unity gain amplifier circuits, if we consider the non-inverting unit gain circuit, the noise gain is

NGni = (Rin + Rfb) / Rin = 1 / beta

and Rfb is zero or Rin is infinite, so

NGni = 1 /1 = 1

So the noise gain for the non-inverting amp is 1.0.

For the unity gain inverting amplifier we have

NGi = (Rin + Rfb) / Rin

and Rin = Rfb , so

NGi = (Rin + Rin ) / Rin = 2.0

Therefore the noise gain of the non-inverting amplifier is lower than the inverting amplifier in the unity gain configuration. Why is this important? Because the noise gain will act on the voltage and current off-set errors of the op-amp as well as other op-amp noise sources. For a sensitive low level amplifier circuit we should therefore prefer the non-inverting configuration.

Friday, November 9, 2007

The op-amp summing circuit


The summer circuit of Fig. 1 has a number of applications. We can sum DC signals, AC signals, logic signals, to any arbitrary waveform that is within the dynamic range of the output of the operational amplifier. We can write a simple formula for the action of the summer circuit:

Vo = - RF * ( (V1 / R1 ) + (V2 / R2) + (V3 / R3) + …)

where the Vi’s can be functions of time as well as Vo. We could also generalize the Ri’s into general impedances Zi’s which could be inductors, capacitors, resistors, or combinations thereof. Discussing all of these possibilities is beyond the scope of our discussion.

We should mention however, that the circuit has a number of possible applications such as mixing different signal frequencies, adding or subtracting bits to a logic sequence, reconstruction of time multiplexed frequencies (frequencies must be within the bandwidth of the op-amp), and other applications that may be imagined.

One interesting application is the mixing of two or more frequencies to form a composite signal. For example if we added 1000 HZ, 2000 HZ, and 3000 HZ sine waves we would get a composite signal whose shape would depend not only on the frequencies but also the amplitudes and phases of the individual signals. If the composite signal is analyzed with a fast Fourier transform (FFT), we would find spectral lines for the different frequencies with the spectral amplitudes relative to each signal strength.
The following equation

Vo = -RF * ( (A1*sin(w1*t+p1) / R1) + (A2*sin(w2*t+p2) / R2 + …)

where the w1, w2, … are the radian frequencies and p1, p2, … are the phases.

One interesting case is when all the frequencies to be added are the same but the phases are different. The sum will be a sine wave with a single frequency equal to the original input frequency, but its phase will be the average of the phases of the original input frequencies if the phase differences are small. But the output signal will of course be inverted. Note however, if two signals of the same frequency but have 180 degrees difference in phase, we will have a cancellation effect for the two signals. Relative signal amplitudes of course will have an effect on the sum.

Monday, November 5, 2007

The Integrator and how you can use it


The op-amp integrator is a handy circuit that can be used to produce a linear voltage ramp or measure a capacitance value.

In the circuit of Fig. 1, if we put in a pulse of known time and peak value we can compute some things. First the input current is given by

Iin = Vp / R

If we also know the width of our input pulse, say Tc seconds, then we can compute the value of the capacitance by measuring Vo (if Tc is short enough to avoid pushing the op-amp output to its maximum output.) C is determined from the equation:

C = - (Vp / R) * Tc / (-Vo)

An Ocilloscope could be used to observe the input pulse height and time and the output pulse voltage output to determine the value of C.

In some unusual instances we may wish to measure an unknown resistor value such as a very high value. R can be determined from the equation

R = -(Vp / C) * Tc / (-Vo)

Notice that the output ramp is inverted so we have to use the negative signs to have R and/ or C be positive real values. The time to integrate, Tintg in Fig. 1, is determined by the energy contained in the input pulse and the time constant of the circuit RC.

Saturday, November 3, 2007

The differential amplifier


The differential amplifier is a very useful circuit where it is necessary to amplify either an AC or audio signal that is a differential input-- that is two input lines, neither one of which is ground or common. It can also be used to amplify small DC signals that are of a differential nature such as a strain gage or bridge measurement. Looking at Fig. 1, a circuit is shown that would be suitable for AC signals in the range of 20 HZ to 200KHZ with the component values listed below.
In Fig. 1, assume that R1 and R3 are matched in value and R2 and R4 are matched. Then the gain of the amplifier is

Vo = Vdiff * R2 / R1

where Vdiff is the differential voltage of the signal source. In terms of the two input lines from the differential source, with voltage values of V1 (high side input) and V2 (low side input) relative to ground, the output voltage will be

Vo = (V2 – V1) * R2 /R1

If the resistors are not matched the output will be in error according to the amount of miss-match. The output voltage due to the non-inverting input will be

Vo+ = V2 * ( R3 / ( R3 + R4 )) * (R1 + R2) / R1

and the output due to the inverting input will be

Vo- = - V1 * R4 /R3

The net output will then be

Vo = (Vo+) + (Vo-)

The error in gain can now be computed in terms of the individual resistor values. The action of the differential amplifier is to combine the non-inverting signal with the inverting signal inputs and produce an output that reflects the difference (or sum) of the two inputs multiplied by the effective gain.
If the signal is DC only then the capacitors in Fig. 1 should be removed. Otherwise, the capacitors can be used to couple an AC signal with isolation of the amplifier from the location of the source. High voltage capacitors can be used to provide the required amount of isolation.
For you brave souls out there, below is a list of component values needed to build an experimental amplifier with a gain of ten. The V+ and V- voltages for the CMOS type amplifier should be + or – 5 volts DC maximum. The amplifier circuit should have a pass band from 20HZ to 200KHZ with harmonic distortion of -70DB or lower, according to SPICE simulations. Traces should be kept very short and the power supply rails should be very well filtered to block power supply noise.

List of components:

Op-amp IC LTC6241HV
C1, C2 0.22 MFD
C3 10 PF
R1, R3 10K
R3, R4 100K


The load resistance should be greater than 100 ohms to avoid over heating of the amplifier or excessive output current and likely distortion. Also, although the amplifier is a “rail-to-rail” amplifier, it is wise not to overload the input with large input voltages to avoid “clipping” and distortion.

Thursday, November 1, 2007

What is a Voltage Follower?

The voltage follower is another handy type of amplifier that has a gain of 1.0 (or very close to 1.0 .) This is also called a unity gain amplifier. Why do we need an amplifier that does not increase or decrease the signal level? The reason is that we can buffer a weak current source signal to obtain the same signal level out, but with a strong source that reproduces the original source voltage signal within the bandwidth capability of the amplifier with very good accuracy.
How does it work? Remember the non-inverting amplifier discussed in the previous two articles posted here? If you look back at the previous article and at fig. 1 in this article, you will note that R1 has been removed from the circuit and R2 has been replaced with a short circuit (or sometimes with a relatively low value such as 1000 ohms.) The gain of the non-inverting amplifier was given as

G = ( R1 + R2 ) / R1

In the case of our voltage follower amplifier you can think of R1 as being a very high value and R2 as a very small value. So the gain of the voltage follower is, for example with R2 = 1000:

Gvf = (N + 1000 ) /N

where N is a very large value. In the limit as N approaches an infinite value, the value of R2 at even 1000 ohms is not very significant, so Gvf approaches 1.0 as N becomes larger and larger. Or if we just set R2 = 0 , then we have Gvf = N / N = 1.0.

Note also that we don't have to worry about common mode noise with this circuit unless the external traces are long.

So now we know about the voltage follower. The supply voltage connections are not shown but will be discussed in later articles.