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: 

How to find peak height and check the number of pulses

Solved!
Go to solution

Hello everyone.
I started studying LABVIEW online.
  I want to write software for finding peak height.
I have the LABVIEW 2020 version.
What I'm trying to do is read pulses from my scoop and check how many pulses I have.
And what is the height and position of each of the pulses.
I have several types and widths of pulses.
To find the right number I change the width of the software, but I still haven't figured out how to do it.
I tried using examples but couldn't
I hope to get help and direction what I need to do.
I added file VI
The signals can be changed with "Signal" total I have 4

 

Eliran

Download All
0 Kudos
Message 1 of 13
(3,109 Views)

For example.

In the picture I have now attached, I should only detect 10 pulses.
It finds more pulses. How do I filter the noise from the right side of the graph?
When I change the lower threshold it also gives me the first pulse on the left side of the graph.
How can this be improved?
I know in advance how many pulses I'm supposed to see. Does it help?

 

Eliran

0 Kudos
Message 2 of 13
(3,067 Views)

You posted your code using version LabVIEW 2020. You should  save for a previous version. I would save it all the way back to 2017 if you really want people to help.

 

Try making your width parameter wider and see if you are getting better results. I would also change your threshold to 0.0025.

Tim
GHSP
Message 3 of 13
(3,058 Views)

I changed the version.

Thanks, I've learned

 

 

0 Kudos
Message 4 of 13
(3,043 Views)

For the signals as you have them attached I get the following results.

 

signal 0 I used settings of Threshold = 1 width = 400. I get 1 pulse

Signal 1-3 I used the settings of Threshold = 1 width = 75 and got the correct result

Signal 4 will be tougher. I did use the setting of:

Threshold = 0.0075 width = 90 and I get 9 pulses.

Tim
GHSP
Message 5 of 13
(3,036 Views)

What is the end result you are hoping for? Are you trying to get your code to automatically find the pulses? If so you are going to need more complicated code to do that.

Tim
GHSP
Message 6 of 13
(3,030 Views)

Thanks for the quick responses.

In Signal 4 I need to find 10 pulses. There is a low pulse on the left side of the graph. And when I change the threshold it is not counted.

 

The following data I do know. The pulse width of the scoop and the number of pulses I should see

 

Yes eventually I want to find automatically.What width do I need to know in advance? I would like to know the correct way to do the process automatically

 

Eliran

0 Kudos
Message 7 of 13
(3,017 Views)

The width will depend on your process and how repeatable it is. If you know that your pulse will always be a certain way then you should be able to set a default values. If it is more variable then you will have to find a way to make it search for the correct position.

Tim
GHSP
Message 8 of 13
(3,011 Views)

Can you give me ideas for finding an automated solution. For detecting the number of pulses.

 

Thank you

Eliran 

0 Kudos
Message 9 of 13
(3,005 Views)

If your width is going to vary a lot the NI Peak Detect can be hard to use.  I stumbled across another method, which just defines a peak as a point that is X greater than the points on either side.  (See Eli Billauer - http://billauer.co.il/peakdet.html )

 

See attached, I tried your data with NI Peak detect, Ni threshold detect and Eli Billauer Method (EBM). 

 

All 3 work, but only the EBM works reliably for a "hands off" solution regardless of pulse width (  peak threshold = data_max / 6 )

 

NI Peak Detector works for all with width = 50, except for signal #0 where width needs to be 300.

NI threshold works for all if width = 3.  But you don't get peak info.

 

Enjoy.

Craig

 

 

Message 10 of 13
(2,947 Views)