# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution
Highlighted

## how to find element when the index is not integer

I got a peak in the left signal and use this index to get a value in the right signal. these two signals should be synchronous, the red dot in the right picture suppose to be the peak value, but is always delay more data point. I would like to subtract some index value to eliminate the delay, but the location for the peak is not an integer, so how can I find a value near this peak index? I subtract an integer and I get an amplitude of zero.

And I use the peak detector, but this vi no always able to find the peak value, like the green dot in the right picture is the peak detected, but no the max value.

Thanks!

Liang

Message 1 of 9
(824 Views)

## Re: how to find element when the index is not integer

Bill

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 9
(787 Views)
Highlighted
Solution
Accepted by frogliang

## Re: how to find element when the index is not integer

Instead of using Index Array, use Interpolate 1D Array.  This function will accept a fractional index and interpolate what the value should be.

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
Message 3 of 9
(785 Views)
Highlighted

## Re: how to find element when the index is not integer

Thank you! That's a good idea. And could you tell me why the peak detector sometimes miss the max value? like the green dot in the right picture?

Message 4 of 9
(770 Views)
Highlighted

## Re: how to find element when the index is not integer

If you want us to critically examine and inspect your code, you need to give it to us in the clearest way possible, which is as a VI, not a tiny blurry picture of part of the VI.

Bob Schor

Message 5 of 9
(759 Views)
Highlighted

## Re: how to find element when the index is not integer

Sure, why the peak is not always the max amplitude?

Thank you!

Message 6 of 9
(736 Views)
Highlighted

## Re: how to find element when the index is not integer

You also need to include some typical data.

Most of your code makes no sense at all. Why don't you use the "amplitudes" output of the peak finder?

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 7 of 9
(731 Views)
Highlighted

## Re: how to find element when the index is not integer

Yes, I should, is this the reason why sometimes the peak value is not the maximum amplitude?  And I still need to index another synchronize signal to get the corresponding value, I tried to use interpolate 1 d array, but I didn't get the value on the signal, but at the bottom.

Message 8 of 9
(724 Views)
Highlighted

## Re: how to find element when the index is not integer

Sorry, I tried the interpolate a 1D array, but the value is not on the signal. The red dot in the right picture is the outcome of interpolate 1 d array,  should it be around the peak?

Message 9 of 9
(723 Views)