MultipleToneSignal
Advanced Analysis Library Only
AnalysisLibErrType MultipleToneSignal (double waveform[], ssize_t waveformSize, double samplePeriodInSeconds, int sortOrder, int exportMode, double threshold, int maxNumberOfTones, int *detectedTones, double frequency[], double amplitude[], double phase[], double exportedSignal[], double *exportedSamplePeriod, double exportedSpectrum[], double *startFrequency, double *frequencyResolution);
Purpose
Returns the frequency, amplitude, and phase for each signal tone whose amplitude exceeds a specified threshold. This function also exports signal and spectrum information specified by exportMode.
If you do not need to export signal and spectrum information, you can use MultipleToneInfo.
A real 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 real signal, the frequency range is (min frequency, max frequency) = (0, Fs/2).
Parameters
Input | ||
Name | Type | Description |
waveform | double [] | The input waveform to measure. |
waveformSize | ssize_t | The size of 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:
|
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 | double [] | 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