Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Harmonic Distortion Analyzer (Not in Base Package)

LabVIEW 8.2 Help
August 2006

NI Part Number:
371361B-01

»View Product Info

Takes a signal in and performs a full harmonic analysis, including measuring the fundamental frequency tone and harmonics, and returning the fundamental frequency, all harmonic amplitude levels, and the total harmonic distortion (THD). The data type you wire to the signal in input determines the polymorphic instance to use. Details  Examples

Use the pull-down menu to select an instance of this VI.

Harmonic Distortion Analyzer 1 Chan

stop search at Nyquist should be set to TRUE (default) to include only frequencies less than the Nyquist frequency, or half the sampling rate, in the harmonic search. When set to FALSE, this VI continues searching the frequency domain beyond Nyquist by assuming that these higher frequency components have aliased according to the following equation.

aliased f = Fs – (f modulo Fs)

where

Fs = 1/dt = sampling rate.

signal in is the input time-domain signal.
export signals selects the signal to export to exported signals.

0none—Fastest computation
1input signal
2fundamental signal—Single sine tone
3residual signal—Signal minus tone
4harmonics only—Detected harmonics
5noise and spurs—Signal minus tone and harmonics
highest harmonic controls the highest harmonic, including the fundamental tone, used for the harmonic analysis. For example, for 3rd harmonic analysis, this control should be set to 3 to measure the fundamental, second, and third harmonic.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
advanced search controls the frequency domain search area, which is the center frequency and width, used for finding the fundamental frequency tone of the signal.
approx freq. is the center frequency used in the frequency domain search for the fundamental tone frequency. If set to the default value of –1.0, the tone with the highest amplitude is used as the fundamental tone.
search is the frequency width, as a percentage of the sampling rate, for the frequency domain search for the fundamental tone frequency.
exported signals contains the signals specified by export signals.
exported time signal is the waveform containing the exported time signal as selected by export signals.
exported spectrum (dB) is the spectrum of the exported time signal as selected by export signals.
f0 is the start frequency of the spectrum expressed in hertz.
df is the frequency resolution of the spectrum expressed in hertz.
dB Spectrum (Hann) is the magnitude spectrum of the (Hanning) windowed input signal expressed in dB.
detected fundamental frequency contains the detected fundamental frequency resulting from searching the frequency domain. Use advanced search to set the frequency search range. All harmonics are measured at integer multiples of this fundamental frequency.
THD contains the measured total harmonic distortion up to and including the highest harmonic. THD is defined as the ratio of the RMS sum of the harmonics to the amplitude of the fundamental tone. To compute THD as a percentage, you must multiply it by 100.
components level contains the array of amplitudes of the measured harmonics in volts if the signal in is in volts. The array index is the harmonic number including 0 (DC), 1 (fundamental), 2 (second harmonic),... n (nth harmonic), up to and including the highest harmonic.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.
measurement info returns information about your measurement, mainly warnings for inconsistencies in your input signal.
uncertainty is reserved for future use.
Warning is TRUE if a warning is generated during processing.
comments contains a warning message when Warning is true.

Harmonic Distortion Analyzer N Chan

The multichannel waveform array input should be the result of a multichannel acquisition where each element of the array of waveforms is a distinct and separate channel of data.

stop search at Nyquist should be set to TRUE (default) to include only frequencies less than the Nyquist frequency, or half the sampling rate, in the harmonic search. When set to FALSE, this VI continues searching the frequency domain beyond Nyquist by assuming that these higher frequency components have aliased according to the following equation.

aliased f = Fs – (f modulo Fs)

where

Fs = 1/dt = sampling rate.

signals in is the array of input time-domain signals.
export signals selects the signal to export to exported signals.

0none—Fastest computation
1input signal
2fundamental signal—Single sine tone
3residual signal—Signal minus tone
4harmonics only—Detected harmonics
5noise and spurs—Signal minus tone and harmonics
highest harmonic controls the highest harmonic, including the fundamental tone, used for the harmonic analysis. For example, for 3rd harmonic analysis, this control should be set to 3 to measure the fundamental, second, and third harmonic.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
advanced search controls the frequency domain search area, which is the center frequency and width, used for finding the fundamental frequency tone of the signal.
approx freq. is the center frequency used in the frequency domain search for the fundamental tone frequency. If set to the default value of –1.0, the tone with the highest amplitude is used as the fundamental tone.
search is the frequency width, as a percentage of the sampling rate, for the frequency domain search for the fundamental tone frequency.
exported signals is an array of exported signals.
exported time signal is the waveform containing the exported time signal as selected by export signals.
exported spectrum (dB) is the spectrum of the exported time signal as selected by export signals.
f0 is the start frequency of the spectrum expressed in hertz.
df is the frequency resolution of the spectrum expressed in hertz.
dB Spectrum (Hann) is the magnitude spectrum of the (Hanning) windowed input signal expressed in dB.
detected fundamental frequencies is an array containing the detected fundamental frequency resulting from searching the frequency domain for each waveform.
THD is an array containing the measured total harmonic distortion for each waveform.
components levels is a cluster containing an array of amplitudes of the measured harmonics for each waveform.
components level contains the array of amplitudes of the measured harmonics in volts if the signal in is in volts. The array index is the harmonic number including 0 (DC), 1 (fundamental), 2 (second harmonic),... n (nth harmonic), up to and including the highest harmonic.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.
measurements info is an array that returns information about your measurement, mainly warnings for inconsistencies in your input signal.
uncertainty is reserved for future use.
Warning is TRUE if a warning is generated during processing.
comments contains a warning message when Warning is true.

Harmonic Distortion Analyzer Details

This VI is designed to process a single channel or multiple channels continuously, typically from within a For Loop or a While Loop.

Examples

Refer to the following VIs for examples of using the Harmonic Distortion Analyzer VI:

  • labview\examples\measure\maxmpl.llb\Basic Harmonic Analyzer Measurement.vi

     

  • labview\examples\measure\maxmpl.llb\Multitone with Amplitudes and Phases.vi

     


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit