Experiences with software thd, sine generating

Status
Not open for further replies.
Why?

You asked:
I don't have neither a ultra low thd sine gen nor a precise thd analyser. I have a very old Terratec soundcard which has a wavetable for sine gen and a 24bit/192 kHz sample Julia soundcard. Any hint, experiences, software very appreciated.

You have gotten answers to your question. If you want to play around with models rather than real measurements, feel free to, but that's off topic.
 
2 SY
Nice performance- what's the preamp topology?
Quite "normal" ,modular, VFA stages, full bipolar. Balanced In/out stages, internally unbalanced, relay based attenuator with 0,5dB step with 1kohm impedance. For comparision is card only loopback picture attached, under same conditions.
2 hahfran
LTspice sine source is intended as ideal, so a,b,c answer is zero THD (not THD+N!!)
Fourier components of V(in)
DC component:-2.27707e-015

Harmonic Frequency Fourier Normalized Phase Normalized
Number [Hz] Component Component [degree] Phase [deg]
1 1.000e+04 1.800e+00 1.000e+00 -0.00° 0.00°
2 2.000e+04 1.834e-12 1.019e-12 -0.15° -0.15°
3 3.000e+04 2.750e-12 1.528e-12 -0.08° -0.08°
4 4.000e+04 3.668e-12 2.038e-12 -0.03° -0.03°
5 5.000e+04 4.585e-12 2.547e-12 -0.01° -0.01°
6 6.000e+04 5.501e-12 3.056e-12 -0.01° -0.01°
7 7.000e+04 6.418e-12 3.566e-12 0.01° 0.01°
8 8.000e+04 7.334e-12 4.075e-12 0.01° 0.01°
9 9.000e+04 8.252e-12 4.584e-12 0.02° 0.02°
Total Harmonic Distortion: 0.000000%(0.000000%)
 

Attachments

  • 1k_loopback.png
    1k_loopback.png
    17 KB · Views: 194
🙂,
THD= the ratio of the sum of the powers of all harmonic components to the power of the fundamental frequency (expressed in % of power for fundamental frequency).
What is power of harmonics for ideal (without harmonics, only fundamental frequency..), non distortive sine source??
But if you want to play with words, "infinitely close to zero"..
 
Last edited:
hahfran, THD calculation formula is attached.
For ideal sine wave source, all components at the top are zero, so THD = 0.
As simple as that. No approximation required. Number of digits normally used for calculation is enough to consider it "zero".

In a live measurement, you run FFT, get the values for each V and then use this formula to calculate THD. Of course, you can take in account more or less harmonic components, but in the end the level of accuracy is mostly influenced by the level of hardware linearity. I don't mention noise now - a separate story.

P.S. I was writing in parallel with BV 🙂

P.P.S. I still don't understand what you are trying to prove. The level of precision we show cannot be reached with the computer card? This is not the case. Depends on the card. If you want to do a direct comparison of the results from the good computer-based measurement system versus the well-known-branded hardware analyzers - you can do it. It will take some time and money, but why not, if you need it. Although, most of the people here don't, I believe 🙂

External loop-back measurement gives you resolution level of the measurement system with particular equipment. If it's good enough - ok. If not - one looks for some more expensive / precise solution. External loop-back does not lie. If you know what I mean 😉
 

Attachments

  • THD-calc.png
    THD-calc.png
    1.3 KB · Views: 188
sorry i played a joke on you... of course the sine voltage source cannot produce an ideal sine. As said mathematical minded knows, sin(x) is computed as the finite sum of an infinite power series of x, the sum is sin(x) for all x where x member of R. Sorry, couldn't resist.
Thus you have an almost sin(x). Anyway, I have gratefully learned from this thread i can safely use the Juli@ card, stay away from thd mania, just be satisfied with harmonics spectrum. Of course, a passive attenuator is a must. Thanx again
 
Sound cards are the ideal tools for DIY people, so it makes sense to feel the love bursting out of the fan club members contributions. Otherwise, for anything resembling precision, sound cards are not that good.

a) Dependencies on the signal level. Try measuring THD at 100mV and 3V level and see if you get the same ppm THD numbers. This applies for both the source and the analyzer.
b) Ever bothered by the AC coupling only?
c) Lack of precision attenuators. DIYing your own is not as simple as it appears.
d) Lack of any transparent input protection. One mistake and your expensive L22 card is gone to the silicon tomb.
e) Lack of good single ended performance (noise, spurious components). It's easy to proudly show the balanced input performances, not so easy for single ended. This applies for both the internal and external sound cards, worse for internal, of course.
f) Low (<20Hz) frequency distortions.
g) Rising noise floor level beyond some 50KHz, which makes precise 20KHz ppm THD measurements virtually impossible. Some cards could be better than others, though.

