Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

how to calculate area under the waveform

I need to calculate absolute energy of the waveform. Do you have a math function to do this? I used Integrate funtion but the return value is 0.
0 Kudos
Message 1 of 2
(3,516 Views)
You didn't say much about what you are doing. The CNiMath::Integrate function should be able to do this for you. Maybe you don't understand the function. You would input your waveform as a vector (say 1000 elements), then the delta time between each element (1/sampling rate), then the first and last value of the discrete integral (waveform[-1] and waveform[n]). Then, on output, the vector would contain the integrated data. You could get the sum of the elements to get the total area under the curve.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 2
(3,516 Views)