03-13-2009 07:52 AM - edited 03-13-2009 08:02 AM
hello
I am having a 2D array of complex numbers. I intend to find the peak points in the array. For that i find the average value of the array elements. I subtract the array elements with tthis average value. Values with positive values refer to peaks. My question is how is it possible to sort out the COMPLEX numbers which are greater than zero?? In case of real numbers it is an easy task.
Example :
2
6 >>>>> Average value = [(2)+(6) +(4)]/3 = 4
5
Finding peak points >>>> (2) - 4 = -2
(6) - 4 = 2 Points greater than zero are considered as peaks. So 2 & 1 are peak points here
(5)-4 = 1
Similarly how can we find it for complex number? After subtracting from the average value, how can we differentiate it whether greater than zero or not??
For example for these points? (2+4i),(6+2i) ,(4+3i)
See attached VI
Thankss
03-13-2009 09:49 AM
03-13-2009 10:24 AM - edited 03-13-2009 10:27 AM
The magnitude is never <0, but if you subtract from the average magnitude, you can pick the elements that result in a negative value.
03-16-2009 08:13 AM
Hello ALtenbach
From the complex number 2D Array, i splitte dthem in to Magnitude and phase and I took the average magnitude and subtacted it from the magnitude 2D array. Now i need to find out positve values of magnitude from it and then the complex numbers in the original 2D Array corresponding to these positive values.
any ideas?
Thanks
03-16-2009 09:16 AM
See the attachment below... I have done till subtracting from the avg value. now i need to get the positve magnitude values and then those values corresponding to this positive r in the original complex number
03-16-2009 10:42 AM - edited 03-16-2009 10:43 AM
Nghtcrwlr wrote:now i need to get the positve magnitude values and then those values corresponding to this positive r in the original complex number
Well, you still need to specify how you want the output. You cannot delete individual elements from a 2D array, of course. You could:
So please tell us. In any case, you are still using way too much code. Here's the equivalent code of "peak test 1.vi" with much less clutter. You don't need a FOR loop and there is a primitive to take the product of all dimensions.
03-16-2009 11:27 AM
Hello ALtenbach..
I want to keep it as a 2D array, and zero all short values. But i need the output as complex number., i mean the final output.
03-16-2009 11:40 AM - edited 03-16-2009 11:40 AM
Try something like this:
Makes sense? 😉
03-16-2009 12:14 PM
Hey Nghtcrwlr,
unfortunately I don't understand what output you need. Can you give an exact example, so i can try it in LabVIEW?
Thanks,
cheggers
03-16-2009 02:33 PM
Hello Altenbach
It wrkd... by the method u suggested am getting the result. But i think I do not need that zeros... so hw can i get the values only as 1D array?
thanx