Total harmonic distortion (THD) is the level of undesired harmonics present in an audio signal, usually expressed in decibels. The following formula calculates THD:
The SVT THD and Harmonic Components VI identifies the fundamental tone and removes the tone from the input signal before identifying harmonics in the signal. Removing the tone before identifying harmonics allows accurate measurement of the signal amplitude in the harmonics. The SVT THD and Harmonic Components VI identifies the tone with the highest amplitude as the fundamental tone unless you wire a value to the expected fundamental frequency [Hz] terminal.
THD includes only the energy in the harmonics and does not include the energy in the broadband noise. Therefore, the measured THD is less than the measured total harmonic distortion plus noise (THD+N) for the same input signal.
The SVT THD and Harmonic Components VI enables you to specify the maximum harmonic used to compute the THD. You can wire –1 to this input to include all the harmonics up to the Nyquist frequency. If the maximum harmonic input to the SVT THD and Harmonic Components VI is greater than the Nyquist frequency, this VI uses all the harmonics up to the Nyquist frequency and returns a warning with code 1947. The warning indicates a coerced maximum harmonic.
You can view any of the measured harmonics by specifying the desired harmonics as an array to the harmonics to visualize control. If you wire a single-element array with a –1 in the first element to the control, the SVT THD and Harmonic Components VI returns all the measured harmonics in the harmonic components indicator.
The following block diagram shows the SVXMPL_One Shot Gain and Distortion example VI, modified with the addition of the SVT THD+N VI.
In the measurement analysis section of the previous block diagram, the audio measurements are applied sequentially to the same channel. The SVL Scale Voltage to EU VI scales the time-domain data to engineering units. The SVT Gain VI computes the complex spectrum and measures the gain. The SVT THD+N VI then uses the spectrum to compute the THD+N. The SVT THD and Harmonic Components VI uses the same spectrum to compute the THD, and the SVFA Unit Conversion VI converts the complex spectrum to a magnitude spectrum for display.
You can perform several audio measurements sequentially to take advantage of the polymorphic Distortion VIs and Single Tone Measurements VIs. These VIs accept a waveform or a complex spectrum, and their polymorphic features allow multiple measurement analysis VIs to act sequentially on the data without recomputing any additional FFTs.
The following front panel displays the magnitude spectrum measured in a distortion test.
The fundamental frequency of 1,000 Hz is clearly visible followed by harmonics in multiples of 1,000. The previous illustration shows that the measured THD is lower than the THD+N over the same bandwidth of 20 Hz to 20 kHz. This relationship always holds true because the THD+N measurement includes the energy in the harmonics as well as the energy in the noise.
The following table lists the distortion test measurement results.
|Fundamental Frequency||1,000.00 Hz|
|Fundamental Amplitude||1.82 Vpk|