12-15-2008 07:01 AM
Hi RPJ,
Thanks for the reply - so I haven't responded in some time.
I see your problem. In my LabVIEW example finder I have several examples concerning peak detection? Have you looked there?
From my understanding surely we can just use the deriative, and test whether we've reached a peak/valley and the second deriative to test if its a peak or valley.
Let me know if you have these examples.. from Advanced Signal Processing Toolkit.
12-15-2008 07:57 AM
12-15-2008 08:54 AM
Good catch!
How would you now include in that chart the first derivative locations?
I'm actually trying to detect when does the points start to go up... I know that for the sample array I could do this just by checking which is the last point that has a 0 value or a value similar to previous point (in a certain tolerance); however, soon I am going to have to look at a different array and furthermore to an actual waveform...
Examples help best.
Thank you.
12-15-2008 09:43 AM

12-15-2008 10:06 AM
Sorry labview crashed i gave you the wrong version.

12-15-2008 04:46 PM
This is closer to what I want indeed but may not work for all scenarios I have.
I appreciate your time and submitting your logic. I may need to use it when I read certain arrays.
Thank you.
As a general comment, I am dissapointed NI does not have more serious examples that can approach different scenarios of peak, valley, plateau, and inflexion point detection for arrays and waveforms.
12-15-2008 04:53 PM
Hillman,
I don't seem to have Advanced Signal Procesing Toolkit. I only have what LabView Full (how ironic is that?) Development system has.
Does this help?
Thank you for your time and repeated comebacks to my post.
12-16-2008 03:18 AM
Hi RPJ,
Good Morning and I hope your well.
The toolkit is separate unless you got NI Developer Suite. Oh well.
I have some free time today - so if you could clearly post the issue (again...) that you having.. and maybe post some example code to show me the issue I will take a look at it today and endeavor to resolve the problem your having - sorry for the brief support lately 😛
Hope this is good news,
12-16-2008 06:11 AM
Just to make comments on one of your previous posts RPJ
Labview has a lot of examples but it is very hard to make examples for every application. That is way we call us self programmers and not example users. I have done a lot of peak/valley detection. It is often an easy task. But not always. The problem is often that information is lost during data sampling and noise. In your case I think you could benefit of a higher sample rate (if possible). I also think you have some rounding error in the 4. or 5. digit behind the decimal point. This causes a lot of artifacts then using the peak/valley detection function. Do you really need all those digits or precision? If you have no use of it you should discards those digits. Your data also have some irregularity in time between samples but I do not know if this significant. If I deal with a continuous regularly sampled data stream, I often discard much of the timing info. Because I only need the starting point. Start time and sample position give me all the timing details I need. You also mentioned that my crude method did not solve or your problems. Feel free to post more examples.

12-16-2008 04:28 PM
Hillman,
The big picture is that I need to allign and compare arrays to waveforms to identify time reference points that separate peaks at a certain level of amplitude.
I have a program that predicts a parameter's values versus time; this is not a 'perfect' t0, dt, Y type of output but rather a values versus time type of arrays that I read from a csv file. The points or "the signal" comes out clean, without noise (I get predicted values versus time)
Then, I acquire the actual parameter values versus time using a daq device; the data is stored in a zipped access file. I need to read this file and extract parameter versus time then I need to align the actual signal (I am going to call it this way) to the predicted signal. They may start at different times but I know I can align them (I need this for further processing not discussed here) using the point in time where the signal starts to increase from an initial steady state. This steady state would be 0 value for the predicted signal and some very small varying value for the actual signal.
This is why I would need to find out where is the point where the signal starts to increase significantly (over a certain treshold limit).
2) A second task is to determine the position and value of the actual peaks, valleys, and where the flat zones start and stop. I need these positions to place cursors that separate peaks that fit into a certain level of magnitude. The separation lines (cursors) should cross through the middle of the flat zones or through the valleys (if no flat zones) to allow a clear separation of the peaks. It is not really a separation but rather I need the times for this virtual separation.
Given what I need to do, what you presented initially helps a little; the solution presented by IanW clarified one of my mistakes (I was considering a constant dt for the time data from predicted signal file. However, what am I going to do in case of the actual waveform that has some noise. How would I avoid the noise and determine where the signal starts to increase for the first time within reasonable approximation? Would that treshold do the trick?
The idea posted by t06afre would work fairly good for the predicted array of points (predicted signal) but I'm not sure it would work well for the actual measured signal.
Does this clarify? And if it does, what suggestions would you have? Can you enhance the previous example to handle this scenario?
Thank you.