LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate signal amplitude average value from array data

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

 

Gabor_37_0-1582648449027.png

 

Download All
0 Kudos
Message 1 of 4
(2,663 Views)

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).


GCentral
0 Kudos
Message 2 of 4
(2,647 Views)

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.

0 Kudos
Message 3 of 4
(2,597 Views)

Hi Gabor,

 

You have (at least) a few options when it comes to selecting the range of data you want to use:

  1. Use a pair of cursors (as described in one of the links in my previous post).
  2. Use numeric values giving the X-limits
    1. Alternatively, use numeric values giving the indices. This is easier to program, but harder to use. Probably avoid?
  3. Use the zoomed/viewable area of the graph
  4. Probably a bunch of other ideas

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).


GCentral
0 Kudos
Message 4 of 4
(2,586 Views)