Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Sine wave, square wave & NiMath (Analysis)

Dear everyone,
 
The SineWave() in NiMath.h generate waveform based from input parameters like data, data size, frequency & amp.
Is there a function that does quite the reverse?  Given a data matrix from CNiReal64Matrix, i would like to have the frequency & amplitude. 
 
Same goes for the SquareWave().
 
Thanks,
A
 
0 Kudos
Message 1 of 2
(7,050 Views)
Hi A,

You can use the CNiMath FFT() function to get the frequency of your signal.  In order to calculate the amplitude, you can determine the minimum and maximum and then calculate the difference between them.  The functions to find the maximum and minimum are MaxArray() and MinArray() which are available for the CWArray.  If you do not want to use the CWArray, you would have to implement the Min and Max functions on your own.
Jessica
National Instruments
Product Support Engineer
0 Kudos
Message 2 of 2
(7,009 Views)