LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search array

I have two 1-D arrays. One contains the amplitude and the other contains their index (from another array). As an example:

 

Amplitude array: 9.8, 10,   9.7, 9.9, 10.1,    9.1, 9.9, 9.6, 9.8 ...

       Index array:   1,   3,    49,  50,    53,     97,101, 102,104...

 

In index array, note that after certain counts, the value increases drastically (the minimum increment value is known, say 40, 49-3 =46 >40; 97-53=44>40; ...).

 

I want to generate another array to extract peak values from Amplitude array, i.e., 10, 10.1, 9.9, ...

 

How to do this in labview.

 

Thanks 

0 Kudos
Message 1 of 11
(3,637 Views)

@Alice12 wrote:

I have two 1-D arrays. One contains the amplitude and the other contains their index (from another array). As an example:

 

Amplitude array: 9.8, 10,   9.7, 9.9, 10.1,    9.1, 9.9, 9.6, 9.8 ...

       Index array:   1,   3,    49,  50,    53,     97,101, 102,104...

 

In index array, note that after certain counts, the value increases drastically (the minimum increment value is known, say 40, 49-3 =46 >40; 97-53=44>40; ...).

 

I want to generate another array to extract peak values from Amplitude array, i.e., 10, 10.1, 9.9, ...

 

How to do this in labview.

 

Thanks 


Use the peak detector VI on your amplitude array (the index array is not necessary to find the peaks). I used 9.7 as the threshold and got the three peak numbers you mentioned.

 

0 Kudos
Message 2 of 11
(3,631 Views)

The threshold value is not known. It could be anything. 

Also the arrays are very large (500) in size.

0 Kudos
Message 3 of 11
(3,621 Views)

Ok, so I left threshold at 0.0 and got the same result. And an array of only 500 values is not a problem.

 

(HINT:You could always try the Peak Detector and see what you get)

0 Kudos
Message 4 of 11
(3,614 Views)

Thanks for your reply.

 

Peak Detector doesn't work in my case. The data which I presented was very simple.

 

Amplitude array: 9.8, 10,   9.7, 9.9, 10.1,    9.1, 9.9, 9.6, 9.8 ...

       Index array:   1,   3,    49,  50,    53,     97,101, 102,104...

 

In actual case, for example, 9.7, 9.9, 10.1 could be 9.7, 9.9, 10.1, 10.2,10.4, 10.5, 10.7, 9.2, 9.4 at locations  47, 49, 51, 53, 55, 57, 59, 61, 63. In this case (the minimum increment value is,

say, 30, only this value is known beforehand).

 

0 Kudos
Message 5 of 11
(3,605 Views)

You lost me with the minimum increment and locations thing. What does that have to do with the array of amplitudes? You need to post an example of the actual data for which you want to find peaks.

0 Kudos
Message 6 of 11
(3,594 Views)

Actually I want to find all local maxima and minima of a noisy signal (without any curve fitting).

So, first I use the Peak Detector and a threshold value (8 in the figure) to isolate all the peaks. Then I need to find the maximum/ minimum in each chunk of data 

separately.How do I do this ? So, the only meaningful imformation is the big gap between the chunks (whose size I call  "minimum increment").

0 Kudos
Message 7 of 11
(3,581 Views)

The results of Peak Detector is also Array and if you Know the index between peaks that is zero crossing in your case then search for maximum peaks between a zero crossing.

Labview user
0 Kudos
Message 8 of 11
(3,577 Views)

Yes, but my actual data is all positive and the y-axis (amplitude) is not fixed nor is its mid point. In this case the only

useful information is x-axis gap between the chunks.

In the picture, the data is computer generated. 

0 Kudos
Message 9 of 11
(3,567 Views)

Take RMS or average of data and try to threshold with that value.

Labview user
0 Kudos
Message 10 of 11
(3,555 Views)