*Square Wave Testing for Frequency Response of Amplifiers*

Square waves are rich in odd numbered harmonics and have a very simple shape that makes it easy to observe frequency response limitations in amplifiers. This note discusses how to use square waves to measure the approximate low and high cutoff frequencies of an amplifier. Amplifiers generally have AC coupled sections that limit the low frequency response and have shunt capacitances either parasitic or intentional that limit high frequency response. This not is divided into two sections –one section discusses the measurement of low frequency response and the other discusses the measurement of high frequency response. In each case we are looking for the low and high frequencies where the power transfer has dropped to one-half the mid-band value.

These are known as the -3dB frequencies or cutoff frequencies.

**Low Frequency Response**

An AC coupled stage acts as a derivative network for frequencies below the series RC cutoff frequency. This will significantly modify a square wave passing through it.

A useful relation that gives the approximate low cutoff frequency based on the slope of the AC coupled square wave is as follows

Fcl = ((Vmax_pp –Vmin_pp) * F) / (Vmax_pp * π)

Where:

Vmax_pp is the overall peak-peak value of the waveform

Vmin_pp is the peak-peak value of the low-points of the decaying slopes

F is the frequency in Hz of the square wave

Π is 3.14159

Equation 1 is reasonably accurate providing the decaying slopes are fairly linear.

**High Frequency Response**

An RC roll-off acts as an integrator for signals above the RC cutoff frequency and this reduces the amplitude of signals roughly be the frequency is above the cutoff frequency.

A useful relation that gives the approximate high frequency bandwidth is derived from the time it takes the square wave to go from one state to the other. Since it is usually difficult to pick the starting point and a fully settled point, an alternative is to measure the time, T10-90, required to move from the ten percent point to the 90 percent point.

For a first order section the high frequency bandwidth, Fc, is:

Fc = 0.35 / T10-90 Eq. 2

Equation 2 also gives good results when there are multiple low-pass sections. For

Equation 2 to be valid the square wave must fully settle as in Figures 8 and 9. As an example the 10 to 90 percent rise time in Figure 8 is approximately 113 μswhich infers a bandwidth of 3.1 kHz –fairly close to the actual bandwidth of 3 kHz.

In application using an oscilloscope you adjust the frequency of the square wave to be low enough so that complete settling exists. The exact frequency does not matter. Then you set the amplitude on the scope display to make it easy to pick out the 10 and 90 percent time points. A good choice is five major vertical divisions peak-peak. Once the amplitudes are set then you should expand the horizontal display such that the rise portion is generally centered on the screen and occupies most of the horizontal width.

Then visually note (probably using a cursor on a digital scope) the point at which the wave has risen one-half division. Visually note again (probably using a second cursor on a digital scope) the point at which the waveform passes though the upper last half division. Then measures the time between these points (if the cursors are in relative time mode that will be easy) and apply Equation 2.

It is left as an exercise for the student to derive Equation 2. It is not hard –just derive an exponential equation for the 10 and 90 percent points and relate the time difference to the cutoff frequency of the exponential which is one divided by two pi times the exponential time constant.

*Square Wave Testing.*

It is perhaps unfortunate that the most common test for stability is to look for 'ringing' on a square-wave test signal. It is instructive to look at some examples, here using a 2kHz square wave input.

The first looks like sustained low level oscillation around 30kHz, while the second looks like damped oscillation at the same frequency. Actually the first diagram has nothing at all added to the square wave, the only thing done was to remove everything above the 15th harmonic. Everything up to and including 30kHz is being reproduced with no distortion, no phase error and flat frequency response. (If possible see 'A check on Fourier' by M.G.Scroggie, Wireless World, Nov 1977. p79-82. His Fig.5 is a better drawn version showing the harmonics and how they add.) The lack of higher frequency components however gives the impression of a serious problem, when in fact the audio frequency reproduction is perfect, and there is nothing at all added or removed in this range. The symmetrical variation of the 'oscillation' amplitude gives a clue to the origin of the effect, but practical low pass filters give a less sharp cut off of high harmonics together with frequency dependant phase shift which will give a different appearance. The suggestion that 'ringing' needs to be minimised is not entirely convincing when even an ideal low-pass filter gives the above result. Using an audio signal with no frequency components above 30kHz instead of the square wave there would be no effect at all from this filter.

