As you’d expect from someone who’s hobby’s include both audio/stereo and electronics, I try to measure and quantify things even when they are related to audio gear. While I will prefer to tune things by ear at the final step, measurement gives significant insight to some problems, in a very accurate way, in short amounts of time. One of the tools I would love to have for this is a very accurate audio analyzer, like one of the Audio-Precision offerings. What I’d like to have is the ability to measure parameters like harmonic distortion down to very low levels of distortion. However, most of these instruments are so expensive, even when bought used, that I gave up on finding a good one of these very long ago. Thankfully, nowadays, you can get very good results with much cheaper PC based gear. This post will describe one of the steps I’m taking to try and extend my ability to measure these parameters with my laptop, keeping in mind this is aimed at hobby use and must therefore be reasonably priced. I will start this post off with a bit of an introduction, but will dedicate most of it the the low THD oscillator and its power-supply.
Unlike when standalone instruments were the only option for these low distortion measurements of audio gear, for quite a few years a good PC sound card isn’t too expensive. Even for these who have a laptop (like me), USB based cards are fairly cheap and good. While there are arguments against using such gear for these instruments, they are more than I’ll ever need for my hobby use. These sound-cards can be used as both the generator, and the recording device, and can achieve impressive distortion and noise numbers. As a reference you can have a look at these measurements shared by AMB. I was looking for something that would be cheap, but still good enough for my needs. I’ve then remembered the EMU 1212M I’ve had many years ago, and how I’ve always used it as a reference to measure other sound-cards. I’ve looked on eBay, and sure enough, you can get a USB EMU for very cheap. This was the 0404USB model, but looking at some measurements online, it was more than good enough, so I went ahead and purchased this one.
As a reference, I’ve measured a loop-back of the sound-card output back to the input to see how good its noise/distortion can get. I was very pleased to see the THD was as low as 0.0008% when operated at about -6dBFS and below it, quite similar to the results I’ve linked to a few lines ago. These are quite impressive number for most hobby use, and are more than good enough to measure distortion of most amplifiers. However, there are a few limitations to using a sound-card for audio measurements, even for hobby use.
First would obviously be the limited input range. The full-scale input is typically in the range of a few 100’s of mV’s before distortion starts rising. Some sound card can extend this to a few Volts (RMS). However, you typically need quite a bit more than that to measure power amplifiers. Second is the absolute measurement issue, where you can be sure 0dB is indeed 1VRMS, and must therefore add a voltmeter in parallel to monitor the signal amplitude to make sure you have an accurate absolute reading if power measurement is of interest. There are ways of calibrating this, but it can be a PITA, especially if you accidentally moved the input attenuation position. Third is the limited DC input range, which might be problematic if you’d like to measure distortion of amplifiers at points other than the output, where significant DC component can be present, especially in valve amplifiers. There are obviously other limitation, but these are a few of the issues almost every hobbyist will come across at one point or another.
There are obviously ways to circumvent these limitations, such as external attenuation to limit signal swing, perhaps even some form of clamps as an extra fail-safe to keep the input stage from being damaged. You can added an AC voltmeter in parallel to measure the amplitude. You can also add AC coupling to extend the DC input range. There are other solutions to these problems, such as P. Millett’s very nice Sound Card Interface project, which is very well received by other DIY enthusiasts over at DIYaudio.com. I have considered building one of these for my setup, but had a couple of requirements that prevented me from doing so. For instance, measuring balanced instruments is limited in amplitude due to the input stage structure. Additionally, I was looking for something that will be able to measure lower signals too. After all, if you have the infrastructure, why not add a low-noise pre-amplifier with sufficient gain, and measure noise of instruments/devices with the same setup. Because of that I’ve decided to design something more suitable for my needs, which I will hopefully share in a few months as I’m able to build and measure a prototype.
One thing that I was interested in measuring, is the absolute minimum distortion I could measure with the sound-card (before addition of external notch filters ), if I had a different signal generator. For instance, what if I would like to measure distortion of a DAC? In this case the output of the sound-card isn’t part of the measurement setup, and therefore knowing the limitations of its input stage is important. Therefore, I was looking for a low distortion oscillator of known performance to be used as a reference. I spent a couple of hours reading a few threads over at DIYaudio.com, and found a few options. One of the more interesting options was Victors oscillator, which he tests after assembly, so I felt comfortable with it being good enough for my needs, and contacted Victor about it.
This oscillator is obviously tuned to a single frequency, and I’ve opted for a 1KHz option as this is the typical frequency at which audio instruments are spec’d at. To iterate, I was looking at this oscillator as a reference for low distortion measurement of the sound-card input stage limitations. I might use it in the future if I ever need to generate a 1KHz signals that is cleaner than the EMU can create, but this will not be too often.
The oscillator is meant to be placed inside one of the aluminium cases from eBay that can be seen in the image below. It measures 100mm*65mm*35mm. The oscillator board itself occupies about half of the depth, and requires a 35VDC input voltage to operate.
Since I have many USB powered devices on my desk, I became a fan of using 5V input to projects that I build. I can reuse the same USB power bricks with multiple output to power these instruments. For instance, I’ve replaced the standalone PS of the EMU 0404 USB, which provided a 5V input in the same way. A cheap USB->DC plug cable makes this very easy to do. Therefore, I’ve decided to go the same way with the PS for this oscillator, and build an isolated switch-mode PS that will power it. I have also decided to make it as compact as possible, and place it in the same case as the oscillator only occupies half of it. I know what some of you will probably think, a switch-mode power supply can be very noise. That’s true, and even if I filter the output sufficiently, there might be some magnetic coupling. That is obviously true, and in many application can be problematic. However, I was aiming at using this oscillator for distortion measurements. Therefore, as long as these coupled tones are lower than the sound-cards own distortion, or located at non-harmonics of the 1KHz fundamental tone, they are of no importance.
Since the current of the oscillator is known to be 25mA, I’ve opted for a PS which is matched to this load at the desired output voltage, and went with the structure that can be seen below. The input is 5VDC, with a series poly-fuse, and reverse protection diode. This is followed by a +/-24V isolated switcher, followed by a passive low-pass-filter (LPF). R7/R8 are there as minimum load resistors, and can be omitted if desired. R9 is an optional 0R jumper meant to short the exposed metal at the edge of the boards to the local PS ground. Alternatively, R9 can be left out, and TP1 can be shorted to any desired voltage (such as oscillators local ground) to short it to the case. This can be better understood by having a look at the board layout, with the exposed metal at the board edges. I recommend you leave R9 out and use the oscillator ground instead.
I was also hopping of giving the oscillator a nice look, by using some nice panels. I’ve eventually decided to implement these as PCB’s too. The price of PCB’s is so cheap, in a variety of colors, there’s just no reason to look for other solutions if the feel of FR4 isn’t a problem. You can obviously use the copper layers as shield, and even short them directly to the case by use of the mounting screws. That was exactly what I did for these panels. As an example you can see the design of the front panel in the image below (from KiCAD). KiCad render is in green in the image below, but I’ve decided to go for a white panel instead.
After exporting all 3 boards (PS, and front/back panels) Gerbers, sending to Seeed, and waiting for a few weeks, the package has finally arrived. I’ve assembled the PS, and verified the output voltage was within target, just a tad lower than 35V. I’ve attached below a few images of the assembled PS, as well as the closed case with the panels fitted to it.
Now for some measurements of the oscillator in conjunction with the switch-mode PS. These can be seen in the image below, as measured with ARTA and averaging to attenuate noise. There are a couple of observable issues there.
First is the 50Hz (mains) pick-up. This isn’t the PS’s fault, as its not operating at 50Hz, and it is already fed with power from a USB brick which means there are mainly higher frequencies there. Operating it from a clean lab PS shows similar (actually slightly higher) 50Hz tone. Moving the case around, and wrapping the signal cable from the oscillator to the sound-card has a noticeable affect on this tone, which leads to the conclusion it is coupled from the surrounding instruments. I will play around with additional shielding and a shorter cable in the future, but for the time being this tone is sufficiently low for my needs.
The second issue is obviously the spurs that can be seen at higher frequencies, these are generated by the switch-mode supply. I have verified that adding extra filters had no affect. However, moving the PS away from the oscillator board shows noticeable attenuation. Therefore this is either capacitive or (more likely) inductive coupling. However, as these spurs are relatively low in amplitude, and more importantly, don’t coincide with harmonics of the fundamental frequency, they don’t affect distortion measurement which is my only use of this oscillator box. I have verified the performance with a clean DC supply, and while these spurs were obviously gone, harmonics were unaffected.
Therefore, while I could improve the purity of the spectrum by feeding the 35VDC externally (or adding shielding inside the case), I’m satisfied with these results. The spectrum is clean enough for my needs, and I really like the small size and single box structure of this instrument. I’ve actually decided to order a couple of extra cases from the same type for some future projects which I will obviously share in the blog.
More importantly, this gave a very good reference measurement of what I could expect from the input stage of the EMU 0404 USB if I attenuate the signal to -9dBFS. I was actually quite happy with these results, as they show that indeed the output of the EMU was the limiting factor (even when I’ve attenuated the signal to -9dBFS to verify), and it will be possible to measure lower distortion by using a different signal source such as a USB DAC. Not bad at all for a 45$ sound-card from eBay. There are of course other more modern alternatives, but I would advice to look around the web at some measurements with ARTA/RMAA of the sound-card you are interested in. Some perform significantly better than others.
Added on May 31, 2019:
I wanted to take another look at that 50Hz pickup and the switching noise from the DCDC, and what I can do to reduce it. I knew this wasn’t something that extra supply filtering would fix (I have tried that before), which means these are coupled through capacitance/inductance. The first thing I have tried is adding a thin layer of copper tape around the DCDC and connecting this to ground. This had a small affect on the DCDC switching noise, but nothing significant enough for me to recommend it as a solution. Then I’ve started looking closer at the setup and where this noise can be coupled in, and what might help prevent this. It was at this point that I’ve realized that my EMU was still set to GND-LIFT mode for that input. That’s what you get for having this switch on the bottom side of the EMU 0404 unit. So a flip of the switch later, all these coupled noises are now gone. This has affected the harmonics too, but they are all within the range I expect to have on the EMU.
So following these results, I think the isolated DCDC is an excellent solution for this application. With the sound-card properly set, the DCDC generates no tones that couple into the measurement, and the single 5V input is very convenient to use. I think this also shows that the EMU 0404 USB is performing quite well for the cheap price you can get these on eBay nowadays.