Spectrum Software
Industrial Strength Simulation




Spectrum Software has released Micro-Cap 11, the eleventh generation of our SPICE circuit simulator.

For users of previous Micro-Cap versions, check out the new features available in the latest version. For those of you who are new to Micro-Cap, take our features tour to see what Micro-Cap has to offer.




Questions and Answers - Summer 2010


Question: I am simulating an audio amplifier. My transient analysis is running fine, and now I would like to measure the total harmonic distortion of my amplifier output. How do I do this measurement?

Answer: The total harmonic distortion of a waveform can be calculated through the use of the THD function. The THD function has the following syntax:


where S is the waveform spectrum, and F is an optional parameter that specifies the fundamental frequency. If the F parameter is not specified, then the fundamental frequency is calculated through the time range specified in the FFT page of the Analysis Properties dialog box by the following equation:

F = 1/(Upper Time Limit - Lower Time Limit)

In the Transient Analysis Limits dialog box, the THD function needs to be entered on a new waveform line. Set the X Expression field to F since the distortion should be plotted versus frequency. If the THD is to be measured at node Out, the Y Expression field would be defined as:


The HARM(V(Out)) portion produces the waveform spectrum needed for the THD calculation. In this case, the fundamental frequency would be calculated from the FFT page of the Analysis Properties dialog box. However, if the fundamental frequency needed to be set to a specific value such as 1kHz, the expression above could be modified to:


Run the transient simulation. The plot displays a running total of the THD measurement. For example, if the fundamental frequency is 1kHz, the data point at 4kHz would show the THD value of all of the harmonics after 1kHz up to and including the harmonic at 4kHz.

There is also an individual harmonic distortion function available in Micro-Cap. Its syntax is:


This function operates in the same manner as the THD function except that it shows just the individual distortion of each harmonic.

Return to the main Newsletter page