Power up, distortion down

I did some more work on my Blameless amp project. First of all, I built another output stage, so I now have two output stages, but still only one driver board. Then, I improved my distortion measuring setup a bit. I shielded all the cables and rejigged the grounding, which reduced the oscillator + analyser floor to 0.0036%, with the 80kHz filter engaged.

With this extra resolution I was able to do some more tweaking of the Blameless. I found the following issues:

The MJE350 transistor in the output stage pre-driver is much slower than its MJE340 “complement”. I replaced it with a MJE15033. This allowed me to reduce the anti-sproggie resistor on the base. I was running 100 ohms on the NPN side and 200 on the PNP side, so I changed both to 150 and retried the reactive load test. There were no parasitics, and hopefully I’ll get a bit more power before clipping now.

I was only running about half of the amount of feedback that Douglas Self used in his experiments. (I used the same input stage gm and compensation capacitor as he did, giving the same open-loop gain at 20kHz, but I designed for twice the closed loop gain.) To fix this, I reduced the input pair’s emitter resistors from 100 ohms to 51.

The input doesn’t like being driven straight off the wiper of a 20k volume pot: when I buffered it with a NE5532 op-amp, the noise and distortion went down. I think Douglas Self implicitly designed all his circuits to run best with a 50 ohm source impedance, because that’s what an Audio Precision test set has. 🙂 He runs the input transistors at 2mA for high slew rate and lots of gm, but the downside is lots of noise current and a low AC input impedance. So, in the finished unit I’ll buffer the volume pot.

Adding a DC offset trim and tweaking it for minimum offset also reduced 2nd harmonic at high frequencies. Again this is what Self’s theory of the input stage predicts.

The biggest improvement came by swapping out the expensive PNP matched input pair for a pair of ordinary transistors that just had high beta: BC213C’s with 350 min. as opposed to the 100 typ. of the MAT03. Saving money while boosting performance, that’s more like engineering than hi-fi 🙂

When I was finished with all this, I had a THD+N figure at 100W, 1kHz, 4.7 ohm load, of… 0.0036%! The same as the oscillator itself. The residual also looked identical to the oscillator’s own. At 100W, 10kHz, I got 0.008%, and this decreased to 0.0065% at 100W, 20kHz. (Because of the 80kHz filter, I assume.)

The 1W figures were slightly higher than the above, but from examining the residual, the extra seemed to be mostly the noise floor of the amp and oscillator, rather than crossover distortion.

These are pretty much the best results I’ve had, and I can almost imagine that if I had an Audio Precision, I’d be seeing the kinds of figures that Self claims.

Douglas Self, Jim Williams, and a sunny Saturday morning

Writing this, I was inspired by an article by Jim Williams called “Max Wien, Bill Hewlett and a rainy Sunday afternoon”, which documents his investigation of the Wien bridge oscillator and how to lower its distortion.

1. I’m a fan of Jim Williams, and his crazy cartoons and application notes with names like “Switching Regulators for Poets”.

2. My prototype Blameless power amp was getting good enough that I needed a really low distortion oscillator to test it. Surprisingly, even my 24-bit home studio gear wasn’t good enough: sigma-delta converters generate a lot of ultrasonic noise that inflates the THD figure. And my Twintrak Pro mainly generates smoke.

3. I could not find a Tektronix SG505 or SG5010 for sale at a reasonable price.

4. Neither could I be bothered building the oscillator section of Bob Cordell’s DIY THD analyzer.

5. A search of my kitchen junk cupboard yielded a RA53 thermistor.

6. A Google search of the part number revealed that it’s the magic ingredient for making a really good Wien bridge oscillator. So, using the RA53 and a NE5532 op-amp, it only took about an hour to make an oscillator that ran off a couple of 9v batteries, and measured about 0.007% THD at 10kHz on my analyser. (The remaining THD is probably a combination of ignoring Williams’ Law, thermal modulation in the thermistor, and the dirty mains in our lab.)

7. So, this morning I tested the Blameless using my new low-distortion oscillator. It was clean enough that I could see the “gm-doubling” distortion described by Self when the amp was biased too hot: the first time this effect has ever been reproduced at Conner Labs. 🙂 Optimal bias seemed to be about 8-9mV per side, though it wasn’t clear whether this was just cancelling the oscillator distortion, and the true minimum might be at a higher idle current.

8. The results were really good. The 10kHz, 100W, 4 ohm THD came out around 0.01%. I used the 80kHz low-pass filter, but from inspection of the residual, it wasn’t filtering much: mostly the 200kHz switching noise that our mains is ridden with. At 10kHz, 2W, it was about 0.007%.

9. I cranked it up to 140W and let it get really hot. This only caused about 1mV change in bias, and checking again at 2W, the THD reading and residual looked pretty much the same. Then I rigged up a fan to cool it down again, and that didn’t make much difference either. Yay for those ThermalTrak transistors, then.

