Harmonic Analyzer (Not in Base Package)

Finds the fundamental and harmonic components (amplitude and frequency) present in the input Auto Power Spectrum, and computes the percent of total harmonic distortion (%THD) and the total harmonic distortion plus noise (%THD + Noise). Details

frame size is the number of samples in the time-domain, signal array before it was passed to the Auto Power Spectrum VI. The frame size is typically the number of samples in one block of data from a data acquisition operation. If this control is unwired, the frame size used in this VI is set to twice the size of the Auto Power Spectrum input array. Refer to the Auto Power Spectrum VI for more information about the VI.
Auto Power Spectrum is the single-sided, auto power spectrum of the windowed signal. This array can be the output of a frequency-domain averaging process for improved harmonic estimation.
# harmonics is the number of harmonic components that you want this VI to approximate and use in the THD measurement. This number includes the fundamental component. For example, if you want to compute the second harmonic distortion in your signal, this number should be two: find the fundamental frequency component (say at Hz) and its second harmonic (at = 2 Hz).

Note  The number specified in the # harmonics control includes the fundamental. Therefore, entering a value of 2 in # harmonics tells the Harmonic Analyzer VI to find the fundamental frequency, f1, and the second harmonic, f2, where f2 = 2*f1. If you enter a value of N in # harmonics, the Harmonic Analyzer VI will find the fundamental and the corresponding (N-1) harmonics.
window is the window selection that you used for the Scaled Time Domain Window VI. If you did not use a window function (not recommended for an accurate THD estimation), this selector is automatically set to zero (no window). Refer to the Scaled Time Domain Window VI for more information about the VI.
sampling rate is the input sampling rate in Hz.
fundamental frequency is an estimate of the fundamental frequency that you want this VI to use in the harmonic search and in the THD computation. If this control is set to zero (default), then the frequency of the largest non-DC component found in Auto Power Spectrum is used as the fundamental frequency.
Harmonic Amplitudes is the array of amplitudes of the fundamental component and its harmonics. These values are always positive and are in units of Vrms if the input Auto Power Spectrum values are given in V^2rms.
Harmonic Frequencies is the array of frequencies of the fundamental component and its harmonics. These values are in units of Hz if the input sampling rate is given in Hz.
% THD is the percent total harmonic distortion present in the input Auto Power Spectrum. The THD computation is made using the following equation

,

where

is the amplitude of the fundamental component, is the amplitude of the c harmonic, and N is the # harmonics.
% THD + Noise is the percent total harmonic distortion plus noise present in the input Auto Power Spectrum. % THD + Noise is computed using the following equation

,

where sum(APS) is the sum of the Auto Power Spectrum without the power near DC and near the fundamental frequency index.

Harmonic Analyzer Details

You must pass the windowed, auto power spectrum of your signal to the Harmonic Analyzer VI for it to function correctly. You should pass your time-domain signal through the Scaled Time Domain Window VI and then through the Auto Power Spectrum VI, connecting the Auto Power Spectrum output to the Harmonic Analyzer VI.

You can use the Harmonic Analyzer VI to calculate the %THD present in the signal at the output of the nonlinear system. The Harmonic Analyzer VI finds the fundamental and harmonic components, their amplitudes and corresponding frequencies, present in the power spectrum applied at its input and calculates the percentage of total harmonic distortion (%THD) and the percentage of total harmonic distortion plus noise (%THD + Noise).

To use the Harmonic Analyzer VI, you need to give it the power spectrum of the signal whose THD you want it to calculate. In this example, you must make the connections shown in the following block diagram.

The Scaled Time Domain Window VI applies a window to the output y(t) of the nonlinear system (Your System). This is then passed on to the Auto Power Spectrum VI, which sends the power spectrum of y(t) to the Harmonic Analyzer VI, which then calculates the amplitudes and frequencies of the harmonics, the THD, and the %THD.