LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why Locations in Peak Detector VI are not an integer?

Solved!
Go to solution

Hey,

 

Can anyone explain why Locations in Peak Detector VI aren't integers?

I thought they indicated the index of peaks in the X array.

 

Any help would be appreciated.

 

Thanks,

Plu

 

Ps. I am using labview2015 32bits.

0 Kudos
Message 1 of 4
(793 Views)

Hi Puri,

 


@PuriK. wrote:

I thought they indicated the index of peaks in the X array.


Whenever you "think" about a LabVIEW function you should read its help article. Did you?

 

The help explicitely says:

Because the peak detection algorithm uses a quadratic fit to find the peaks, it actually interpolates between the data points. Therefore, the indexes are not integers.

So what is your question?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(772 Views)
Solution
Accepted by topic author PuriK.

As has been said already, read the help first.

 

Assuming your data is an under-sampled symmetric wave, is is clear that the peaks don't align with the data points, else the two neighboring points would have the same Y. Your phase and frequency is slightly off.

 

altenbach_1-1674747068966.png

 

 

It seems relatively boring to find all peaks of a regular noiseless wave. What kind of information are you actually trying to get out of your real data?

Message 3 of 4
(733 Views)

I really appreciate you taking the time to explain things to me. Your explanation helped me understand better. You said that the data I'm working with right now is without any noise because it was created using an oscillator. But in the future, I'll be getting data from a light sensor that will have noise in it and the measurements will be between 2.5 and 5 volts. I plan to remove any measurements that are bigger than 3 volts. Then, I want to count how many measurements are between 2.5 and 2.8 and how many are not. Unfortunately, the light sensor is still being developed, so I can't test it yet.

0 Kudos
Message 4 of 4
(701 Views)