10. Renting an Audio Precision test set costs about £600/month for the entry-level one. So, I decided to call it quits at this point. The Blameless is now complete, and it just needs another channel, DC offset protection, and a box. I shall publish the schematics soon.

11. When Jim Williams was done with his oscillators, he cooked some hot dogs. I am ashamed to admit that I ate a McDonalds.

12. Now I am obsessed with trying to make a digitally controlled version of Cordell’s oscillator. 🙂

Blameless first sound! :D

Today, after much testing with various dummy loads, including the dreaded 4 ohm reactive one (which showed up some parasitics that I managed to get rid of) the Blameless was finally plugged into a speaker.

It werks!
It werks!

Attempts to measure the THD have so far failed. They really just show up the limits of my  THD measuring system, which is currently no good for anything except finding gross faults.

For instance, the reading I previously got of 0.05% at 10kHz and 120W. When I took the amp out of circuit and connected the analyser straight to the oscillator, the THD reading increased to 0.09%.

The THD analyser does show up crossover spikes, though, if the output stage is underbiased. They were pretty much invisible by a bias voltage of 10mV per side (20mV total) which corresponded to 200mA total idle current. I set it to 13, which gives the 26mV total that some experts recommend.

Anyway, it’s working, and experimenter expectancy notwithstanding, not to mention lack of one channel, I swear it sounds better than my old MOSFET amp. Maybe there is something in Douglas Self’s claims of poor crossover distortion from MOSFETs. Once I get the other channel built and the system put together, I will make that low-distortion oscillator and do a THD shootout. Or an ABX test or something. Anyone want to lend me an Audio Precision test set? 🙂

More Blameless progress

The Blameless project is grinding on!

.

4-layer boards for the output stages were designed in Eagle and ordered from PCB Train. Some samples of the ONSemi NJL4281/4302 transistors with built-in thermal sensing diodes were obtained. The whole lot was fitted to a large heatsink using Sil-Pad A1500 high performance thermal pad stuff.

After testing using a bench power supply, it was connected to a large transformer, rectifier and some capacitors.

The power was turned on and amazingly it failed to explode.

More detailed info to come, but the maximum output is about 120-150W into 4 ohms, the THD about 0.05% or less at 10kHz and 120W (so should be nearer 0.005% at 1kHz) and the short circuit protection, thermal compensation etc. all works as planned.

First THD analyser results!

I’ve finally got the THD analyser hooked up and working! Not very well, though, because I have to use it with my not-too-hi-fi signal generator, on account of the analyser’s own oscillator section being AWOL. My sig gen is DDS-based, so it puts out lots of high-frequency crud and DAC quantization errors, and these overwhelm the amp’s own contribution to the residual. Except if I test at 10kHz and press the analyser’s low-pass filter button, which kind of fixes it…

Anyway, I hooked the Blameless up to an unregulated power supply to pump in plenty of hum and grunge (got to test that ripple rejection too!) and made some THD + Noise measurements.

THD test setupTHD at 50W50W residual

10kHz, 50W into 4 ohms: 0.086%

10kHz, 2W into 4 ohms: 0.037%

(I measured at 10kHz to try and force the amp to generate more noticeable THD levels. And yes I have the hi-pass button pressed: some hum is getting in somewhere…)

I also tried setting the bias pot to minimise THD.  At 50W, this happened at a setting so cold that there was barely any bias at all! I measured a Vq of around 300uV. But at 2W, the minimum occurred at a Vq (across each emitter resistor) of about 14mV.

2W THD, underbiased2W THD, bias just right2W overbiased

I think what’s happening is that at high power and high frequency, an overly cold bias helps to counteract the transistors’ slow turnoff. Too cold bias effectively starts turning them off in advance. This gives a false THD null. 2W seems to be a better power level for setting it.

At both power levels the THD nulls were very broad, and seemed to stay stable when I let the heatsink get burning hot, and then applied a fan to cool it back down.

Still a long way to go in terms of refining the THD measuring setup… but it’s a start!

Blameless short circuit protection

So, now the short-circuit protection is tested.

I used a dual-slope VI limiter as described by Self in his book, except I simulated it in LTSpice and played with the component values to lower the power dissipation a little. Self’s original design allowed the transistors to dissipate nearly their full rated 250W, and I thought that was excessive, since it’s only possible at a case temperature of 25’C, and that will never happen in practice.

I guess his reasoning is that since the amp will only amplify AC signals, then under short-circuit conditions each transistor will conduct with a duty cycle of 50%, so the mean dissipation will only be 125W. But I can imagine situations where that wouldn’t work.I also plan to try the NJL4281/NJL4302 transistors in the future, and these have less SOA than the MJ15024/MJ15025, the devices that Self designed the circuit for.