Note, this is not about the AD and DA converter chipsets performances used in these cards, but about the rest of the parts (op amps, cheap lytics, cheap thick film resistors), the circuit topology (always ac coupled) and the missing features, all designed and build to accommodate the audio performance and not some instrument standard.

It could be argued that sound card are good enough for DIY use, and I would agree. Unfortunately, there are those who believe that a sound card is the holy grail of audio measurements. Obviously, they never had a chance to take a look at what an AP 27xx or a Rohde UPV can reliably and reproducible do. And no, no need to pay the price for these monsters. Any used 16 bit audio analyzer you can get for less than a L22 and (to extend the dynamic range) a double T filter (well build and well characterized), will do the same job as the sound card, without any of the soundcard pitfalls.
 
Comments in red.

a) Dependencies on the signal level. Try measuring THD at 100mV and 3V level and see if you get the same ppm THD numbers. This applies for both the source and the analyzer. Yes
b) Ever bothered by the AC coupling only? No. For DC, I use a meter.
c) Lack of precision attenuators. DIYing your own is not as simple as it appears. It was pretty simple, and if one doesn't want to home brew, Pete Millett has done the hard work. I'll show some of my useful little jigs in my upcoming AudioXpress article.
d) Lack of any transparent input protection. One mistake and your expensive L22 card is gone to the silicon tomb. Ditto.
e) Lack of good single ended performance (noise, spurious components). It's easy to proudly show the balanced input performances, not so easy for single ended. This applies for both the internal and external sound cards, worse for internal, of course. Not at all difficult, no more so than setting up an AP. As with any test & measurement system, attention must be paid to grounding and interfacing.
f) Low (<20Hz) frequency distortions. Nope, not at 10Hz and up.
g) Rising noise floor level beyond some 50KHz, which makes precise 20KHz ppm THD measurements virtually impossible. Some cards could be better than others, though. I do see that, but the rise only cuts my noise floor to -100dBV at 90kHz, which I can live with

Bottom line: I get 90% of the functionality of the high price gear (I have access to a lot of great gear from Rohde & Schwarz and Bruel & Kjaer) for <5% of the price. The only real lack is resolution of upper harmonics at 20kHz.
 
When LTSpice is set up correctly for simulating THD, the errors in the sine approximation due to sampling are cancelled out by the errors in the Fourier analysis due to sampling, so you can actually get zero harmonic distortion. And of course simulated components have no noise. 🙂

I see that you got 16ppm from soundcard+preamp under test, and 16ppm from soundcard alone. This is similar to my experiences with power amps. A power amp generates more distortion than a preamp, but my soundcard wasn't quite as good as the Lynx.
 
Last edited:
Comments in red.



Bottom line: I get 90% of the functionality of the high price gear (I have access to a lot of great gear from Rohde & Schwarz and Bruel & Kjaer) for <5% of the price. The only real lack is resolution of upper harmonics at 20kHz.


If you are happy with a -100dB floor (as you seem to be happy without the precise 20KHz harmonics information), then I assume we are talking about different levels of performance. -100dB is 10ppm, so I think you don't care for anything less than 30-50ppm of THD. Rightly so, from an ears only performance evaluation, my beef is with those claiming <1ppm distortion and claiming they successfully and reproducibly measured that using the ubiquitous sound card.

Anyway, I would be very interested in

c) Lack of precision attenuators. DIYing your own is not as simple as it appears. It was pretty simple, and if one doesn't want to home brew, Pete Millett has done the hard work. I'll show some of my useful little jigs in my upcoming AudioXpress article.
d) Lack of any transparent input protection. One mistake and your expensive L22 card is gone to the silicon tomb. Ditto.
The usual pair of diodes protecting the input would fail miserably because of their nonlinear capacitance, they need to be (before anything else) bootstrapped to avoid that. Even so, reaching a ppm level of distortion is not trivial, peeking at the 8903B (note, that is still far from that performance) schematics would reveal how complex can a low distortion input stage quickly become. It could be argued that an opamp is keeping the differential voltage close enough to zero, however in that case the common mode distortions will take over as the largest distortion contributor (again, I'm talking ppm's here).

Frequency compensating the input attenuators is far from being simple (and to add insult to injury, very implementation/layout dependent). Pete Millet (otherwise, nice) input stage is a joke when it comes to such details. Again, take a look at the complexity of these (so called LF)attenuators in a professional instrument schematic.

