# THD measurement.

Discussion in 'Wireless & RF Design' started by PRS, Apr 28, 2010.

1. ### PRS Thread Starter Well-Known Member

Aug 24, 2008
989
35
I've been wondering how to measure harmonic distortion in the lab. I got a hint from one source on the web. Is it possible to use a variable bandpass filter to determine the amplitude of the harmonics? I mean, say I had a filter that could vary the frequency by a factor of 4. Say I could tune to 1kHz then 2kHz 3kHz and 4 kHz. Would I be able to calculate the THD from this?

Apr 5, 2008
15,805
2,389
3. ### PRS Thread Starter Well-Known Member

Aug 24, 2008
989
35
I wish I had a spectrum analyzer! Unforturnately, I can't afford one. I was hoping to find another method and I found one in a book I own: The Electronic Circuits Problem Solver, problem 6-5.

It's a lot of work, as it involves plotting the curve of Ic from samplings. Then you use the samples to determine the coefficients of the Fourier Series for a sine wave. These give you the amplitude of the harmonics which you then plug into an equation that gives you the ratio of the average value of the harmonics with respect to the fundamental.

I'll post it if you want. It's 4 pages long.

Jul 7, 2009
1,585
141
There are a few different ways to do this. The first step is to define what you mean by THD, as there are a few incompatible definitions (e.g., based on power or voltage).

If you have to do a bit of this, there are older instruments called selective voltmeters that can do this (HP and General Radio made some and you can still sometimes see them on ebay).

You don't say what your accuracy requirements are; measuring low (say, under 1%) distortion levels can be a bit of a challenge. A method that I'd trust to around 5-10% accuracy would be to use the FFT of a digital scope.

If you have an adjustable filter (e.g., those made by Krohn-Hite), you can use it as a low pass filter to measure the amplitude of the fundamental, then measure the whole waveform. To make accurate measurements, you need to know the filter's response and make sure the contribution of any non-fundamental harmonics is negligible.

There are meters that measure distortion, such as the ones by HP with model numbers in the 330 range. These can still be found on ebay. You can also sometimes find distortion meters made by Leader on ebay.

For a few measurements, doing things by hand isn't a big deal. We used to have to do all our calculations, plotting, etc. by hand and one just got used to it...

5. ### studiot AAC Fanatic!

Nov 9, 2007
5,005
515
let me turn this on its head.

Have you ever selected one or two itms on a PC an then gone edit>invert selection
So you end up selecting everthing except one item?

It's a bit like that.

Yes you can use a filter as you describe, but that's the hard way.
The easy way is to use a notch filter to deselect the fundamental.
Then everything else left is distortion (+noise).

Years ago distortion analysers worked like this with a tunable notch filter.

Spectrum analysers of the same era worked the way you have described measuring each harmonic individually by filter.

It is of course possible to make a very good fixed frequency filter easily and cheaply if you can put up with a few spot frequencies this is the way to go.

Spot frequencies also help with the second problem - to measure the distortion added by say an amplifier you require a source of lower distortion signal.

6. ### PRS Thread Starter Well-Known Member

Aug 24, 2008
989
35
I don't have a selective voltmeter or a digital scope or spectrum analyzer. I'll check out e-bay for the voltmeter and the adjustable filter. When you say plotting, do you mean the method I was refering to? I might try it once just to see what happens. As it is, I'm not in actual need of doing it. I'm retired and electronics has become my hobby. I was just helping TheExtremist over on the homework board and decided his feedback amplifier project was worth doing myself. One of the specs was a very low THD. I've got a circuit that meets all the other specs on a breadboard right now. The output signal is a pure sine, triangle, ramp or square wave at 1kHz, so I think I'm meeting the distortion spec, too. But I can't be sure. I wish I had a spectrum analyzer!

7. ### PRS Thread Starter Well-Known Member

Aug 24, 2008
989
35
I understand the logic of your methods, studiot. But it seems to me you'd have to have a really sharp filter to exclude the fundamental from the 2nd and 3rd harmonics. How accurate is this method?

