Is this a valid way to measure THD? - Page 1
Forum section: electronics / beginners

author: Dan Moos
author_rank: Frequent Contributor
timestamp: July 08, 2023, 08:57:05 pm
content: Ok, I realize this would be limited by the precision of the tools at hand, but other than eyeballing an FFT, or a spectrum analyzer (I'm not sure how well my Siglent SSA3021 plus is below its rated 9 kHz), could the following method be used for a hobbyists grade result.So here's my idea.Use my Arb Gen to create as duplicate as possible a sine wave as the signal under test. Using the meaurements my scope gives me, match freq, phase, and peak to peak voltage.Invert one of the signalsadd them.What ever remains is distortion, correct? And doing the math should give me the THD as close as my gear (siglent sdg 2042 arb gen, rigol 1054z scope) can do, right?

author: paul@yahrprobert.com
author_rank: Regular Contributor
timestamp: July 08, 2023, 09:32:38 pm
content: The trouble with THD measurements is that the audio world likes to quote numbers down in the 10ths of a percent or less, and so your signal generator's sine wave isn't allowed to have much distortion. Also the circuitry that you use to perform the subtraction must be pretty good too. I would personally try to spend my money on a really good digitizer and do all the subtraction of a sine wave in software.

author: radiolistener
author_rank: Super Contributor
timestamp: July 08, 2023, 09:56:08 pm
content: proper THD measurement requires to take into account result for at least 5-10 harmonics.It's more easy to measure IMD3 (intermodulation distortion from the third order). In order to do that you're needs to put two-tone signal with non multiple frequencies. The standard IMD testing frequencies for audio is a two tone signal with 850 Hz + 2200 Hz. It is often used for SSB equipment testing (it has 2.7 kHz audio bandwidth).Here is another standard combinations for two tone IMD testing:and triple tone:

author: dobsonr741
author_rank: Frequent Contributor
timestamp: July 08, 2023, 09:59:27 pm
content: Your “dual channel subtract” will not address the phase difference the amp adds, and will show it as distortion. The phase shift changes by frequency just to complicate things.A better way is to do a very good FFT (by a 24 bit ADC, 64K points, like a pro external sound I interface) to baseline your oscillator, then FFT the amps output. Subtract the baseline, then eliminate the primary signal from the spectrum. Then IFFT back to time domain, calculate the rms value. It gives you the distortion. Compare it to the primary signal and you have your distortion.Many articles are on diyaudio

author: Dan Moos
author_rank: Frequent Contributor
timestamp: July 08, 2023, 11:02:50 pm
content: Can't I correct phase in the sig gen? Basicaslly force it to match? (

author: Dan Moos
author_rank: Frequent Contributor
timestamp: July 09, 2023, 12:48:45 am
content: I should be more specific. I'm not trying to characterize an amplifier. Just an educational experiment in characterizing an oscillator. Not looking for "official" numbers.

author: vk6zgo
author_rank: Super Contributor
timestamp: July 09, 2023, 01:38:08 am
content: The classic way to measure THD for audio signals is to pass the output signal of the DUT through a narrow "notch filter" on the fundamental of the test signal.Any remaining signal after the fundamental is "nulled out" is the DUT THDplus noise.You can then measure the noise by removing the test signal & terminating the input of the DUT, then calculate what proportion of the above "distortion" is noise.In most cases, the noise component is negligible.Another way used back in the day, was with a Selective Millivoltmeter, tuning to each harmonic in turn, then calculating the THD.In the method you proposed, why would you "duplicate" the signal?Why not use the same signal source, with one channel looking at the input & the other the output.Of course, there will be a delay problem, but it shouldn't be insuperable.

author: Dan Moos
author_rank: Frequent Contributor
timestamp: July 09, 2023, 01:45:36 am
content: QuoteI'm trying to measure the purity of a sine oscillator I'm experimenting with. There is no "input"My plan is currently thwarted because I can as of yet not find a way to sync my arb gen with the very slightly unstable oscillator output. (can't get the reference and DUT signals to stand still together on tyhe scope).I have some PLL chips I've always wanted to play with so, I might try locking my oscillator to the siglent that way.

author: David Hess
author_rank: Super Contributor
timestamp: July 09, 2023, 01:52:35 am
content: I have seen what you describe done. The reference source is phase locked to the test signal and then the phase and amplitude is minutely adjusted for maximum nulling. Conveniently a phase locked loop allows for adjusting phase to be negative so a phase alignment of zero degrees is possible.

author: jasonRF
author_rank: Regular Contributor
timestamp: July 09, 2023, 03:13:25 am
content: If the THD is high enough the FFT on your Rigol scope may let you see the distortion. If your oscillator frequency is low enough that the fundamental and a handful of harmonics are in the audio range, then a sound card (even the one you already have in your computer) would probably fit the bill; there are free software packages such as REW (room equalization wizard) will plot the spectrum essentially in real time.jason

author: EEEnthusiast
author_rank: Frequent Contributor
timestamp: July 09, 2023, 03:25:31 am
content: As stated by others, use a 24bit sound card and capture the output. I'm sure there are utilities out there to directly measure the distortion of the input fed to a sound card.

author: EPAIII
author_rank: Super Contributor
timestamp: July 09, 2023, 01:35:48 pm
content: I am not confident that using a computer sound card to sample an audio signal will not introduce any number of harmonics or other artifacts. Or it could hide those harmonics that may already be present in the signal. And it WILL add digital noise.While shortcuts may be OK when measuring the THD in an amplifier where a known good sine wave can be used at the input and then also be available at the measurement point, thus preserving frequency and phase, the same can not so easily be said for checking a sine wave generator.Quote from: EEEnthusiast on July 09, 2023, 03:25:31 am

author: strawberry
author_rank: Super Contributor
timestamp: July 09, 2023, 01:57:51 pm
content: 1kHz@1V phase shift of 1us could give ~0.1% THD error and that would be poor amplifier/generator . for poor amplifier delay could be ~x100power amplifiers can go down to ~0.001% and OP amps even lessHP33120A ~0.04% for audio range24bit sound card with high sample rate

author: David Hess
author_rank: Super Contributor
timestamp: July 09, 2023, 02:05:38 pm
content: Quote from: EPAIII on July 09, 2023, 01:35:48 pmSome sound cards work very well for this measurement. The two problems in my experience are getting an uncorrupted signal into the card through its single ended chassis grounded shared inputs, and knowing which sound cards are suitable.Here is an old review that gives some examples:https://web.archive.org/web/20180507221601/http://www.clarisonus.com/Research%20Reports/RR001-SoundCardEval/RR001-PCsoundCards.html

author: Grandchuck
author_rank: Super Contributor
timestamp: July 09, 2023, 03:15:36 pm
content: As David Hess mentioned, it is difficult to deliver a clean signal into a computer sound card. I have been using a Focusrite Scarlett Solo and REW software to make measurements.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: July 11, 2023, 02:20:33 am
content: Differential/balanced input on the sound card can help to get over the signal grounding issue. The better ones all have balanced line and mic level ins.