Some rectifications are needed here: first, the distortion of a pure square wave is something like 46.7%, not 43.5%.The Electrician said:The 339A isn't capable of .001% accuracy. :-(
But as I mentioned in post #13, a measurement would have to include harmonics up to the 867th to get .1% accuracy with a square wave input, so you would have to use a fundamental of no more than 380 Hz with the full bandwidth of the instrument.
If you're satisfied with 1% accuracy using a square wave, you only need to see up to the 87th harmonic, which would be about 3800 Hz with the full bandwidth of the instrument.
So, use a square wave of several volts amplitude and 1 uS or so rise time at 1 kHz, full bandwidth of the 339A, and you should get a distortion of close to the theoretical value of 43.5%. Or, use a triangle wave, and see something close to the theoretical value of 12.027%.
And in order to get less than 1% relative error on the distortion, you only need up to the 25th harmonic. I didn't make the calculations for 0.1%, because as has been pointed out, such an accuracy is totally ludicrous for distortion measurements. 1% is already extremely ample.
Elvee said:
Some rectifications are needed here: first, the distortion of a pure square wave is something like 46.7%, not 43.5%.
And in order to get less than 1% relative error on the distortion, you only need up to the 25th harmonic. I didn't make the calculations for 0.1%, because as has been pointed out, such an accuracy is totally ludicrous for distortion measurements. 1% is already extremely ample.
I searched the web to see if I could find where you got the 46.7% number, and I found this site:
http://www.vk1od.net/SquareWave/THD.htm
If that's where you got the number, you should be aware that the calculation on that page is in error.
In Figure 2, he has the function f(x) = (1 - 4/pi*sin(x))^2, which is the correct function up to that point.
But in Table 1, he left out the 4/pi factor in the calculation for the RMS responding meter (and the average responding one, too). If you put back this factor and do the calculation, you will get 43.5% distortion for a square wave.
Or, work it out from the definition of THD:
Total power of harmonics
----------------------------------------------------
Total power of (fundamental+harmonics)
like this:
SQRT(1/9 + 1/25 + 1/49 +...+ 1/(2n-1)^2)
---------------------------------------------------
SQRT(1/1 + 1/9 + 1/25 + 1/49 +...+ 1/(2n-1)^2)
Let n be 1000 or so, and use Matlab or something to add them all up and you will get something around .435
The theoretical value for n -> infinity is 100*SQRT((pi^2-8)/(pi^2)) = 43.52362%
You can also use the quotient of series to find that including up to the 87th harmonic (n=44) will give a value of 43.0906%, just a tiny bit less than 1% smaller than the exact theoretical value.
jackinnj said:
It will work down to a little above 0.001%, however --
I was referring to relative error (percent of reading), not absolute error.
The figures I gave pertain to another definition of distortion, which is the ratio of the rms voltage of harmonics to the rms voltage of the fundamental, as shown here f.e.:The Electrician said:
I searched the web to see if I could find where you got the 46.7% number, and I found this site:
http://www.vk1od.net/SquareWave/THD.htm
If that's where you got the number, you should be aware that the calculation on that page is in error.
In Figure 2, he has the function f(x) = (1 - 4/pi*sin(x))^2, which is the correct function up to that point.
But in Table 1, he left out the 4/pi factor in the calculation for the RMS responding meter (and the average responding one, too). If you put back this factor and do the calculation, you will get 43.5% distortion for a square wave.
Or, work it out from the definition of THD:
Total power of harmonics
----------------------------------------------------
Total power of (fundamental+harmonics)
like this:
SQRT(1/9 + 1/25 + 1/49 +...+ 1/(2n-1)^2)
---------------------------------------------------
SQRT(1/1 + 1/9 + 1/25 + 1/49 +...+ 1/(2n-1)^2)
Let n be 1000 or so, and use Matlab or something to add them all up and you will get something around .435
The theoretical value for n -> infinity is 100*SQRT((pi^2-8)/(pi^2)) = 43.52362%
You can also use the quotient of series to find that including up to the 87th harmonic (n=44) will give a value of 43.0906%, just a tiny bit less than 1% smaller than the exact theoretical value.
http://zone.ni.com/devzone/cda/tut/p/id/3401
It is the definition generally used in Europe for audio purposes.
I'm aware other definitions exist, including yours.
I will certainly not take sides in this matter and say that my definition is better than yours; the important thing is to know exactly what we're talking about.
Anyway, when distortion figures are small, the two methods give very close results; in the case of a square wave, there are significant differences, and in particular, the much slower convergence with your method, due to the presence of the harmonics in the denominator of the expression.
Also note that in the case the square wave is "diluted" in a large amount of fundamental, both methods will yield similar results and will converge at speed of "my" method: i.e. 1% relative accuracy obtained at 25th harmonic.
Elvee said:
The figures I gave pertain to another definition of distortion, which is the ratio of the rms voltage of harmonics to the rms voltage of the fundamental, as shown here f.e.:
http://zone.ni.com/devzone/cda/tut/p/id/3401
It is the definition generally used in Europe for audio purposes.
I'm aware other definitions exist, including yours.
I will certainly not take sides in this matter and say that my definition is better than yours; the important thing is to know exactly what we're talking about.
This thread was started with a question about checking the calibration of an HP339A. This instrument uses the definition of THD which is commonly used in the US for measuring audio distortion (in post #42, where I said "Total power of...., I meant to say "RMS value of...":
RMS value of harmonics
---------------------------------------
RMS value of (fundamental+harmonics)
The definition you are using is used by the power industry in the U.S.
See: http://en.wikipedia.org/wiki/Total_harmonic_distortion
They say: "...for audio measurements 100% is preferred as maximum, thus the IEC version is used (Rohde & Schwartz, Bruel and Kjær use it).", and then they show a definition which is the same as that used by the 339A, squared. This definition has the power of (fundamental+harmonics) in the denominator instead of just the power of the fundamental.
I would have thought that Rohde & Schwarz or Bruel and Kjaer would be common instruments in Europe, and that the IEC method would be the one commonly used in Europe for audio measurements.
Can any Europeans verify the method used by the aforementioned European instruments?
But regardless of which method is common in Europe, the theoretical distortion for an ideal square wave, including all the harmonics, using the method you're using (the IEEE method referred to in the Wikipedia article, and also on the web page you referenced: http://zone.ni.com/devzone/cda/tut/p/id/3401) is not 46.7%, but rather 48.34%.
The exact value is 100*SQRT((pi^2-8)/8) = 48.34258...%
The distortion of a square wave up to the nth harmonic can be calculated for the definition you used (the IEEE definition) like this:
RMS value of harmonics
------------------------------
RMS value of fundamental
or:
SQRT(1/9 + 1/25 + 1/49 +...+ 1/(2n-1)^2)
----------------------------------------------
1
If I use the figure you have given for the distortion of a square wave, namely 46.7%, then the expression just above is indeed within 1% of 46.7% when harmonics up to the 25th are included, but as I said the 46.7% number when using your definition of THD is incorrect.
If you use as a reference the correct figure of 48.34258%, harmonics up to the 107th must be included to get 1% relative accuracy.
- Status
- Not open for further replies.