LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Assistance with Peak Detection

Hi,

 

I have some questions about the peak detector vi's.  I have a 2D data array that represents current flowing through a wire.  The current comes up from the bottom, goes around a circular loop and then goes out through the bottom again.  If you run the attached vi you'll see what I mean when you look at the Base Image intensity graph.

What I need to do is somehow isolate the pixels in the array that are part of the wire, and omit the rest of them.  Since my wire is really skinny (about 10 microns) and the spacing of the data points is larger than this, the width of the current in the array should only be one pixel wide.  So after I extract my maximum signal I should have a graph of individual pixels that represent the current in the wire.

The % Peak Threshold is a user input and when it's set to 0 the All Peaks graph shows every peak in my array, which is way too many.  So then I increase the Peak Threshold to 13% and the All Peaks graph pretty much shows the wire that I'm looking for but there are "tails" associated with some of the data points.  I define a "tail" as a few pixels that branch off from the main wire path, and these pixels are extraneous peaks.  When I increase the Peak Threshold to 15 or 16 I still see the tails, but now some of my wire starts to disappear.

The graph X Peaks shows the contribution of the peaks when I do the peak detection along the X axis, and similarly for the Y Peaks graph.  These 2 graphs are combined to get the All Peaks graph, and I can see for this data set that most of my current is in the Y direction, so I could almost use the Y Peaks graph and be done.

But then if I flip the switch Data Type to use the Branching data, this data shows current flowing in a vertical line and branching off to the right side, so there are definitely X and Y components.  And this is when the tails come in to play a lot more.  When I set the Peak Threshold to 13%, the All Peaks graph shows the vertical line with the branches to the right but all of the segments have the little tails branching out, and these are the artifacts that I'd like to get rid of.

If anyone has experience with the peak detector vi's I'd appreciate any feedback to help me figure this out.

Thanks a lot.

Steve

 

0 Kudos
Message 1 of 2
(2,371 Views)

Steve,

 

I have taken a look and this looks like quite the code!  An interesting application for sure.  Some things you may want to look at are weighting or filtering the peaks based on their amplitude and second derivative (the other two outputs of the peak detector function).  This would allow you to exclude certain peaks if they are substantially lower than others, or sharper/shallower than others.  Also, I would look into varying the width of the sample to detect peaks.

 

Finally, it seems that most of your branches are appearing in the X Peaks graph.  You could vary how this is handled by sending different thresholds and widths to each peak detector function.  Unfortunately, for the second set of data, the branches occur more in the Y Peaks graph.  Perhaps optimizing for each and then taking the best result could help.

 

Good Luck! 

Drew T.
Camber Ridge, LLC.
0 Kudos
Message 2 of 2
(2,331 Views)