LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Local maxima and minima of an array

I need to calculate all the local maximas and local minimas of a 1D array and take the average of them separately in labview. So in the end I should have average local maxima and avergae local minima. How do I do this in labview

0 Kudos
Message 1 of 7
(8,188 Views)

Take the first and second derivatives of your array. Look for sign changes in the second derivative, e.g., + to - is a local maxima). Use those locations to index the array of first derivatives to get two arrays, local maxima and local minima. Get the average.

0 Kudos
Message 2 of 7
(8,179 Views)

Using first and second derivatives probably will not work well, unless your data is completely noise-free.

Can you show us some typical data? Are the peaks spaced regularly?

0 Kudos
Message 3 of 7
(8,167 Views)

No, actually it is a noisy data and location of peaks change (the index) with data. The array length is 1000.

The data acquired is in real time using PXI-5124 digitizer.

0 Kudos
Message 4 of 7
(8,152 Views)

Hm, noisy data is a problem....err challenge.

What about building a fit function (like polynom) and then calculate the values you are looking for?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 7
(8,141 Views)

The data is very sensitive in deciding the flow of the experiment so curve fitting approach will kill the useful information.

The array is like a sinusoid and I want to know whether its peak to peak value has incresed from the previous value.

To do this, I'm using the difference of maxmum and minimum values. But these values might contain noise so I thought

it would be better to take avergae of local extremas and then subtract.

0 Kudos
Message 6 of 7
(8,135 Views)

Try the peak detector function.

 

It would really help if you could attach some typical sample data so we get a better picture of the problem.

0 Kudos
Message 7 of 7
(8,107 Views)