Show by Label

Saturday, October 14, 2017

Setting up an FFT Measurement System

In this post I'll describe how I use a number of components to create a system that you can use to measure harmonic distortion and noise by using FFT's. This system can be configured in several ways to verify and measure the distortion of amplifiers, sine wave generators, power supplies etc.

Here is the complete set of instruments that make up the analyzer.
From top to bottom, the modified E-MU 0202 USB Sound "Card" digitizing interface to the PC, the "Pete Millett" Sound "Card" Interface, and on the bottom the combined "pure" Victor Mickevic 1 KHz sine wave oscillator and the 1 KHz Twin-T notch filter.

First a little overview

To measure the performance (here the amount of distortion generated or added) of a black-box system (the Device Under Test - DUT), a very clean and low distortion sine wave (the fundamental) is used to stimulate the DUT, while the output is sampled. The output signal is stripped from the fundamental sine wave by means of a sharp filter, and the remaining residual, the noise and distortion is fed to an FFT system that can show the results.

Following is a picture of the setup needed to measure harmonics, distortion and noise (DHT and DHT+N) from a DUT.

This is a setup that can be used to measure sine wave generators, or to verify the Sound Card interface to the PC and the FFT software.

A high quality low distortion 1KHz sine wave is fed to the DUT, here symbolized as an amplifier. The output signal from the DUT is fed to the Soundcard Interface and is probably attenuated. This interface protects the delicate and sensitive inputs of the other intruments in the chain, like the T-filter and the USB Sound Card, and also facilitates making a few measurements. The resulting output is then fed to a Twin-T filter which removes the 1KHz fundamental. The residual (everything added by the DUT to the pure sine wave) is then fed back into the Soundcard Interface and then going to the USB Sound Card Interface, here a simple SD-AUD20040, where it is digitized and sent to the PC over a USB link. On the PC/Laptop, a software application like AudioTester, is used to show the residual (and noise) by means of an FFT.

This same setup can also be used to measure the noise performance of a power supply. In that case, the power supply output is first stripped from the DC component by using a capacitor (not shown), and then fed to the Sound Card Interface, and from there to the USB Sound Card for digitizing and on to the PC and the AudioTester FFT software.

If you want to measure the quality of sine wave generators or verify the components in the link, you can also use the following much simpler setup.

How you inter-connect the various instruments depends on what they offer. In this example, the output of the sine wave generator is fed directly to the Twin-T filter and the residual is digitized by the USB Sound Card. The Sound Card Interface is not needed, because the input levels can be set low enough, althoug you need to be carefull or use attenuation adapters.

The instruments that are used in the chain

In an earlier post on this Blog, I already described how I put the the "vicnic" very high quality sine wave generator, and an active Twin-T filter in an enclosure.
On the left is the 1KHz sine wave oscillator with a dual output connector. One the right is the Twin-T notch filter, optimized for a 1KHz sine wave.

This instrument is described here:  simple but precise 1khz distortion system

The sound card interface

I also used a DIY Sound Card Interface, to attenuate (high) signals coming from the DUT, which would otherwise destroy the input of the USB Sound Card, or the other measurement components. The output from the Interface then goes to the Twin-T filter and then to an actual USB Sound Card (to digitize the analog signal) connected to a PC. The digitized output of the Sound Card is used by the AudioTester software running on the PC to show the results, typically by an FFT diagram.

The Sound Card Interface above is another DIY project based on a design from Pete Millett and described here

The USB sound card interface

A USB sound card is used to digitize an analog signal (typically music) so it can be send to a PC for prossesing. It's still called a sound "card" interface because in earlier years this was actually an add-on board that plugged-in to a PC slot. With Laptops, that option is no longer possible so a separate intrument with typically a USB interface had to be used instead. 

The same instrument can be used in our chain to digitize the resulting signals for further processing on the PC/Laptop.

During my first baby steps in putting this system together and collecting some experience, I used this inexpensive (around 25 Euros) USB Sound Card Interface:

It worked OK as you can see in the posts I mentioned earlier, but I was not very impressed with the results. It needed further tweaking, adjusting and modifying. After getting it all working and playing with the chain of intruments and making some measurements, I moved on to other projects. So for a few years, I really didn't need this setup so didn't spend any more time on it.