The second diagram can also be the result of low-pass filtering, and something similar is often produced by the interaction of output inductors with capacitive loads, which is not related in any direct way to stability. Checking the signal ahead of the inductor may reveal a smooth signal without the 'ringing' effect, though some amplifiers have an output impedance with a small internal inductive component which will add some small effect. The square-wave response shown in the MJR-6 test results shows low level 'ringing' which is estimated at 120kHz. This is close to the expected resonance frequency of the 0.4uH output inductor with the 4uF load capacitance used in that test. Increasing loop gain to the point where the amplifier becomes unstable caused oscillation around 6MHz, as expected from the feedback loop unity gain frequency. This demonstrates that output 'ringing' is generally not related to instability, which can occur in an entirely different frequency range, and unless the input signal includes components close to the LC resonance frequency, or the inductance used is too high, there will be little effect. Leaving out the output inductor to eliminate 'ringing' caused by this LC resonance may seriously reduce the phase margin at higher frequencies with some capacitive loads, dangerously increasing the risk of instability.

A square wave test to investigate stability into capacitive loads is therefore of limited usefulness, and may be seriously misleading. My experience is that amplifiers sometimes have a stable state and an unstable state, and triggering them into instability may need a precise choice of load and input signal, in one case driving the amplifier heavily into clipping and then removing the input signal caused a dramatic latch-up and oscillation effect. Failure to oscillate with just any square-wave input and the usual 2uF test load may be necessary, but is no guarantee of unconditional stability. I also use high level sinewave signals at various frequencies, and look for signs of instability close to clipping as the signal level is adjusted to give different levels of clipping. Going into or out of clipping the loop gain is changing, and so the feedback loop unity gain frequency is in effect shifted over a wide range, revealing potential stability problems over a similar range. To limit dissipation it is convenient to use a toneburst signal for these clipping tests.

In two photos are oscilloscope traces showing examples of clipping behaviour

The first of these is just a single notch when coming out of clipping, and this is typical of latch-up effects rather than instability. In this case it was caused by a bad choice of frequency compensation circuit such that the compensation capacitor charged up during clipping and had to discharge before normal linear operation could return. A change to the compensation arrangement was needed to cure this.

Stability problems generally have a different appearance of the type shown in the second photo. Here a short burst of oscillation occurs when coming out of clipping, but in this case the effect continues long after this as seen from a slight ripple on the trace. A change in the value of the compensation capacitor was needed to remove this effect. The positive and negative clipping look different, which is not uncommon, here the positive clipping appears to include a latch-up effect in addition to the stability problem.

Had I relied only on observations of square-wave ringing with a 2uF load below clipping I would have said there were no stability problems to worry about, and stopped there without doing the necessary modifications.

It is known that the choice of test signal rise-time can often have a great effect on observed 'ringing', and it is possible to claim 'excellent transient response' just by careful choice of the rise-time of the test signal. This was mentioned in one of the Douglas Self articles, "The Audio Power Interface", Electronics World Sept.1997 p717-722.

The low-pass filter used at the input of my own amplifiers helps give a smooth square wave output with little ringing, but it was not included for this purpose. Anyone who still wants to reduce ringing further in the mosfet amplifiers could try reducing the damping resistor in parallel with the inductor, maybe to one ohm.

*Miller's theorem*

*"Thus the apparent input capacity can become a number of times greater than the actual capacities between the tube electrodes . . ."*

In electronics, the Miller effect accounts for an increase in the equivalent input capacitance of an inverting voltage amplifier due to amplification of capacitance between the input and output terminals. Although Miller effect normally refers to capacitance, any impedance connected between the input and another node exhibiting high gain can modify the amplifier input impedance via the Miller effect.

This increase in input capacitance is given by

C_{M}= C (1 - A_{v})

Where Av is the gain of the amplifier and C is the feedback capacitance.

The Miller effect is a special case of Miller's theorem.

**Notes**

As most amplifiers are inverting amplifiers (i.e. Av < 0) the effective capacitance at the input is larger. For non-inverting amplifiers, the Miller effect results in a negative capacitor at the input of the amplifier (compare Negative impedance converter).

Naturally, this increased capacitance can wreak havoc with high frequency response. For example, the tiny junction and stray capacitances in a Darlington transistor drastically reduce the high frequency response through the Miller effect and the Darlington's high gain.

The Miller effect applies to any impedance, not just a capacitance. A pure resistance or pure inductance will be divided by 1 − Av. In addition if the amplifier is non-inverting then a negative resistance or inductance can be created using the Miller effect.

