LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine changes in a signal (peaks, valleys and 'flat' zones)

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.

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 11 of 39
(2,009 Views)
I’m afraid I don’t have time to check out all of your program at the moment. I did notice that your data doesn’t have precise time steps, but when you plot out your peaks you assume they are. This gives you an accumulating error when you combine the two XY plots. Use the Peak Detector 'locations array' to build a correct set of X points for the Peaks trace (for loop and index array) and they will coincide with your original plot.
Message 12 of 39
(2,002 Views)

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.

0 Kudos
Message 13 of 39
(1,990 Views)
I have made a cruder peak detection method. I think this works better. Use something like this for the “flat” part. I have also noticed some very small fluctuations in the “flat” part. Are these fluctuations some sort of rounding error because your overall accuracy seems to be much lower than these fluctuations? I made a fix for it but I do not know if it is correct for your application. It is not 100% but close say 99%. But in automated system some error will occurs


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 14 of 39
(1,983 Views)

Sorry labview crashed i gave you the wrong version.

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 15 of 39
(1,972 Views)

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.

 

 

0 Kudos
Message 16 of 39
(1,954 Views)

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.

0 Kudos
Message 17 of 39
(1,952 Views)

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,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 18 of 39
(1,937 Views)

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.

 

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 19 of 39
(1,925 Views)

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.

0 Kudos
Message 20 of 39
(1,906 Views)