New technology and upgrades broke the chain

When I recently wanted to profile my DIY Tek SG502 rebuild, I put the system together again and quickly made some changes to the inter-connect cabling that makes the connections between the units easier.

However, problems showed-up right away that I had not seen before. It was probably caused partially because in the meantime, I switched to a newer and different Laptop and I also upgraded to W10. I also could have done something wrong during some of my experiments, because I suspect that something in the USB Sound Card box could be damaged because it now shows a lot more harmonic distortion then I remember having seen before.

At first I was mystified to the cause, and could not put my finger on it. I now attribute it to a combination of my W10 Laptop, the W10 sound drivers, the W10 drivers for the USB Sound Card, plus something wrong with the drivers of the AudioTester software, because it is now crashing all the time.

Fault finding...

There were way too many variables in play so I started to address them one by one.

When I used my FY6600 DDS Function Generator, it showed THD+noise performance that looked pretty good and only a little worse than the specifications. 
My unprofiled and just finished Tek SG502 was also just outside the distortion specifications, but that was to be expected. So far so good. 
However, the ultra pure 1KHz sine wave generator designed by Victor Vickenich (vicnic) showed results that were only a little bit better than the other two, so initially I started to suspect the 1 KHz reference. 

To address my first suspect, I got in contact with Victor because I suspected a problem that I must have created with his reference. With his patient and excellent help, we found out by making some measurements on the oscillator itself, that the problem was not due to his sine wave generator. Of course it wouldn't.

I then focussed my attention to the PC software side. I have a license for the AudioTester software, but I was not happy with the overall driver situation after I switched to W10 and I also had problems with the calibration. To eliminate that aspect, I tried another software package, ARTA. I selected this, because there are many references on the web and examples of measurements made using Victor's oscillator in combination with the ARTA software, so I could start to compare. However, it still did not improve on the root cause of the problem I was having, the excessive harmonic distortion on Victor's oscillator. Have a look here...

A better USB Sound Card

It was now time to take the next step, and invest in a better USB Sound Card. After quite a bit of research, I purchased a (brand new) ASUS Xonar U7 from Amazon. To my utter dismay, I found out that the CD that came with the unit did not have W10 drivers. Also online was nothing to be found. C'mon ASUS, we're in the middle of 2017, and you have not updated the CD yet? Obviously, that did not give me a lot of confidence. Making a few measurements did not improve the situation much, so I returned the unit the next day.

Time for a reset. I realized that I lacked the knowledge to get to the bottom of this issue, so I had to learn a lot more first of all. I literally spend a few weeks going through all kinds of Forums and Blogs to see what other people were using, and to learn more about the overall system and the components in the chain in much more detail.

Eventually, after going through many blogs and forum's, I found that there were a number of USB Sound Cards that stood out. The majority were from the same company, the E-MU 0202 and the E-MU 0404 and also a few others. The good news was that they were available on eBay now and then for reasonable prices.
I decided to try to score one of these and after some miss-hits, I scored a used E-MU 0202.

Modifying the E-MU 0202

After I scored the bid for an E-MU 0202, we were out of the country for 7 weeks, so the unit would arrive but I would not get my hands on it. This gave me the time to do some more investigations, so I started to study more about the 0202. 

The ultra-pure 1KHz sine wave generator I have, was designed by Victor Vickenich (vicnic), and I found that he also published a couple of modifications to his own E-MU 0202 Sound Card, with lots of pictures together with the FFT results using the same 1KHz source. Victor was able to get incredibly good results. 

That was to be my reference now.

During my investigations, I also learned that the schematics for the 0202 are very similar to the 0404, although in a different layout and with several value changes and part numbering changes. Schematics for the 0404 are available, but I did not find good ones for the 0202. The various sources of 0202 schematics I found on the Web had errors, or were incomplete.

Since I had nothing else to do at the moment, I took the time to capture all information I could find in my schematic capture program (DipTrace), so I would have a record of the original status, and could put a description together for the modifications Victor did.

Based on the various sources and photographs of the PCB, here is the resulting schematic I was able to put together for the E-MU 0202 "B" channel input to the ADC, the well known AK5385AVF. Here is the data sheet from DigiKey.

E-MU 0202 Front-End Schematic Diagram Channel B 

