02-25-2020 10:44 AM
Hello,
I have a problem to calculate the signal amplitude average value from the array data. I got ADC results from a sensor, but due to an offset compensation a big jumping is visible on the signal graph. I would like to have the dominant amplitude and the dominant frequency, but only just the input file reading is working now.
Can anybody support me to get any direction of the development?
Many thanks!
Gabor
02-25-2020 11:22 AM
Well, getting just an average value from an array is trivial - use the Mean VI.
Presumably you want to rather get the mean from a subset (perhaps that middle section in the pictured graph)?
In that case, my post in this thread might be interesting: Fixing cursors and getting their X locations. You could use the X locations together with code in a related thread (here) to obtain an Array Subset of your array(s).
For frequencies, take a look at VIs in the Signal Processing palette, particularly things like Extract Single Tone in the Waveform Measurement subpalette (this also returns an amplitude).
02-26-2020 04:43 AM
Yes, the middle of the signal would be interest actually I don't know how to start.
I will check the topics you attached, thanks.
02-26-2020 08:14 AM
Hi Gabor,
You have (at least) a few options when it comes to selecting the range of data you want to use:
In a bit more detail:
1 - If you have two cursors, you can read their Position.X to get the X values of the start and end (using for example the first cursor as the start and the second as the end). Then you can proceed to use these values for approach 2.
2 - If you have X-limits, you can use Interpolate Array (and appropriate rounding, perhaps down) to find the indices of the X array that give those values (in case 2.1, you already have these values directly). Then, you can use the difference between these and Array Subset to get the "middle section" of your Y array.
3 - You can use the X limits of a graph to get values for approach 2.
4 - Let me know if you had some other desired input method for selecting a range (perhaps by calculation, but that would be more tricky).