My new values were supposed to make the circuit limit at about 125W. Anyway, so I made the circuit up and tested it with the method described on Rod Elliot’s site. Namely, I shorted the amp’s output with a 0.1 ohm resistor, and fed 100us pulses at a repetition rate of 10Hz to the input. I did this with the amp running off two regulated supplies, allowing me to vary the rail voltage and note the current for each voltage.

At first, the negative rail had no limiting at all! It started out at 12A and headed skyward from there. It turned out that I put a diode in backwards, and also the gain of the PNP limiter transistor was low, and the VAS current limit was a little high. Once I got that fixed, I plotted out the two sets of results in Excel, and added loadlines for reactive and resistive loads on 40V rails.

Protection locus

So you can see that with one pair of output transistors installed, we can just barely drive a 4 ohm resistive load or an 8 ohm reactive one. To drive a 4 ohm reactive load, we’d need two pairs, which is what I was expecting, and two pairs is what I plan to fit.

Finally as a sanity check I rigged up a reactive load: A big iron cored choke wound with about 80 turns of heavy wire. I put two 4.7 ohm resistors in series with it, and it could drive that easily at any frequency. Go down to one 4.7 ohm resistor, and I found a frequency where the limiter would activate and cause crazy clipping, like in Rod Elliot’s Figure 4 linked above. Again this agrees with what I expected, so we’re good to continue!

Note that before trying this test, I added the catch diodes from the speaker output back to the rails. Otherwise the output devices would be destroyed when the limiter kicked in.

My Blameless is working!

I’m so happy! Ever since I was a humble EE student, I’ve wanted to design my own hi-fi power amp based on Douglas Self’s “Blameless” philosophy. I now proudly present the prototype.

doesn’t look goodbut seems to work well so far

I’ve built power amps from other people’s designs before, but this is the first one I’ve designed, albeit with a lot of help from Self’s “Power Amplifier Design Handbook.” It’s a modular system, with a driver board that can be hooked up to any kind of output stage, to make different kinds of experimental amps.

It’s still not finished: the protection circuitry and THD need testing. But it’s passed the first hurdle, in that it can run with a good DC offset (I measured 16mV), stand +/-60V rails and drive a load without blowing up.

The last three amps that I’ve built were powered by valves (tubes?), and the two before that had MOSFET output stages, so working purely with BJTs was a bit of a culture shock. Self always argued that they were the best amplifying devices, and they certainly seem pretty good. The OnSemi MJ15024/MJ15025 pair of transistors I used in the prototype cost a few dollars each, less than half the price of equivalent MOSFETs, and they make as much Umph as a pair of KT88s. They didn’t want to oscillate or explode, and the whole thing generally just worked first time. Apart from that evening I slipped with the scope probe and took out half a dozen trannies in the driver board.

This is something of a multicultural project. The output trannies were made by Motorola in Mexico, all of the other ones came from Continental Device in India (that’s what you get when you buy Farnell’s “Multicomp” value brand transistors) and the whole mess was assembled by a Scotsman wired on Fairtrade coffee beans.

And yes, Self convinced me to buy a distortion analyzer. So far all it’s told me is that I need to get a better signal generator.

Resampling in Mac OS part 2 :)

After a few snarky messages from Mac owners, I thought I had better post a follow-up. I experimented a little at the weekend and found the following:

If I leave my soundcard (Audiophile Firewire) permanently on 96kHz, then:

iTunes will resample to 96kHz internally, with quality that sounds just fine.

VLC will output at whatever the sample rate of the media is, and get resampled to 96k by AUHAL on its default quality setting, which sounds a bit sketchy.

But, VLC can be set to always output at a particular rate, resampling internally. There’s an option called “Frequency” in the advanced audio preferences. According to VLC’s debug stream, it uses a module called “bandlimited_resampler”, and that’s encouraging, because it suggests that the guy who coded it knows the word “bandlimited”. It uses about 6% CPU time, and again, sounds fine. Thanks to the wonders of open source, we can see bandlimited.h here! Ooo, a 1536 point sinc kernel with linear interpolation and single-precision floating point arithmetic.

I got VLC’s “Media Library” to work too, so it can store a playlist, remembering what FLAC stuff I have and the track order of it.

I’ve not tried to play DVDs yet, but hopefully the computer won’t catch fire.

So in conclusion, I’m upgrading this from “:(” to “:)”

