Class D amplifier distortion measurement filter - Page 1
Forum section: electronics / projects

author: GregDunn
author_rank: Frequent Contributor
timestamp: August 22, 2019, 07:30:48 pm
content: Trying to find a satisfactory solution to the problem of measuring the distortion of a Class D amp (Crown XLS) with my HP 331A distortion analyzer. The problem is that even though the PWM signal is well filtered and not an issue in actually driving speakers, enough of it leaks through to make the distortion measurements invalid (the HP has a measurement bandwidth of about 600 kHz, and the PWM freq is about 384 kHz). I tested an amp and got distortion on the order of 1-10%, and I know it's much better than that within the audio range.So I need a filter between the amp output and the analyzer to get rid of the high frequency junk. There are commercial units which are too expensive for just casual measurements, and many schematics on the web which use not only hand-wound inductors (not a problem) but weird value low tolerance caps (a problem). Within limits I can make a custom cap network, but then I start getting problems from extra lead length. I would like the stopband to be at least -80 dB by the time it gets to the PWM freq so it will be below the HP measurement limit. It should be passive, because I may put 40-50V into it - the HP will withstand much more than that.Does anyone know of a passive filter design which uses near-standard cap values and has good rejection at 400 kHz with reasonable flatness in the audio band? I have been looking athttps://rf-tools.com/lc-filter/- would that work OK as long as I keep the input/output impedances well above the nominal 8Ω of typical speakers?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 22, 2019, 09:59:07 pm
content: 0. Are you after THD exactly, or THD+N? Because if I understand correctly, you already have the latter.More useful of course would be THD+N in 20-20k Hz bandwidth for example, or just plain old THD (i.e., the fundamental and harmonics only; but not IMD, but that doesn't exist in a single-tone test so that's fine).1. Note that the output impedance is probably capacitive, and a speaker (if you're using it as load during this test) isn't very much of anything, it's all over the place. So to get a reasonable filter, you will probably need a constant-resistance type, or at least, informally, enough damping (at one or both ports) to keep it behaved.2. Looser tolerances are found in lower-order filters, and the softer rolloff types (Bessel or Butterworth). You can probably get by with cored inductors just as well, too (but mind that they can introduce some distortion, so if you're down in the 0.01% range, you may consider air-core after all).The filter order, and to a lesser extent the filter type, determines the attenuation beyond the cutoff frequency. All [all-pole*] filters of a given order, have the same cutoff asymptote (-20dB/decade/pole), it's only shifted around depending on type. Your signal bandwidth, then, sets what order the filter must be (for a given type).*There are other types; if we allow a zero in the response, we can notch a specific frequency, or mold the stopband as we please; but this comes at the cost of less asymptotic attenuation. In the extreme case, the elliptic (Cauer) filter has as many zeroes as poles, giving actually a flat stopband; such is the price paid for a wickedly sharp cutoff. There are also filter types of historic interest (m-derived) which are easier to design than modern (analytic, pole-zero) types; but, they require more inductors and capacitors for the same overall response.To get -80dB at ~400kHz, that's four decade-poles; a single RC would thus have to roll off at 40Hz, which I'm guessing is a bit silly. To roll off by 20kHz, you'd need a bit less than a 4th order filter; maybe a bit more (5th?) if it's a bit on the loose side (closer to a Bessel).3. To apply damping, the dumbest, easiest method is simply resistive attenuators. Put a 3 or 6dB pad between the amplifier and filter, and again between the filter and load (if it's a reactive load like a speaker). This is a tee or pi network of resistors, set so that the input and output resistances (when the other port is loaded by system resistance) equals the system resistance. So, in this case, 8 ohms. Easily calculated:http://www.chemandy.com/calculators/matching-pi-attenuator-calculator.htme.g. 8 ohms, 8 ohms and 6dB requires 24, 24 and 6 ohms. (The network is always symmetrical if the input and output resistances are equal.) Or for tee, 2.7, 2.7 and 10.7 ohms.If you can't afford loss in the circuit, then a parallel R+C and/or series R||L (Zobel network) can be applied, which has no effect at low frequencies, but which introduces losses around the transition frequency, and this works in the same way as the attenuator, making the filter less sensitive to the amplifier or load impedance. Downside is the filter response gets softer (or maybe lumpier) as a result, so some tuning should be done to keep a reasonable response. (Set up the circuit in SPICE and keep poking values until the response looks right, whether the source is a voltage source, resistor or current source.)Tim

author: GregDunn
author_rank: Frequent Contributor
timestamp: August 22, 2019, 11:10:43 pm
content: I'm interested in THD or THD+N in the 20-20k band. The filter is not going between the amp and load, it's just going between the load and the measuring device, so I would really rather the impedance be as high as possible so that it doesn't dissipate any power. It shouldn't matter if there's some reactance because I'm not looking at the spectrum, just the total harmonics.I'm looking at air-core inductors because the limit of my measurement accuracy is under 0.1% and if I can reduce any added distortion below that level it will be much less hassle. My initial guess was a 5th order Chebyshev with about 10kΩ load impedance so it won't dissipate much power:

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 23, 2019, 01:01:43 am
content: Ahyup, then higher Z is good, and simple series resistance will do for termination. I wouldn't go for kohms, good luck finding inductors good enough -- but 100 to 1000 ohms should be doable enough. Anything in that range should do, while loading the amp negligibly.Tim

author: David Hess
author_rank: Super Contributor
timestamp: August 23, 2019, 04:54:11 pm
content: Bob Cordell's book "Designing Audio Power Amplifiers" discusses that problem. The AES specifies a mostly passive filter, AES17, to be used between the class-d amplifier output and the distortion meter. Modern distortion meters may have this built in. Note that measuring harmonic distortion of higher frequency signals is practically impossible because their harmonics will either be removed by the filter or overwhelmed by the switching noise.

author: GregDunn
author_rank: Frequent Contributor
timestamp: August 23, 2019, 08:06:47 pm
content: I don't care about harmonics past 20 kHz, because they're inaudible anyway and I really only want the audible distortion components. If I were doing IMD measurements, it might be a different story.At 1kΩ the filter will still have to dissipate a few watts and that will affect my choice of resistors, so I will have to take that into account when finalizing the design.

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 23, 2019, 08:16:39 pm
content: Quote from: GregDunn on August 23, 2019, 08:06:47 pmThey may annoy your dog.

author: TimFox
author_rank: Super Contributor
timestamp: August 23, 2019, 10:42:56 pm
content: For steady-state distortion, THD and IMD are two ways to quantify the same nonlinearity. Obviously, if you wat to measure THD at 10 kHz, you need to go up to at least 30 kHz to get a useful measurement, even though you can’t hear 30 kHz. Or, you could do a two-tone IM measurement with 10,100 and 10,000 Hz, looking for 3rd order terms at 10,200 and 9,900 Hz on a spectrum analyzer.

author: dashpuppy
author_rank: Regular Contributor
timestamp: August 24, 2019, 02:07:37 am
content: I've heard so many Class D amps and they all sound Meh! Whats wrong with a nice Class a/b or A ?

author: NiHaoMike
author_rank: Super Contributor
timestamp: August 24, 2019, 04:53:59 am
content: Try something a bit better than the cheap consumer junk out there. At more than 20W or so, it's cheaper to build class D than class AB, and then if you're building for digital input, you can replace an expensive DAC with a somewhat cheaper DSP.I have personally had good luck with TI chipsets. Too bad there aren't very many digital input boards for a reasonable price...

author: David Hess
author_rank: Super Contributor
timestamp: August 24, 2019, 07:19:52 pm
content: Quote from: dashpuppy on August 24, 2019, 02:07:37 amMost people will not notice the difference in performance but can immediately appreciate the increased efficiency of a switching amplifier.

author: GregDunn
author_rank: Frequent Contributor
timestamp: August 26, 2019, 01:06:19 am
content: Quote from: SiliconWizard on August 23, 2019, 08:16:39 pmCat.But neither the source material nor the speakers go much, if any, above 20k, so I'm not too concerned if there is junk >60dB down. I have seen a distortion plot for the amp elsewhere, but (a) I'm not sure if I trust the originator, and (b) I'd really like to see what I get when I do the band-limited measurement.

author: GregDunn
author_rank: Frequent Contributor
timestamp: August 26, 2019, 01:15:59 am
content: Quote from: David Hess on August 24, 2019, 07:19:52 pmI haven't done a blind listening test on the amp (Crown XLS series) but it does an excellent job of driving my inefficient speakers with tons of headroom, and it does consume about 1/4 the power under no-load conditions. I'm perfectly satisfied with the result and love the system - it's certainly doing everything I hoped.Personally, I'm of the opinion that a modern amplifier, properly designed and operating within its ratings into the specified load, is pretty much indistinguishable from any other. If I were a subjectivist, I'd probably be saying that the Crown sounds cleaner and less strained than the large class AB amp it replaced - but I don't subscribe to that viewpoint and doubt I could actually hear a difference. The ear is a terrible measuring tool and is so easily influenced by the eyes. But I do like to have measurements to confirm that the amp is actually working properly, and meeting its specs. It's my engineering background digging my musician background in the ribs.