12-03-2012 12:06 AM
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
12-03-2012 01:35 AM
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.
12-03-2012 02:56 AM
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?
12-03-2012 04:01 AM - edited 12-03-2012 04:03 AM
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.
12-03-2012 04:55 AM
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
12-03-2012 05:44 AM
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.
12-03-2012 09:26 AM
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.