Resampling in Mac OS :(

Recently I’ve been experimenting with higher definition music downloads. For example, the Studio Masters recordings from Linn Records, or the material from B&W Society Of Sound. Everything went nicely until I got my new Mac.

First of all, the only lossless format supported by iTunes is Apple Lossless. It won’t play FLAC (the open source Free Lossless Audio Codec) properly, even with the xiph.org extensions, Fluke, or whatever. A bummer, as I already had a fair amount of music in FLAC format. Sure, VLC will play it, but VLC can’t understand iTunes playlists.

Second, Linn don’t support Apple Lossless. They supply their music in FLAC and WMA formats only. I guess they’d rather you bought their own stupid, overpriced DS network media players, even if you have a Mac already.

Third, Mac OS resamples! Windows was smart enough (or dumb enough?) to set your audio hardware to the actual sample rate and bit depth of the track that was currently playing. Or at least the setup I used, Winamp Classic with the ASIO driver, would do that, guaranteeing bit-accurate output under all conditions.

The Mac doesn’t. You set the sample rate and bit depth once and for all in the audio control panel, and all the sound gets resampled to that. You can play 96kHz material till you’re blue in the face, using any player application you like, but if the system sample rate is set to 44.1, it’ll get downsampled. Watch a DVD, and the sound is getting resampled from 48 to 44.1.

I don’t know about you, but I wouldn’t trust any resampling algorithm I hadn’t written or at least tested myself. They’re notoriously hard to get right. And a “right” one consumes so much CPU power that there’s a real incentive to downgrade the performance deliberately.

Here’s the official line from the Coreaudio mailing list, found here

This was a comment posed to the list (which was replayed verbatim from Benchmark’s Elias Gwinn)
> […] If the user changes CoreAudio’s sample-rate in AudioMIDI Setup to something different than what iTunes is locked to, CoreAudio will convert the sample rate of the audio that it is receiving from iTunes. In this case, the audio may be undergoing two levels of sample-rate conversion (once by iTunes and once by CoreAudio). (The SRC in iTunes is of very high quality (virtually inaudible), but the SRC in CoreAudio is horrible and will cause significant distortion.) If the user wants to change the sample rate of CoreAudio, iTunes should be restarted so that it can lock to the correct sample rate.

This is the response from an Apple employee:
iTunes uses the AudioConverter API internally but we set the quality to “max” and AUHAL probably uses the default (I don’t know). One SRC at max quality followed by one at the default quality is not so great when analyzing sine tone playback.

So the bottom line seems to be, that if you have material recorded at a higher sample rate than 44.1, then you need to turn your system’s sample rate up to appreciate it. And if you do that, then all of your other stuff will get upsampled, though at least it uses Coreaudio’s best quality algorithm. Or does it? Leopard introduced a new “Mastering grade” algorithm, and it’s not obvious whether that one is used.

One step forward, two back. Come on Apple, twiddle those nose rings and come up with a sexy solution.

To EQ or not to EQ, that is the Q

If you’re a follower of hi-fi trends, you might have noticed that tone controls don’t seem to be cool any more. High-end amplifiers have become very minimal, with only a volume control and power switch.

Well, there’s high end and high end. Richard Burwen’s system would certainly qualify as high-end by almost any definition, if only because of its 20,000 watts of amplification, 169 speakers, and 34 channels of active crossover and EQ, which Burwen claims to have spent a year adjusting by ear for a flat overall frequency response. In other words, the very opposite of a minimal system.

Moving on to my own hi-fi system, which has 60 watts of amplification, 2 speakers, and no tone controls or EQ whatsoever, and has been plagued by annoying room modes. I’ve tried several different speakers, but the bass on all of them just sounded terrible in there.

Recently, I realised that the fundamental problem is that my living room has the two large opposing walls made of solid brick. These two reflective surfaces allow a standing wave to develop between them, and the result is a highly resonant bass boost of about 9dB at 60Hz. I fed the measurements of the room into an online room mode calculator, and it agrees that I should get terrible bass.

So, what to do about it? The minimal solution would be to damp the resonance by installing bass traps. This would be a major carpentry project, though, and good bass traps have to be physically large, so I would lose space in the room. And, I hate working with rockwool, it makes me itch all over.

So, like Richard Burwen, I decided to install an EQ, and “tune by ear for flat frequency response”. My first attempt was with an Alesis PEQ-450, which is a 10-band digital parametric EQ. It only took about 5 minutes to find the offending frequency and notch it out, and I was amazed by the improvement. I found myself getting out those old hip-hop and drum’n’bass CDs that had just sounded offensive on the system before.

However, I wasn’t too happy with the sound quality of the PEQ-450. Maybe I was imagining it, but I felt that it grunged up the treble somewhat. It was also too big and I had nowhere to install it. I ended up buying two (they’re mono) Presonus EQ3Bs on Ebay, and again, tuned them by ear for best bass. I could have gone digital with a Behringer DEQ2496, but in the end, I decided that the simpler solution would be better.

So now, I find myself in the situation of committing audio sacrilege (tone controls are bad! So EQ must be worse!) in order to get a major improvement in the performance of my audio system. Mmm, sacred cowburger.

EQ

The EQ3Bs in place

The system

The system. The graffiti paintings are by my brother, and help to break up standing waves too. 🙂