Admin Production ni-theme
Current Publication

HarmonicAnalyzerUsingSignal

LabWindows/CVI

HarmonicAnalyzerUsingSignal

Advanced Analysis Library Only

AnalysisLibErrType HarmonicAnalyzerUsingSignal (double inputSignal[], ssize_t inputSignalSize, int numberOfHarmonics, double samplingRate, double fundamentalFrequency, double harmonicAmplitude[], double harmonicFrequency[], double *percentTHD, double *percentTHDNoise);

Purpose

Finds the amplitude levels and frequency tones of the fundamental and harmonic components and calculates the percent of total harmonic distortion and the total harmonic distortion plus noise.

If the sampling rate is 1,000 Hz and the fundamental frequency is 250 Hz, the number of harmonics is limited by samplingRate/(2*fundamentalFrequency) = 2. If you set numberOfHarmonics equal to 4, HarmonicAnalyzerUsingSignal sets the third and the fourth element of the harmonicAmplitude and harmonicFrequency array equal to 0.0.

Parameters

Input
Name Type Description
inputSignal double [] The input signal.
inputSignalSize ssize_t The length of inputSignal.
numberOfHarmonics int Number of harmonic components to approximate and use in the measurement.
samplingRate double Input sampling rate in Hertz.
fundamentalFrequency double Estimate of the fundamental frequency.
Output
Name Type Description
harmonicAmplitude double [] Amplitude levels of the fundamental components and its harmonics.
harmonicFrequency double [] Frequency tones of the fundamental components and its harmonics.
percentTHD double Percent of total harmonic distortion.
percentTHDNoise double Percent of total harmonic distortion plus noise.

Return Value

Name Type Description
status AnalysisLibErrType A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants.

Additional Information

Library: Advanced Analysis Library

Include file: analysis.h

LabWindows/CVI compatibility: LabWindows/CVI 8.5 and later