LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to find element when the index is not integer

Solved!
Go to solution
Highlighted

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

 

屏幕快照 2019-03-12 下午3.08.07.png

 

屏幕快照 2019-03-12 下午4.53.38.png

0 Kudos
Message 1 of 9
(820 Views)
Highlighted

Capture.PNG

Upload the VI.

Bill
CLD
(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.
0 Kudos
Message 2 of 9
(783 Views)
Highlighted
Solution
Accepted by topic author frogliang

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


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

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?

0 Kudos
Message 4 of 9
(766 Views)
Highlighted

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

0 Kudos
Message 5 of 9
(755 Views)
Highlighted

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

Thank you!

0 Kudos
Message 6 of 9
(732 Views)
Highlighted

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 GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 7 of 9
(727 Views)

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.

屏幕快照 2019-03-13 上午11.07.50.png

0 Kudos
Message 8 of 9
(720 Views)
Highlighted

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?

屏幕快照 2019-03-13 上午11.07.50.png

0 Kudos
Message 9 of 9
(719 Views)