Admin Production ni-theme
Current Publication

CxMultipleToneSignal

LabWindows/CVI

CxMultipleToneSignal

Advanced Analysis Library Only

AnalysisLibErrType CxMultipleToneSignal (NIComplexNumber waveform[], ssize_t waveformSize, double samplePeriodInSeconds, int sortOrder, int exportMode, double threshold, int maxNumberOfTones, int *detectedTones, double frequency[], double amplitude[], double phase[], NIComplexNumber exportedSignal[], double *exportedSamplePeriod, double exportedSpectrum[], double *startFrequency, double *frequencyResolution);

Purpose

Teturns the frequency, amplitude, and phase for each signal tone whose amplitude exceeds a specified threshold. This function also exports the signal and spectrum specified by exportMode.

This function is similar to CxMultipleToneInfo, except that CxMultipleToneSignal exports signal and spectrum values. If you do not need to export signal and spectrum values, you can use CxMultipleToneInfo instead.

A complex multiple tone signal can be expressed as shown in the following equation:

where Ai, fi, and i are the amplitude, frequency, and phase, respectively, of the ith tone of a multiple tone signal with N tones and Fs is the sample rate in samples per second of the input waveform signal.

For a complex signal, the frequency range is (min frequency, max frequency) = (–Fs/2, Fs/2).

Parameters

Input
Name Type Description
waveform NIComplexNumber [] The input waveform to measure.
waveformSize ssize_t The size the input waveform.
samplePeriodInSeconds double Sample period of the time-domain signal, in seconds.
sortOrder int The sorting order of the detected tones.

0—increasing frequency
1—decreasing amplitude
exportMode int The source of the exportedSignal and exportedSpectrum to export. You can select one of the following values:

  • TONE_EXPORT_NONE—Does not export any values.
  • TONE_EXPORT_INPUT—Exports the input signal.
  • TONE_EXPORT_DETECTED—Exports the detected single tone signal.
  • TONE_EXPORT_RESIDUAL—Exports the residual signal; residual signal is the input signal minus the detected multiple tone signal.
threshold double The minimum amplitude that each tone must exceed.
maxNumberOfTones int The maximum number of tones that this function extracts.
Output
Name Type Description
detectedTones int Detected number of tones; this value is less than or equal to maxNumberOfTones.
frequency double [] The frequency of the detected tones, in hertz. You must allocate enough memory for this value before calling this function: maxNumberOfTones*sizeof(double).
amplitude double [] The amplitude of the detected tones. You must allocate enough memory for this value before calling this function: maxNumberOfTones*sizeof(double).
phase double [] The phase of the detected tones, in degrees. You must allocate enough memory for this value before calling this function: maxNumberOfTones*sizeof(double).
exportedSignal NIComplexNumber [] The waveform containing the exported time signal as selected by exportMode.
exportedSamplePeriod double Sample period of the time-domain signal, in seconds.
exportedSpectrum double [] The magnitude spectrum of the Hanning windowed input signal, in dB.
startFrequency double The start frequency, in hertz, of the exportedSpectrum.
frequencyResolution double The frequency resolution, in hertz, of the exportedSpectrum.

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 2010 and later