Table Of Contents

Distortion Measurements (THD) (G Dataflow)

Last Modified: January 12, 2018

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).

connector_pane_image
datatype_icon

export mode

Source of the signal and spectrum to export.

Name Description
none Uses the fastest computation.
input signal Exports the input signal only.
fundamental signal Exports the single sine tone.
residual signal Exports the signal minus tone.
harmonics only Exports detected harmonics only.
noise and spurs Exports the signal minus tone and harmonics.

Default: none

datatype_icon

signal

The input signal.

This input can be a waveform or an array of waveforms.

datatype_icon

center frequency

Center frequency to use in the frequency-domain search for the fundamental tone frequency.

Default: -1

datatype_icon

frequency width

Frequency width, as a percentage of the sampling rate, for the frequency-domain search for the fundamental tone frequency.

Default: 5

datatype_icon

highest harmonic

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.

Default: 19

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

stop search at Nyquist

A Boolean specifying whether to include only frequencies less than the Nyquist frequency, or half the sampling rate, in the harmonic search.

True Includes only frequencies less than the Nyquist frequency.
False Searches the frequency domain beyond the Nyquist frequency by assuming that these higher frequency components have aliased.

Default: True

datatype_icon

exported spectrum

Spectrum of the exported signal.

This output can return a cluster or a 1D array of clusters.

datatype_icon

f0

Start frequency, in Hz, of the spectrum.

datatype_icon

df

Frequency resolution, in Hz, of the spectrum.

datatype_icon

spectrum

Computed spectrum.

datatype_icon

exported signal

Waveform of the exported signal.

This output can return a waveform or a 1D array of waveforms.

datatype_icon

fundamental frequency

Detected fundamental frequency resulting from searching the frequency domain.

This output can return a double-precision, floating-point number or a 1D array of double-precision, floating-point numbers.

Use the center frequency and frequency width to set the frequency domain search range. All harmonics are measured at integer multiples of this fundamental frequency.

datatype_icon

THD

Measured total harmonic distortion up to and including the highest harmonic.

This output can return a double-precision, floating-point number or a 1D array of double-precision, floating-point numbers.

This output 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.

datatype_icon

components level

Array of amplitudes of the measured harmonics in volts if the input signal in is in volts.

This output can return a 1D array of double-precision, floating-point numbers or a 1D array of clusters.

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.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics