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 can I calculate which is the index (x-value) correspondant to a certain value of a signal?

Solved!
Go to solution

I just want to calculate the quality of the peak in a FFT, defined as you can see in the attached file.

 

For that, I would need to know how can I calculate in Labview the index or indices (x-value) correspondant to a certain amplitude value of the function.

 

Kind regards, and thank you for reading,

 

Jose

 

 

0 Kudos
Message 1 of 6
(2,831 Views)

If you just want the maximum, then use Array Max & Min.  One of the outputs is for the index of the maximum.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,822 Views)

thanks, but I do not want the maximum, but the index of the half of the maximum

0 Kudos
Message 3 of 6
(2,818 Views)

Look in the Signal Processing palette for pulse measurements, peak detector, and threshold detector. One of those VIs or some combination can probably do what you want.

 

Lynn

0 Kudos
Message 4 of 6
(2,806 Views)
Solution
Accepted by topic author Mr_Crack_Spider

If you know the lineshape (e.g. Lorentzian), you can use nonlinear fit. This will give you the most accurate value.

 

In the most simple case (insignificant offset and noise, no other peaks) you can apply the following code (if there are other peaks, then take a apropriate array subset before applying the code). To get correct units, just scale with df.

 

 

 

 

Message 5 of 6
(2,783 Views)

Thanks a lot!!!!

0 Kudos
Message 6 of 6
(2,722 Views)