11-26-2015 07:48 AM
Dear Labview community members:
Happy Holidays to all.
I need to find the turning point in my data array, I have not figured it out how to do it. I hope you can give me some hints. my data array has two columns, one is for time another is for my data collected from a instrument. Bascially, the data is a triagle wave with some noise (see the attached picture for details). my question is how to find at what time the turning point (maximum and minimum) appears,
11-26-2015 09:18 AM - edited 11-26-2015 09:19 AM
Before you can program, you have to be able write down in words what you need to do.
Can you do that? Are you able to articulate in words the steps - the algorithm - for processing your array(s) of data?
Once you are able to do that, you then use whichever programming language you want to use to implement those steps.
11-26-2015 09:19 AM
Interpolate the signal. Use the first derivate and determine the x values where it equals 0.
Norbert
11-26-2015 09:25 AM
In the signal processing palette, there is a 'Peak Detector' VI - http://zone.ni.com/reference/en-XX/help/371361J-01/lvanls/peak_detector/
11-26-2015 09:58 AM - edited 11-26-2015 10:00 AM
Can you show us some typical data? (If there is any noise, most likely every other point is a turning point on some scale. :))
Is the data always a regular triangular wave? Are the segments always close to linear? Is the freqeuncy fixed? You probably want to look for jumps in the first derivative of the data (or even peaks in the absolute second derivative). Are the start and end point really "tunring points" as you marked in your graph?
11-26-2015 10:05 AM
here I posted a vi that should be able to solve that even for very noisy data (and you can define a minimum vertical turnpoint distance) . It takes only a 1D data but thats easy to adapt to your problem.
The output is an array that contains the value and its index.
11-26-2015 11:34 AM
Hi:
attached is the data I got. the data is always a triangle wave. The ramp rate should be the same in one run, but, it can be different from run to run, it can vary from 1mV/second to 1V/second.
each segament in the triangle wave is or should be linear. I think derivative may not work, this is becuase the derivative can magnify noise, if the ramp rate is very slow, it could be difficult to identify the change from positive to negative in the 1st derivative if there noise is also magnified. please give me some advice.
again, thank you
11-26-2015 12:17 PM
@Peter109 wrote:
Hi:
attached is the data I got. the data is always a triangle wave. The ramp rate should be the same in one run, but, it can be different from run to run, it can vary from 1mV/second to 1V/second.
each segament in the triangle wave is or should be linear. I think derivative may not work, this is becuase the derivative can magnify noise, if the ramp rate is very slow, it could be difficult to identify the change from positive to negative in the 1st derivative if there noise is also magnified. please give me some advice.
again, thank you
Only the one that try can fail, others have already lost 😉
I don't want to interpret xlsx data .... since you want to write your program in LabVIEW , post your try and include the data (as a constant?)
Another method could be:
Take the min/max value of your data (or the RMS , or ..) to get a good guess for the top and botton 5% of your triangles.
Cut out the peaks
fit a line (linear fit) on the intersections
use a little math to calculate the peak values and position (intersection of two lines... you remember your math class?)
Another method: could be very noise robust 😉
If the triangle of one run is of constant frequency
Capture 5 or more periodes
Use tone detection to find amplitude and phase of the basic frequency
With amplitude and phase of the base frequency known you can make very good guesses of the turnpoints
Again apply a linear fit of the intersections
...