Total Harmonic Distortion
Total Harmonic Distortion (THD) is a critical specification for signal analyzers and electronic components. This application note will provide a description of harmonics and harmonic distortion that is both brief and comprehensive.
What are Harmonics?
Harmonics are a foundational concept in signal processing, which was presented as a formal mathematical theory with Joseph Fourier. Although Fourier was studying the diffusion of heat, he hypothesized that complex waveforms could be expressed as a sum of sine and cosine waveforms.
The coefficients A and B determine the shape of the waveform, and if the series is truncated to N terms, N determines the resolution, with more terms creating a more ideal waveform. The index ‘n’ is used to create higher frequencies, and these higher frequencies are referred to as harmonics. The term n = 1 is called the fundamental frequency, n = 2 is the 2nd harmonic, n = 3 is the 3rd harmonic, and so on.
Harmonics have been well known in music theory and are understood to be the reason that instruments can be distinguished from each other. When a violin and saxophone play the same ‘note’, they sound in unison because the ‘note’ really refers to the fundamental frequency. The harmonics between the instruments are different, which creates the ‘tone’ that is associated with each instrument and that is how we can distinguish two instruments playing the same note.
Some waveforms can be created using simple relationships for the coefficients. These waveforms have found their way into electronic synthesizers, and their unique tone has been used in music since the creation of modern electronics.
Waveform Name | Function for A(n) | First Few Terms | Illustration of Waveform |
---|---|---|---|
Sawtooth | 1 / n | 1, 1/2, 1/3, ... | |
Square | 1 / 2n +1 | 1, 1/3. 1/5. ... | |
Triangle | 1 / (2n + 1)2 | 1, 1/9, 1/24, ... |
More complex waveforms, like those found in musical instruments or other applications where data is gathered via sensors and waveforms cannot be expressed analytically, require the use of the Fast Fourier Transform (FFT). The FFT is an algorithm that implements the Discrete Fourier Transform, which is used to decompose any signal into its harmonic components, and it is one of the most important algorithms used in modern computing and signal analyzers. The ability to quickly analyze the frequency spectrum is used in identifying harmonic components of a signal, which can be used to calculate the THD.
What is Distortion?
The next concept to understand is distortion. Broadly speaking, distortion is any undesirable change to a signal. A picture can be described as distorted if the pixels have been rearranged, if the resolution is lowered, or by simply adding noise.
For one dimensional signals, distortion generally refers to a nonlinear process that affects the signal. Filters are linear processes that can change the shape of a waveform, but filters change a waveform shape in a way that only affects the relationships between amplitudes and phases. Nonlinear processes can affect existing amplitudes, but they also generate harmonics that did not exist in the signal before going through the process.
In the design of data acquisition systems, op-amps are a critical component to the analog front-end, which conditions a signal before getting digitized. Op-amps are intended to be linear, but as with all engineering design, there are some negative aspects of these devices. When an op-amp behaves in a nonlinear manner, the signal becomes distorted, which means harmonics are added to the signal. This type of distortion is called harmonic distortion, and total harmonic distortion is a way to specify how much harmonic distortion has occurred. Harmonic distortion can create many or few harmonics, depending how linear the op-amp is behaving.
In EDM, harmonic markers can be used to display the amplitudes of a signal’s fundamental frequency and the harmonic amplitudes. Figure 1 shows a 1 kHz, 1 V signal with harmonic markers to show the harmonic distortion at this particular frequency and amplitude. The THD spec for Crystal Instruments hardware is verified in EDM, so customers can independently verify the results in the same way.