|
Home | Forums | Rules | Articles | diyAudio Store | Blogs | Gallery | Wiki | Register | Donations | FAQ | Calendar | Mark Forums Read |
Everything Else Anything related to audio / video / electronics etc) BUT remember- we have many new forums where your thread may now fit! .... Parts, Equipment & Tools, Construction Tips, Software Tools...... |
|
Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving |
![]() |
|
Thread Tools |
![]() |
#1 |
diyAudio Member
Join Date: Aug 2004
Location: Buffalo
|
![]()
i am writing a set of procedures for amp and speaker evaluation. I have a early version up and running but my THD measurement is higher than expected for a LM3875 based amp. This result made me wonder if my method for calculating THD was correct.
The type of data i am trying to produce is similar to the following:
An externally hosted image should be here but it no longer works. Please upload images instead of linking to them to prevent this.
presently, i am scaling the the control wave (the wave output by the sound card before running it through the amp), a frequency sweep, to the amplified waveform and then subtracting the two. I then express the amplitude of the subtraction wave as a percent of the amplified wave. This measurement would/should include both phase and amplitude distortion. there is the possibility that my amp is distorting as much as measured but since i just intuited my way to the measurement method i thought i would make sure i am doing it correctly first. summary: what is the method for obtaining THD measurement from a frequency sweep? |
![]() |
![]() |
#2 |
Old guy with soldering iron
diyAudio Member
|
Getting a THD measurement from a frequency sweep will only work if you have some sort of tracking filter to separate the harmonics from the fundamental, and then calculate from all their relative levels. Incidentally, phase distortion has NO CONTRIBUTION to THD, THD is harmonic amplitude only. If your measurement is affected by phase response, then you aren't measuring THD (not that phase distortion is irrelevant, but it isn't involved in THD).
As far as I know, the only practical way to get THD using a frequency sweep and only a soundcard is with software that can operate with a logarithmic swept sinewave and a very clever and sophisticated technique called "Farina's method" that extracts impulse response of the fundamental and separate impulse responses of each harmonic product. I don't know of any freeware way to do it, though. Your best bet is to just measure at single frequencies individually, use some kind of FFT analysis program to show the fundamental level and the level of each harmonic tone. Then, THD is the ratio of the RMS summation of all the harmonics to the RMS summation of fundamental along with harmonics. If one harmonic is much stronger than all others, then you'll be pretty close if you just take the ratio of the level of that one to the fundamental tone's level. If you're doing it with a soundcard, also be sure that you are operating near the full scale levels (that is, just below clipping) of both the playback (D/A) and record (A/D) converters. Else, you won't be able to get residual distortion of your test setup down very far -- you need to use all the bits of resolution your soundcard has available. |
![]() |
![]() |
#3 |
diyAudio Member
Join Date: Aug 2004
Location: Buffalo
|
bwaslo, your reply is very helpful - thank you. i am a biologist trying to find my way in an engineering world. i have a few follow up thoughts.
1. it looks like i will have to obtain my distortion vs frequency plot from discrete points (something i already have partially implemented). I will also look into the Farina method as i am writing the code myself (in igor pro from wavemetrics) and have already implemented a log swept sin wave. 2. would an alternative method to calculate THD from a frequency sweep be to remove the phase distortion before subtracting the waves as i already do?. For example, i could select a filter that matches the phase roll off i measure, and then use those filter parameters to remove the phase shift from the amps output. or is this just crazy talk. 3. i do think my measurement has some appeal as it is a way of showing the effect of phase and amplitude distortion in one trace. Am i reinventing the wheel here or just doing something useless? 4. i am using a sound card, and i do try to maximize the use of the 16 bits i have available by operating near full scale. when i am careful i can get near -85 dB (about 95 db is the theoretical limit for 16 bit?). i hope to get a 24 bit sound card soon so i can improve my measurement range. thanks again. |
![]() |
![]() |
#4 |
diyAudio Member
Join Date: Aug 2004
Location: Buffalo
|
![]()
http://www.fesb.hr/~mateljan/arta/news.htm
it's not freeware but seems like a good deal. farina method was implemented in the june 29th, 2007 update. |
![]() |
![]() |
#5 | |
diyAudio Member
Join Date: Nov 2002
Location: Netherlands
|
![]() Quote:
The bundle also includes “STEPS” which is a separate program, that measures distortion with a stepped sine sweep. ![]() |
|
![]() |
![]() |
#6 | |
diyAudio Member
Join Date: Nov 2002
Location: Netherlands
|
Quote:
|
|
![]() |
![]() |
#7 |
diyAudio Member
Join Date: Aug 2008
|
delta sigma adc THD rises considerably as approaching theoretical max, well documtented behavior. Check the AKM5394 ( E-mu 1212m) ev-kit datasheet for example, -10 , -12 is on the safe side.
|
![]() |
![]() |
#8 |
diyAudio Member
Join Date: Aug 2004
Location: Buffalo
|
i will check THD as a function of gain for my test hardware experimentally.
can anyone recommend a good, $350 or less soundcard for this type of work? preferably one that can do square waves. i have seen this page which has instructions on how to mod the M-audio delta for decent square wave reproduction. when reading the arta manual i was happy to see that the sound card protection circuit i came up with, with some help, was the same one implemented by arta. I also loop back one channel, as they do, to create my reference wave. |
![]() |
![]() |
#9 |
diyAudio Moderator Emeritus
Join Date: Oct 2007
Location: Santa Cruz, California
|
Yes, this is a key point. I always keep everything below -6dBFS for the aforementioned reasons and more. The reconstruction filters can clip even when the absolute value of the samples is less than full scale. This is because they are trying to recreate a sine wave between the discrete points and so the waveform can peak above the max sample before it starts back in the other direction. I see THD rising in all my DAC outputs above -10dBFS
I also use the ESS method described by Angelo Farina, a very elegant technique that can tolerate distortion unlike MLS. But for THD I fall back on taking FFTs at discrete frequencies. It allows you to get the pure THD as opposed to THD+N which can be deceptive. Angelo Farina's method is excellent at visually representing the harmonic distortion components but when it comes to analyzing what's happening in a system at 834Hz, it's not too friendly. I have implemented both techniques in MATLAB and using ESS on a relative scale is great: A is obviously better than B but when it comes to absolute values I have as yet failed to correlate ESS to stepped sine FFT. My poor math skills. ![]() If you have a good S/W package such as soundeasy, mlssa etc, then you can probably rely on their calibration but I haven't had the opportunity to evalulate these devices so can't comment. edit: Angelo Farina's ESS method was, if I remember correctly, devised to provide the best impulse response measurement for large rooms and auditoria. Using long ESS sweeps (like 20-30secs because that's how long the decay is) you can get phenomenal signal to noise. I think it has a lot in common with Heysers seminal Time Delay Spectroscopy work. |
![]() |
![]() |
#10 | |
diyAudio Member
Join Date: Aug 2004
Location: Buffalo
|
Quote:
Here is a screenshot of the acquisition panel i have developed in igor. Analysis is running as well but it is not fully implemented at this time. |
|
![]() |
![]() |
Thread Tools | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PC Dac Measurement | supra | Digital Line Level | 1 | 14th July 2009 01:54 PM |
non os measurement | Bernhard | Digital Source | 3 | 13th September 2006 10:12 PM |
how to take db measurement | sonu | Multi-Way | 7 | 9th May 2005 04:03 PM |
New measurement mic in UK | pinkmouse | Multi-Way | 4 | 10th February 2005 06:46 AM |
New To Site? | Need Help? |