Tuesday, May 17, 2022

Which HF distortion measurement: IMD 19+20k or THD 20k?

Here is a (longish) quote from Bruno Putzey's post at the Audio Science Review forum which explains his preference.

Let's start by explaining why I prefer to measure distortion strictly inside the audio band. There is an ongoing controversy about whether signals above 20kHz might or might not be audible, but what is not controversial is that signals below 20kHz are much, much more audible than signals above 20kHz. So if you are in a situation where you have to choose between optimizing performance below 20kHz or above 20kHz, you go for optimizing the bit that we are most likely to hear. Even high-res enthusiasts seem to have tacitly accepted this a long time ago. Remember DSD? A DSD AD/DA converter that, when measured over 20kHz, would easily clock a SINAD of 120dB would "degrade" to 50dB as soon as you upped the measurement bandwidth to 40kHz. But what you heard was of course 120dB, the rest was for the bats. Note the delicious irony. DSD was hawked on the grounds that you needed >20kHz bandwidth for high fidelity, while its skyrocketing supersonic noise floor was excused on the grounds that it was inaudible. As it is, DSD is perfectly listenable. I can find no more eloquent argument that the ear is not very sensitive above 20kHz than DSD...

Anyhow, this is why I like to test amplifiers with test signals that in themselves would be audible (i.e. fit below 20kHz) and also read the distortion and noise only in the band below 20kHz. Of course, I know perfectly well that if you then do a THD versus frequency sweep, any readings above 10kHz are meaningless because even the second harmonic will be outside the audio band. But as our sensitivity to those harmonics drops off rather quickly around 20kHz (as does the ability of most speakers to reproduce them), it's fair to conclude that they do not say much about sound. On the other hand, we can't just go ignoring any underlying non-linearity. We still need to test for misbehaviour at high frequencies. If you choose to limit measurement bandwidth to 20kHz you have to include something like the 19kHz + 20kHz test. I didn't invent that procedure btw, I got that from Bruce Hofer at AP who recommends it. In fact his version is even neater, he uses 19.5kHz and 18.5kHz, making sure that even order products sit at even multiples of 500Hz (from 1kHz upward) while odd products sit at odd multiples of 500Hz, from 17.5kHz down, potentially fitting 37 distinct IMD products inside the band. This refinement doesn't make much difference with the 1ET400 amp of course since there aren't that many IMD products poking up over the noise floor.

Given the choice between a sinewave test at 20kHz which only produces inaudible products and a two-tone test that produces all kinds of in-band distortion I go for the latter. By implication, we should be designing a control loop that maximises loop gain all the way up to 20kHz, but not beyond. Any control system obeys a law called the Bode Inequality. This is the closest we control theorists have to mass-energy conservation. In the case of a class D amplifier it implies that if you maximise loop gain over a largeish fraction of the switching frequency you'll have to take it down really fast afterwards. So that's why the wideband THD vs frequency plot goes up somewhat suddenly at the end. It's a compromise I'm knowingly making. Consider the alternative: I could instead pander to the bat-eared crowd and choose to minimise harmonic distortion components up to 40kHz, say. That would mean accepting a lot less loop gain below 20kHz and hence higher distortion in the audible frequency range. It's not a good tradeoff.

Anyhow, this should explain why the high-frequency IMD spectrum is so much cleaner than a wideband THD test would lead you to expect. But as I see it, the former is the one that is most likely to have a meaningful correlation to sound.

(While I'm at it I ought to point out that the idle noise is noise shaped. This is visible on the broadband noise plots where you can clearly see the rise after 20kHz. The extra outband noise is caused by the comparator and driver chips and ends up being noise shaped by the control loop. I only wanted to mention that because the wideband THD vs F plots are mostly swamped by this HF noise which bore some explaining.)

Tuesday, May 3, 2022

High Precision Composite Op-Amps

This post is a part of the series on audio amplifier feedback. The contents of the series can be found here.

In my previous post,  I discussed how distortion can be corrected by cascading multiple opamps:

Obviously, in such a structure the stability problem arises. One possible solution was devised by John D. Yewen and described in his article "High-precision composite op-amps", published by Electronics & Wireless World in February 1987.

Yewen observed that, if every opamp in the schematic above is a perfect integrator (i.e. its open-loop gain falls with frequency at 20dB/decade), the closed-loop transfer function of the above arrangement is simple enough to calculate and to test for stability using the algebraic Routh-Hurwitz stability criterion, without ever looking at Bode plots. Further, the closed-loop transfer function can be manipulated to stability by adding voltage dividers at the outputs of the error correcting opamps:

As for choosing the dividers for stability, Yewen mentions the binomial series (1,1; 1,2,1; 1,3,3,1; ...) and the Butterworth coefficients (1,1; 1,1.41,1; 1,2,2,1; ...) and gives one worked example of a three-opamp unity-gain invertor.

Turns out, the general rule for Yewen's dividers is quite simple for:

  • two- or three-opamp composite amplifiers...
  • with the Butterworth coefficients...
  • built from identical, single pole compensated opamps.

Say, we need an inverting amplifier with gain $(-A)$. For example, in Yewen's worked example above, gain is $(-1)$, so $A=1$. To achieve that, the feedback network $R1R2$ should divide the output signal by ${A+1} = {{R1+R2} \over {R1}} = 2$. Here is the rule:

  • To build a two-opamp composite, add the opamp C1 and divide its output voltage by $(A+1) \times 2$.
  • To build a three-opamp composite, add another opamp C2 and divide its output voltage by $(A+1) \times 4$.

For example, for an inverting composite with $A=2$, the following values will work:

All three circuits above are stable and have phase margin of about 65° (loop gain on the top, closed-loop transfer function at the bottom):


The price for such stability is diminishing returns on extra opamps - each additional error correcting opamp contributes less to the overall loop gain because of the voltage dividers. Also, the closed-loop transfer function peaks around the crossover frequency, so a low-pass input filter is required.

Does it work in practice? Yes, as long as the opamps are (i) identical and (ii) sufficiently close to single-pole, at least around the crossover frequency. Here is a practical composite with the negative gain of 10 and total loop gain of over 90dB, built from four OPA134:


It is quite stable and clips ok:

Can we make it even better? Of course we can. Stay tuned...