Show by Label

Tuesday, May 19, 2015

Building a Simple 1KHz Distortion Analysis Tool (upgraded)

For my audio projects, I wanted to have a method of simply measuring distortion without buying (too costly) or building a (too complex) full-blown analyzer.

I started out with a very low distortion 1KHz sine wave generator and a Twin-T filter, and put them in the same enclosure.

This is the resulting instrument.



The low distortion sine wave generator is to feed the DUT, and at the output, use a filter to supress the sine wave again. What is left should be the distortion created by the DUT and some additional noise.

The components

As it turns out, designing a very low distortion since wave generator is not that easy. Luckily I found a unit that is excellent for a reasonable price. It is called the Mickevich (the designer) Ultra Low Distortion  (<0.00001%) 1 KHz Sine Wave Generator.

What was left was to design a precise filter, the required power supply and the box to put it all in to.

In addition, I needed an external sound card interface that is used as a digitizing front-end for the PC-based FFT analyzer.

I described this project on a diyaudio forum where much more information can be found about the oscillator, and the filter I used : http://www.diyaudio.com/forums/equipment-tools/252751-simpel-1-2-diy-1khz-distortion-analysis-tool.html 

When I picked-up my electronics hobby again after I retired (early), this was one of the very first projects. I wanted this tool because at the time, I was designing and building headphone amplifiers to be used in a plane. 

In 2022, I decided to describe the unit here in more detail, so I'm not depending on the diyaudio Forum. I also decided it was toime to design a PCB and use better components for the filter, as they were recommended on the Forum.


The Ultra Low Distortion Oscillator

In order to make good measurments you need to have a very low distortion sine wave oscillator. I found the Victor Mickevics design and purchased one for 1 KHz.


Victor uses a novel FET-based AGC design with a rather simple circuit to get astounding results.

The results for this little board are stunningly good. Here it is measured with non-professional equipment and that shows only 0.0003% THD and 0.0024% THD+N. The actual specifications are even better with second harmonic at -136 dB (0.15 ppm) and third harmonics so low it cannot be measured (< -140 dB).




Unfortunately, it seems Victor is no longer active and selling them.

The Twin-T Notch Filter


The Twin-T notch filter is based on a simplified design from Dick Moore (richiem) here are the details
I tailored his design for just a single 1 KHz operation.

Here are the schematics that I put together for the combined instrument:

The power supply

The sine wave oscillator needs about 35VDC or a little higher, to create a +/- 15V.
The Twin-T also needs +/- 15V, but I didn't want to use the supply already on the oscillator. I did not want to disturb it.


This supply feeds the 1KHz oscillator with about 34VDC and the Twin-T notch filter with a balanced +/- 15V supply.

As I typically do, I use a separate AC transformer outside of the box, to avoid mains hum etc. WHen I was winter birding in Texas, I used a Rainbird 24VAC transformer, alas that was only for 115V.

Back in Europe, I use a 12-0-12VAC transformer for several projects, so I used the 24VAC to feed the power supply.

Because Victor's oscillator needs 35VDC, I could use a full bridge rectifier and an LM317 and keep things cool, rather than using a doubler and deal with 70VDC as input to the LM317. They will get hot, causing temperature related drifts. I also did not want to "steal" the +/- 15V coming from Victor's oscillator to feed the notch filter, so I added it's own supply. To create just enough headroom for the first LM317, I adjusted the output going to the oscillator to 34V, instead of 35V.

The second LM317 is used to supply 30VDC, that is split into +/- 15V.


Twin-T Notch filter


Here is the original filter circuit:


I used two (cheap) 1K 10-T pots for the filter, and shunted them with 1K. This will still leave them linear enough. Even with this shunt, the adjustment is still a little too coarse for my liking. 
I use R11 and R15 (rather than 10T trim pots) to set the filter notch about in the middle of the 10T filter pots.

To get the filter as accurate as possible, I purchased 8 good 10nF caps, and sorted them by value to get the optimum balance of the filter. The measured values are in the schematic. At the time I used a cheap Arduino based capacitance meter, which turned out to be less precise. 


Enclosure:

Because I also wanted a nice enclosure, and not very expensive, I used a plastic one that only set me back $27.  I needed to shield the inside and did that the easy way by using copper foil (look for guitar hum materials) and made two boxes out of some circuit board material. So far this seems to be adequate.

Pictures of the instrument








After I was done and started to test things, I added an additional toggle switch to the instrument with an input attenuator.

Improvements

Based on inputs on the Audio Forum, I learned that I can improve the notch filter some more by using better filter capacitors, the special audio film kind, and by using a better Opamp for IC1 (an AD797 or an LME49990).  I now have the capacitors and the AD797 in stock.

Since then, I also purchased a higher precision capacitance meter, the Juntex LC-200A. A very good meter for the price. I can do a much better job matching the values. I should update the filter with the better tuned filter capacitors, and change the OpAmp.

UPDATE:

So in 2022, I decided to pick-up where I left and upgrade the Twin-T Notch filter. Now that I'm a lot more experienced with PCB design, I created a new schematic and a layout. 

Here is the updated schematic:



Basically the same circuit, just some different resistor values and the Opamp changes.

I used the Eagle to KiCad import system, but what a mess that creates when you want to make changes and add layouts/components etc. I may end up redoing the schematic from scratch to get it clean, but for now, I have a layout. Because I'm starting with better capacitors for the filter, I re-calculated the resistor values accordingly. They now follow the theoretical values. 


The Opamps will go in gold plated DIL-8 sockets so I can easily replace them.





Here is the completed unit after the upgrade.



Note that there is no more room for the PCB-made box.

After powering it on and letting it warm up, I had to tweak some resistor values (R4, R5, R8, R9 and maybe R13) again to get the trimmer and the two potmeters roughly in the middle of the range to have an even spread either way of the sweet spot. The values are in the schematic above. With these new values, the trimmer has a good range, and the two pots are tuned to be in the middle of the range. 
Adjusting them with these changes works great, I'm happy.

The PCB can be ordered from your favourite supplier. 
The Gerbers are on the Github :  https://github.com/paulvee/Twin-T


Enjoy!
paulv

If you like what you see, please support me by buying me a coffee: https://www.buymeacoffee.com/M9ouLVXBdw

5 comments:

Anonymous said...

Hello, in the text of the calibration of the new version of the filter, it says to adjust R17, I think it should say R12, and the paired capacitors C3, C4, C5 and C6, is that correct?

paulv said...

No, not really. The idea is that it's easier to adjust the resistors to get the adjustments roughly in the middle and leave the capacitors alone. I have updated the tweaking a bit in the Blog.

charles rydel said...

You have too much noise because the resistors are still too high into the rejector.
By dividing them by 10 and multiplying capacitors by ten, you could gain up too 10dB in S/N.
The same applies to the oscillator, but within the limits of the output current. Here, you'll have to experiment.

paulv said...

Thank you for the comment Charles.

charles rydel said...

Hello, Paul,

One more thing. The feedback from the bottom of the T-filter can introduce distortion and even its own noise. Perhaps (perhaps) it would be better to use a second- or 3rd-order low-high filter with a sufficiently high Q to compensate for the 9.5 dB loss on H2? This would also improve overall rejection by 12 or 18dB...

Charles