And here is the slightly more complex "A" channel:

E-MU 0202 Front-End Schematic Diagram Channel A

For the time being, I left out all power related parts. I may add them when needed, because at the time, I was considering adding an external separate power input, instead of using the (typically very noisy) USB 5V coming from the PC. That's a potential project for later.

My plan was that as soon as I got home and could start to work on my unit, I would start with the modifications that Victor made to his 0202. He eliminated much of the front-end of the unit and only used the "B" channel. He also uses an attenuation of his own, so there was no need for the input section. 

I will be using my Sound Card Interface only for this application, so this is no limitation for me either. Cutting that input section out of the loop saves a number of dB's in noise, and turns the Sound Card (more accurately a digitizer) more into a tailored measurement instrument.

Modifying my E-MU 0202

The EMU0202 I scored on fleabay was supposed to be working, but the output amplifier did not. I could not find the error, but I really didn't care. I wanted the digitizing front-end, so I applied the same modifications Victor published and did on his 0202.

Here are the two links to Victor's modifications and measurement results, they start with post #171 on page 9:
Victor's modifications and results

Scroll to page 10 and post #184 to get to his contribution with the photographs and the modifications. 
Note that a little below this post is another one from him with a correction to the value of R46, which needs to be 6K8. This is in post #187.

Below is the schematic information I put together for his modifications to the "B" channel, and highlighted the parts to be removed to isolate the front-end components to ADC input.

The volume control potmeter is removed to make place for an RCA or BNC connector on the front panel. I used a BNC connector myself.
The two removed series resistors, R54 and R32, both 1K4, will isolate the front-end input from the drivers for the ADC. The two resistors that are used to create the dynamic zero balance, R35 and R41 need to be removed too.

Following are the value changes and the new additions to form the new input circuit to the ADC.

The RCA or BNC connector can be mounted on the front panel in the hole of the R-Hi-Z/Line potmeter. I had a BNC connecter and this fitted perfectly. After that, the input series resistor, the capacitor and the input Z resistor can be mounted Manhattan style. Note that Victor mentioned that this resistor can be tweaked in value to remove artifacts. I kept mine to 220K.

Three feed-back resistors change in value.
R28 : replace the 1K value to 6K8.
R46 : replace the 1K value to 1K5
R34 goes from 1M to 1K. (Victor used the original removed 1K resistor from R28 and simply soldered that on top of R34 with the 1M value.)

Finally, the connection from the output of U6-B to the input of U6-A can be created by soldering the second removed 1K4 resistor, (the originals are too small, I used a new 1K5 0603) "Tomb Stone" and with a small wire to the input of U6-A. His detailed photographs show the way.

The results are stunning

Connecting his reference oscillator to my now modified EMU0202 shows rather stunning results I think:

So now my modified EMU0202 digitizing front-end together with Victor's high quality oscillator, is a perfect reference combination for my distortion measurement applications.

As you can see from the picture below, I used a BNC as the input connector.

Here is a screenshot of the modified EMU0202 with my analog DIY Tektronix SG502:

The measured THD of 0.026% of my DIY re-build is actually better than the Tektronix specification of 0.035%. Not bad at all!

And here is the result from my digital FeelTech FY6600-30 Dual Channel Function/Arbitrary Waveform Generator:

So with the described changes to my setup I finally have solved the issues I had in the chain. 

Next step will be to add in the Pete Miller Soundcard Interface and do some more measurements.

It may take a while, I have a few other projects I'm working on, but stay tuned for more...


If you like what you see, please support me by buying me a coffee:


Roberto said...

hello mysound card e-u 0202 usb bought on ebay but I use it as a sound level meter for 78xx stabilizers etc. the program i use audometer mic input i wanted to know to improve what changes i can make? thank you

paulv said...

I suggest you make the same modifications I describe in this post.

Anonymous said...

Thanks before making the changes I wanted to test the card from the tests carried out with spectrumlab by selecting emu usb the trace goes below -190db I think it's not good instead if I use emu asio as draiver in the selection with the potentiometer at minimum -150 of the graphic scale if I put pot at most goes -100 in this case swmbra ok I don't understand why with EMU USB draiver doesn't work (I'm using windows xp) tanks Roberto