LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

peak counting with burst counting, etc

Solved!
Go to solution

I am trying to write a program that counts peaks (+ spikes) and valleys (- spikes) and bursts (defined as 3 or more peaks in a row with 1 msec or less in between them) and peaks and valleys that are within 1 msec of each other.  The peak counting part is easy but I am doubting myself on the other parts. Can someone take a look and let me know if I am way off base? Right now I don't have any data to test it but the signals we are looking at are EEG-like (actually looking at individual neuronal cells and recorded signals from Microarrays). thanks

0 Kudos
Message 1 of 5
(2,496 Views)

mtgjbird01,
I looked over your code, and it looks like it should work.


As you know, this is difficult to determine without real data.


My recommendation would be to create some simulated data and feed this into the VI to test it. The easiest way to do this would be to create a 1D array of values, and feed it into both Peak Detector.vi's in place of your blue Signal input.

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,467 Views)

Thanks for looking at it.  I will try using some simulated data.  My major concern is in the part of the program that counts events with both + and - parts to them - I am a little worried that this may be overestimated if there are several peaks of one kind (say + peaks) within 1 msec of each other because I have the time of peak data from both the + peaks and - peaks combined into an array and then sorted ascending and this doesn't take into account whether the peaks are + or -.  Is there a way to assign some kind of value or index to each time of peak value to ensure they are looked at singly?

0 Kudos
Message 3 of 5
(2,456 Views)
Solution
Accepted by topic author mtgjbird01

mtgjbird01,
The main issue you are running into is merging the (+) and (-) peak arrays. When you do so, you can no longer tell whether the item is a (+) or (-) peak.

 

We need some way of saving this information, and then still being able to sort. This can be done by Bundling the Double value with a Boolean, then applying the sort. After the sort, we will still know whether it is a (+) or (-) peak based on the Boolean Value.

 

Sort Bundle.png

 

 

Jared A.
Applications Engineer
National Instruments
Message 4 of 5
(2,444 Views)

YAY! Thanks! you are the best!Smiley Very Happy

0 Kudos
Message 5 of 5
(2,430 Views)