As for the old spectrum analyzers what do you mean? A variable bandwidth filter would sweep the frequency with a horizontal amplifier while the verticle amplifier projected the voltage? I have suspected such to be the case, but I didn't know it.

Apr 5, 2008
15,805
2,389
9. ### studiot AAC Fanatic!

Nov 9, 2007
5,005
515
They were called wave analysers, these instruments are as old as the hills, but were thoroughly reliable.

Here is one from 1941

There were two basic types, the heterodyne type and the RC tuned type.

Heterodyning was a much used technique once upon a time. The most reliable audio generator I have ever had was an ancient heterodyne model I bought in 1971

Jul 7, 2009
1,585
141
PRS, if you're really interested in doing this and don't mind spending a few bucks, I'd recommend picking up an HP distortion analyzer on ebay. You can find manuals for them for free and if you put some work into it, you could probably have a nice working instrument. They often go in the \$50-\$100 range. Over the years I toyed with getting one, but finally decided against it because knowing the distortion isn't something I care about very often. And, if I do, I'd just figure out a way to digitize the waveform (e.g., download it from the scope) and do the calculations with a python script. When I worked at HP, a friend in electronic maintenance said one of the best that HP ever made was the 334 (and it was a pretty popular model).

A friend sent me his old HP 331 a number of years ago, but it was smoke damaged from a fire and didn't work. Even if you get one that doesn't work, you can still take it apart and reclaim the high quality parts inside (the HP meters are especially good -- I've used them to make microgram balances, which is a fun thing to fool around with).

11. ### PRS Thread Starter Well-Known Member

Aug 24, 2008
989
35
I tried to download the program but my computer wouldn't let me. I'm using Visa, perhaps that's the problem? Thanks anyway.

12. ### PRS Thread Starter Well-Known Member

Aug 24, 2008
989
35
I understand, thank God. This might become a future project. Thanks.

13. ### PRS Thread Starter Well-Known Member

Aug 24, 2008
989
35
I think your right, someonesdad. I'd like to have one of these things. I'm quite serious about this hobby and I especially getting to the bottom of subjects that, in my schooldays, I really didn't understand. I mow lawns for extra cash nowadays and I'll have to mow a few more before I can make a bid. But thanks.

14. ### retched AAC Fanatic!

Dec 5, 2009
5,201
313
Forget cutting grass.

Dog poop is where its at.

\$50/week a yard for one dog. \$10/week each additional dog

tuesdays and fridays.

You will EASILY find customers. THEY hate picking up poop. Get a 5gal bucket a roll of trash bags and a pooper scooper. Your set.

Just remember us little guys when your sitting pretty.

15. ### PRS Thread Starter Well-Known Member

Aug 24, 2008
989
35
LOL! I think I'll stick with lawns. But I have considered washing windows. I know a guy who makes good money at it and works his own hours. No boss. I like that.

Nov 9, 2007
5,005
515
17. ### retched AAC Fanatic!

Dec 5, 2009
5,201
313
PRS, I just noticed you had a problem with the software running in Vista.

Right click the icon and under properties, select Run in Compatibility Mode.

Select XP or anything but Vista and try again.

18. ### KL7AJ AAC Fanatic!

Nov 4, 2008
2,047
295
The traditional distortion analyzer (by the way, you can now get these dirt cheap on Ebay, now that a lot of analog broadcast stations are now all digital) uses a NULL circuit to eliminate the fundamental signal, detecting only the remaining power. This is still very effective if you only need TOTAL harmonic distortion, and don't care about the particular components thereof.

Eric

19. ### PRS Thread Starter Well-Known Member

Aug 24, 2008
989
35
I see that there is ongoing thought about all of this. Personally, I like the idea of knowing the THD. And it seems like this applies to audio and radio frequencies. But I should think the appuratus for determining this distortion varies with frequency?

20. ### retched AAC Fanatic!

Dec 5, 2009
5,201
313
The device would need the bandwidth capable of measuring the required frequencies. So yes.