LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to know the index of 0.707maxvalue of an array.Is there anyone who can help me?"

I need to know the index of the maxvalue and the index of 0.707maxvalue of an array. Now I knew how to get the index of the maxvalue in formula. Does anyone know how to get the index of the 0.707maxvalue of the array?
0 Kudos
Message 1 of 15
(3,641 Views)
See my 8/18/03 updated example in response to your first question.
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000C09B0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0.
With a little more patience, you may not need to ask every question twice.
Message 2 of 15
(3,641 Views)
Thanks for your detailed answer. I am so sorry, I can not understand it. So can you do a C like program in a formula node to get the index of the 0.707maxvalue. Thanks.
0 Kudos
Message 3 of 15
(3,641 Views)
My updated example shows how to use LabView to find the index of a value that's close to 0.707 of the max. My third example (attached here) finds the value that's closest to 0.707 of the max. This really is a LabView forum, so I gave you a LabView example. If you have any specific questions, I'll try to help.
In general, whether you're doing it in C, a LabView formula node, or using LabView functions, here are the basic steps.
1. Search the array for the maximum value, saving the value and its index.
2. Calculate 0.707 of the max.
3. Search the array again, look for the value that's closest to 0.707 of the max. Save that value and its index.
If you can't understand the example, you'll be doing yourself a favor if you take the time to wo
rk through the LabView tutorial. It may be even better to take an LabView class if you can afford it.
0 Kudos
Message 4 of 15
(3,641 Views)
Thanks for you kind help. Here is the attached array file. When I run this prgram and want to get the index of the maxvalue and the 0.707maxvalue. The result is wrong. I do not know why. Can you do me a favor?
0 Kudos
Message 5 of 15
(3,641 Views)
I have a new problem. In the following attachment, you can see three series of array, and a plot. What I want to know is two frequencies: the first one is the frequency facing to the top value in the plot; the second one is the freauency facing to the 0.707top value in the plot. If I know the index of them, so I can get the frequencies very easily. So here the key point is how to get the indexes. You can see the S12 are all negative numbers. So that if I want to know the frequency facing to the 0.707topvalue in the plot, I cant just let 0.707 multipy the top value. Do you have any idea? Thanks.
0 Kudos
Message 6 of 15
(3,538 Views)
> Thanks for your detailed answer. I am so sorry, I can not understand
> it. So can you do a C like program in a formula node to get the index
> of the 0.707maxvalue. Thanks.

You can write C-like functions in the formula node, but only if you can
pay attention to the syntax details. That is why people keep telling
you to use the simple built-in nodes, because they don't the low-level
syntax.

If you want to find the value that is .707 of max, you can probably use
the Threshold 1D Array, but beware that the threshold expects for the
value to start below, then go above.

If you have a recent version of LV, the formula supports for loops. If
you are getting a message about arrays, either dimension the array
inside the formula, or make t
he array be both an intput and output variable.

Again, for more details, it may be necessary for you to post your VI or
be more precise about the problem you are having.

Greg McKaskle
0 Kudos
Message 7 of 15
(3,538 Views)
Unless you know that the array is some particular function (say a straight line), then there is no answer to your question. After all, suppose your data looks like this:


/\
/ \
/ \
/ \
/ \

It's easy enough to find the peak, but there are TWO points close to 0.707 peak. Which one do you want?

Suppose your data is this:

/\
/ \
/\ / \
/ \_/ \

There are four points close to 0.707 peak. Which one do you want?
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 8 of 15
(3,538 Views)
This is now a 2D array, not a 1D array like your previous example. Do you want to read an individual row or column or concatenate all rows or columns into a 1D array? If you want to put all measurements into a 1D array, do you want to go in row or column order?
What do you mean by 0.707 max value? All numbers are negative, so a value of 0.707 of max will not exist in the array. Do you want to find the min or the max abosolute value?
0 Kudos
Message 9 of 15
(3,641 Views)
> Thanks for you kind help. Here is the attached array file. When I run
> this prgram and want to get the index of the maxvalue and the
> 0.707maxvalue. The result is wrong. I do not know why. Can you do me a
> favor?
>

Since after repeated requests to attach code, you instead give some raw
data and ask for the answer, I can't help but think that you are just
wanting the answer to turn in for a lab, and in fact you have no code or VI.

I'll gladly help you with LV questions, but it has been a long time
since I've helped someone with a lab report. If I'm mistaken please
forgive me and attach the VI. If I'm right, do your own homework and
stop bugging this forum till you honestly want to learn LV.

Greg McKaskle
0 Kudos
Message 10 of 15
(3,641 Views)