Yes, I know, no need to mention it again, you are not an engineer and you anyway don't see any DIY need for such pesky details. To your benefit, I have to admit you never claim ppm level distortions (like others here, concerned about the impact of the resistors voltage coefficients, or the skin effect in audio PCB traces) so indeed no wonder you are happy with any sound card of decent build.

P.S. When your sound card is dropping -3dB at 20Hz, I wonder how you would use it to determine the 1/f noise corner in a bipolar preamp, somehow I don't think the DC meter will help. Oh wait, you don't care about that.

P.S. The bad single ended performance has not necessary much to do with grounding, ground loops. For sound cards, it is the effect of:

a) the adverse environment it is placed into (PC case, lots of SMPS around, screening is far from being good enough (because nobody cares about, and that's not cheap to properly implement) and
b) the lack of an essential feature of any decent instrument: the ability to float the inputs/outputs. I still have to see a sound card that allows to float the analog I/O.
 
Last edited:
When your sound card is dropping -3dB at 20Hz...

That is true of exactly none of the ones in house. They all show -3dB well under 5 Hz; in fact I use them to measure cartridge/arm fundamental resonance. I suspect that you're able to extrapolate a 1/f noise floor at any corner frequency likely to be encountered in the real world.

I've never seen a 1ppm claim, certainly not in this thread, and frankly, that's irrelevant for audio. 10ppm (and in my case, a bit under) is quite sufficient, being about 3 orders of magnitude better than needed for audio. And just to put that -100dB noise floor in context, that's only at 90kHz; up to 45kHz or so, it's better than -130dBV.

The bad single ended performance has not necessary much to do with grounding, ground loops.

Nonsense. It has everything to do with it. Get that right and the measurement performance is excellent.

I still have to see a sound card that allows you floating the analog I/O.

Did you read answer c)?
 
Bipolars can easily have a corner frequency of around 5Hz or less, tubes and jfets not so much. Use your own advice, and don't suspect anything, try it with your sound card before making bold statements.

I did read your c) answer and I'm waiting for clues on your revolutionary design that would implement a quality yet simple attenuator compensation and input stage protection. However, given your interest of 10ppm or more, I see no reason for spending money on that Audio Express.

If you don't care of the 20KHz 3-5 order harmonic, then no wonder you are happy with a 35dBV/octave noise floor increase.

So you are claiming that even spurious noise components (or the so-called "grass") have only to do with grounding and ground loops. Really? I guess you never used a CCFL in your lab... Oh, wait, in fact you don't care about the spurious noise, right?


That is true of exactly none of the ones in house. They all show -3dB well under 5 Hz; in fact I use them to measure cartridge/arm fundamental resonance. I suspect that you're able to extrapolate a 1/f noise floor at any corner frequency likely to be encountered in the real world.

I've never seen a 1ppm claim, certainly not in this thread, and frankly, that's irrelevant for audio. 10ppm (and in my case, a bit under) is quite sufficient, being about 3 orders of magnitude better than needed for audio. And just to put that -100dB noise floor in context, that's only at 90kHz; up to 45kHz or so, it's better than -130dBV.



Nonsense. It has everything to do with it. Get that right and the measurement performance is excellent.



Did you read answer c)?
 
Perhaps you could point out that spurious noise in my preamp spectra posted earlier in the thread?

Tough luck, they usually start where you don't show and care about, that is above 40-50KHz. They may be swamped in your 35dBV/octave noise floor.

No point continuing this, I made my points for those who get it. Over an out for the night.
 
Tough luck, they usually start where you don't show and care about, that is above 40-50KHz. They may be swamped in your 35dBV/octave noise floor.

No point continuing this, I made my points for those who get it. Over an out for the night.

I seem to have missed the point, unless the point is that pro test equipment is better, but for 99.9% of DIY use this improvement is not worth the money, and the other 0.1% are pros or semi-pros anyway?
 
I seem to have missed the point, unless the point is that pro test equipment is better, but for 99.9% of DIY use this improvement is not worth the money, and the other 0.1% are pros or semi-pros anyway?

The point is the difference between two statements:

1. A sound card is a good low cost option for measuring audio amplifiers. Nobody will ever hear what a good sound card can't measure.

2. A sound card is good to reliably measure ppm level distortions, over the entire audio band. It has no significant limitations or shortcomings and can compete with a pro analyzer, in particular if Pete Millet interface is added.

1. is true, 2. is flat wrong.

BTW, Pete Millet nice sound card interface has no attenuators compensation (means frequency linearity is not better than 0.5-1dB over the audio band, perhaps even worse at HF, is AC coupled, and I would love to see some distortion measurement results. I can't imagine it has less that 10-20ppm distortions over the whole audio band. Less, of course, at 1KHz.

Good night.
 
Status
Not open for further replies.