LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to analyze spikes?

Still learning LabVIEW.

 

I need to quantify "spikes" in my data. Some typical patterns we see are posted below. I am new to all the analysis that can be done and would like some pointing in the right direction to catch what I need to catch. My process normally gets spikes at certain times that are associated with a DI signal. What I am looking to do is to quantify how high the spike is and how long it stays high.

 

What analysis function or technique would you point me toward?

 

Some of both?Some of both?Out of controlOut of controlGood spike example.Good spike example.

0 Kudos
Message 1 of 5
(1,366 Views)

Step 1 is probably separating each occurrence.  If you want to do this automatically, you probably want to start with the "Basic level trigger detection" VI in the "Waveform --> Analog Waveform --> Measurements --> Waveform Monitoring" palette. 

 

With your example data, you probably want to look for a rising edge of around 100.  Then use the "waveform subset" VI to snip the early part of your waveform that you don't care about.  Then run it again only this time looking for a falling edge around 100, and snip to that as the endpoint, so now you hopefully have a waveform only 

 

Next you probably want to find the "base" level there.  You could convert the waveform to an array and then take a histogram of the array.  Whichever histogram bin or adjacent bins have the highest count by far should be your baseline level. 

 

Now you hopefully have a single case combined with a baseline level for that case.  Now you'll want to run the trigger detection again at a higher level than your baseline (probably a percentage difference between the peak and the baseline) to isolate the peak at the end of the wafeform. 

 

Once you isolate that, there's a few different measurements you could base your pass/fail criteria on:

1. Peak absolute size

2. Peak relative size

3. Pulse width (at some set point, like 50% of the peak or whatever)

4. Total area of the pulse (add up all the data values in the pulse after subtracting the base level from each of them)

5. Some combination of the above

 

You'll probably want to put some sanity checks in there to make sure that no values that are amazingly weird pass automatically, and require manual inspection.

Message 2 of 5
(1,331 Views)

@Kyle97330 - Thank you so much for the detailed answer. I'll try what you are suggesting.

0 Kudos
Message 3 of 5
(1,324 Views)

Kyle has shown some great insights.   I'll fill out some basics 

 

Now,  let's just ask.  Could you please restate what measurements you would like?  Many are simple enough that they have built in  LabVIEW functions. 

 

EDIT: You just might want to place that "kick-back" diode the other way across the relay coils. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(1,323 Views)

@JÞB wrote:

 

  • You do not have a "DI" or Digital Input. That there would be a digitized analog signal.  Ya betcha!  There is a difference, you have to learn that FIRST!

Yeah, I'm not that new! I should have been clearer. What is shown is a analog 0-10V voltage sensor. When I said I have a digital Input I was saying that I have an additional digital input that will have a off - on or on - off that happens at the same time the spike starts.

Message 5 of 5
(1,307 Views)