It is also important to note that the Miller capacitance is the capacitance seen looking into the input. If looking for all of the RC time constants (poles) it is important to include as well the capacitance seen by the output. The capacitance on the output is often neglected since it sees C(1 − 1 / Av) and amplifier outputs are typically low impedance. However if the amplifier has a high impedance output, such as if a gain stage is also the output stage, then this RC can have a significant impact on the performance of the amplifier. This is when pole splitting techniques are used.

The impact of the Miller effect is often reduced by using a cascode or cascade amplifier rather than a common emitter. For feedback amplifiers the Miller effect can actually be very beneficial since stabilizing the amplifier may require a capacitor too large to practically include in the circuit, typically a concern for an integrated circuit where capacitors consume significant area.

**Impact on frequency response**

Figure 2

Figure 3

Figure 2: Operational amplifier with feedback capacitor CC.

Figure 3: Circuit of Figure 2 transformed using Miller's theorem, introducing the Miller capacitance on the input side of the circuit.Figure 2 shows an example of Figure 1 where the impedance coupling the input to the output is the coupling capacitor CC. A Thévenin voltage source VA drives the circuit with Thévenin resistance RA. At the output a parallel RC-circuit serves as load. (The load is irrelevant to this discussion: it just provides a path for the current to leave the circuit.) In Figure 2, the coupling capacitor delivers a current jωCC( vi - vo ) to the output circuit.

In order that the Miller capacitance draw the same current in Figure 3 as the coupling capacitor in Figure 2, the Miller transformation is used to relate CM to CC.

This result is the same as *C _{M}* of the

*Derivation Section*.

The present example with *A _{v}* frequency independent shows the implications of the Miller effect, and therefore of

*C*, upon the frequency response of this circuit, and is typical of the impact of the Miller effect (see, for example, common source). If

_{C}*C*= 0 F, the output voltage of the circuit is simply

_{C}*A*, independent of frequency. However, when

_{v}v_{A}*C*is not zero, Figure 3 shows the large Miller capacitance appears at the input of the circuit. The voltage output of the circuit now becomes

_{C}

and rolls off with frequency once frequency is high enough that ω *C _{M}R_{A}* ≥ 1. It is a low-pass filter. In analog amplifiers this curtailment of frequency response is a major implication of the Miller effect. In this example, the frequency ω

*such that ω*

_{3dB}

_{3dB}*C*= 1 marks the end of the low-frequency response region and sets the bandwidth or cutoff frequency of the amplifier.

_{M}R_{A}It is important to notice that the effect of *C*_{M} upon the amplifier bandwidth is greatly reduced for low impedance drivers (*C*_{M} *R*_{A} is small if *R*_{A} is small). Consequently, one way to minimize the Miller effect upon bandwidth is to use a low-impedance driver, for example, by interposing a voltage follower stage between the driver and the amplifier, which reduces the apparent driver impedance seen by the amplifier.

The output voltage of this simple circuit is always Av vi. However, real amplifiers have output resistance. If the amplifier output resistance is included in the analysis, the output voltage exhibits a more complex frequency response and the impact of the frequency-dependent current source on the output side must be taken into account.[3] Ordinarily these effects show up only at frequencies much higher than the roll-off due to the Miller capacitance, so the analysis presented here is adequate to determine the useful frequency range of an amplifier dominated by the Miller effect.

**Miller approximation**

This example also assumes Av is frequency independent, but more generally there is frequency dependence of the amplifier contained implicitly in Av. Such frequency dependence of Av also makes the Miller capacitance frequency dependent, so interpretation of CM as a capacitance becomes a stretch of imagination. However, ordinarily any frequency dependence of Av arises only at frequencies much higher than the roll-off with frequency caused by the Miller effect, so for frequencies up to the Miller-effect roll-off of the gain, Av is accurately approximated by its low-frequency value. Determination of CM using Av at low frequencies is the so-called Miller approximation.[2] With the Miller approximation, CM becomes frequency independent, and its interpretation as a capacitance at low frequencies is secure.

http://www.angelfire.com/ab3/mjramp/sw.html

http://www.kennethkuhn.com/students/ee351/text/square_wave_testing.pdf

http://en.wikipedia.org/wiki/Miller_effect

Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! Try it!

## No hay comentarios:

## Publicar un comentario