01-19-2016 11:58 AM - edited 01-19-2016 12:27 PM
I am having difficulty making the peak to peak detection work. The idea is to send a waveform signal that is converted from dynamic into the Peak to Peak VI to obtain the index of a few different peak locations on my graph. I would then take the index, which would be time in this case to obtain a delta time in order to align my values for superimposing two different graphs. However, I appear to be getting 0 every time I run the peak to peak VI.
01-19-2016 12:26 PM
Can you attach an example VI?
It is hard to tell from the pictures if the issue may be the peak to peak being outside the loop.
You also are not giving any inputs to the peak detector so you have not set a width or a threshhold. The base may work.. but it is hard to tell without an example. Even saving the graph you expect with default values would allow us to run it even without the hardware you have attached.
01-19-2016 12:28 PM
I have posted the VI for the problem I am having. The peak detection is not within the main loop but rather connected outside of it.
01-19-2016 12:34 PM
The items were placed into the main loop, however I am getting indexes of -30, which I find very odd since the graph's x-axis is setup to be from 0-0.1 seconds.
01-19-2016 12:42 PM
Peak Detector VI returns not the values of the x axis, but rather the index of peak in the input array. So if you need the distance between the peaks in time units, you have to index the x axis array with the indexes found with the Peak Detector, and only after subtract the values to get the distance.
Also you are subtracting next index from the previous, so you will always get negative result.
Thanks,
Arev
CTO | RAFA Solutions
01-19-2016 12:44 PM
@emmaaleia wrote:
The items were placed into the main loop, however I am getting indexes of -30, which I find very odd since the graph's x-axis is setup to be from 0-0.1 seconds.
Flip the inputs on your subtraction inside of that FOR loop.
But those values are indexes. You need to multiply by your same rate in order to get the time.
01-19-2016 12:47 PM
Could you please show me an example VI or image of how to exactly execute this? I have tried tweaking the program, however my indexs are quite large and I am relatively new to the LabVIEW programming language.
01-19-2016 01:06 PM
Hi,
I have multipled my rate value by what it should be and my numbers are matching up to exactly what they should be, however my number of peaks found says 25, when I only see that there should be only 5 peaks according to my graph.
01-19-2016 01:13 PM
I think you have some noise in the signal. Try to increase the width, when doing peak detection.
Thanks,
Arev
CTO | RAFA Solutions
01-27-2016 03:53 PM
Try graphing just the waveform that you are using for peak detection. Also, make sure autoscaling on the X axis is on. It looks like there really are 25 peaks, but you are only displaying the first 5.
Bruce