From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

peak detection with two thresholds

Solved!
Go to solution

Dear colleagues!

 

Excuse me, but I need example or any help for peak detection with two thresholds. Namely two adjustable thresholds with standard peak detector for creating a detection's bandwith or range. 

 

Peak detector have only one level threshold... But why only one...Smiley Happy

0 Kudos
Message 1 of 20
(5,269 Views)

If I understand correctly, you want to set two thresholds as shown in the image below.

 

The top peak is easy, so no need to go into details for that one.

The peak for the second threshold (red) will be a bit more difficult to do.

 

You would need to filter out the signals that cross the top threshold (blue).  This would be done by identifying the values as they cross the top threshold boundary.  You would then need to build a "window" around them (we'll come back to this one).

 

You would need to define a range of valid values for the 2nd peak, which are from the bottom threshold to the top threshold. Search for the number of values that cross the top threshold plus one.  The "plus one" is the one you will want to search. With all the other peaks that you do not want, you can create windows around them.  The remaining one is the peak of interest.

 

 

Message Edited by Ray.R on 10-23-2009 08:21 AM
Message 2 of 20
(5,262 Views)

Dear Ray, you are right... but may be is simpler way?

 

For example, I think that is better run "peak detector.vi" two times, i.e. once finding min threshold and the next time finding pulses of max threshold level.

General result of such a peak detection with two tresholds is following: "counter min threshold" - "counter max threshold"= "counter of pulses between min and max threshold."

 

Am I right or not?  I think that it is good for finding count of pulses...

0 Kudos
Message 3 of 20
(5,224 Views)

I would have to experiment with how the peak detector would behave within a upper boundary.  It might work.  If so, it would certainly be easier.  If it looks for the maximum values within an array, it might get confused with the values that belong to the peak which is above the upper threshold.  What I mean is I do not know how "peak detector.vi" will deal with the values circled in green that I called interferences.  See image below:

 

 

Message Edited by Ray.R on 10-26-2009 08:28 AM
Message 4 of 20
(5,215 Views)

I'm not sure but for solving this need to write external "dll", i.e. C code.

 

May be does anybody know how to solve this problem??      

0 Kudos
Message 5 of 20
(5,134 Views)

Hi,

 

The attached VI is based on the NI Example Peak Detection and Display.vi.

 

 

 

Does this help you?

 

cheers

 

David

Message Edited by David Crawford on 11-06-2009 12:07 PM
Download All
Message 6 of 20
(5,123 Views)

Nice VI David.

 

Off-topicDavid's VI snippet demonstrates an issue with snippets where the property nodes get changes to Strict typeTo get that snippet to work, I had to disconnect the control "reference" and either create a static new Reference off of "Peak Plot" cluster, or create a new static property node.

Message Edited by Broken Arrow on 11-06-2009 08:09 AM
Richard






Message 7 of 20
(5,111 Views)

Appreciated!

 

Yeah, I had noticed that. It also removed the constants 0 and 1 for the two active cursor properties. Maybe they are hidden under the property node.

Message Edited by David Crawford on 11-06-2009 02:20 PM
0 Kudos
Message 8 of 20
(5,106 Views)

Thank you very much for your help!!

 

Tomorrow I'll check it.

 

 

0 Kudos
Message 9 of 20
(5,102 Views)

David Crawford wrote:

 

.... It also removed the constants 0 and 1 for the two active cursor properties. Maybe they are hidden under the property node...


Yep, they are under the node. Yet another unwanted side effect.

Richard






0 Kudos
Message 10 of 20
(5,091 Views)