LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different elements in two 1 D array

Solved!
Go to solution
You cannot have negative indices.
0 Kudos
Message 21 of 31
(1,119 Views)
My middle elemnt is having an index of (3,3). So i add 3 to every index obatined from the previous array . so there are no negative indices comin. only indices up to 0 are coming.
Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 22 of 31
(1,117 Views)

Hello Altenbach

 

I have attached my VI. I was able to make it for only one column from each array. I need it for all the columns. How can that be made?

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 23 of 31
(1,111 Views)

Sorry, it is still not clear what kind of output you want. Can you point to a website explaining the algorithm?

 

So far you're not "calculating" anything, just shuffling data around in different arrangments.

 

Again, your first FOR loop in unecessary. Simply remove it and things will still be exactly the same. (the complex primitive accepts almost anything (scalar, 1D, 2D, etc.)).

 

Where is the FFT array coming from? If you right-shift the size array by one bit, you don't need to divide and round to -inf at all, no orange needed. 🙂

0 Kudos
Message 24 of 31
(1,104 Views)

welll .. the algorithm is a kind of my own.

see attachment

 

 

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 25 of 31
(1,092 Views)

Well, easiest would be if you would modify my old bilinear interpolation tool to accept complex inputs and give complex outputs. Shouldn't be too difficult.

 

Then you would just code as follows:

 

 

All clear?

Message Edited by altenbach on 12-16-2008 05:16 PM
Message 26 of 31
(1,074 Views)

Hello Altenbach

 

Thnx for your help. I have already seen your bilinear interpola demo some few week ago. I tried it that way but the result which i want does not come. Now at th emoment i have achieved a VI that formulates the required output, but this is only a small portion. That means the final output of the attached VI "Sub Array in FFT Array" is only due to the first column of Real part & first column of imaginary part arrays. I want such output( which I obtained) for every columns of both Real part & Imaginary part arrays.  The size of appended array ( number of columns may be very large at times).  Is there a possibilty to get such an output array...

Message Edited by Nghtcrwlr on 12-17-2008 07:35 AM
Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 27 of 31
(1,055 Views)

Your code is simply a mees and makes very little sense. There is way too much code! 🙂

 

  • What is the purpose of the FOR loop???
  • Are you aware that "index array" is resizeable? You only need one instance per array!
  • For each 2D complex index, you want to pick the four closest points. Is that right?
  • What will you do with the four points later?
  • My bilinear demo internally picks the four closest elements of a give fractional 2D index before further processing, so you should be able to re-use some of that code. It is very generic.
Message 28 of 31
(1,029 Views)

Hello Altenbach

 

Ya.. I know.. mine is a mess.. thats because am just a beginner..Smiley Indifferent Hope that i improve later... Smiley Tongue

  • If i remove that for loop i wont get the result for the whole number of rows.
  • Yes I understood it now.. Smiley Indifferent
  • Yes for each complex point in 2D array, i need to find 4 closest points in (from) FFT array. I am doing this as follows:

                                                               a)Complex numbers are splitted in to Re & Im parts and each Re & Im part is rounded to nearest + infinity  & nearest - Infiinity. That is for each complex number we get 4 other complex number. That is for example for 0.606763 +0.440839 i see "Attachment1".There are many complex numbers. For each complex number this is performed.

                                                                b) Now these 4 complex numbers are used to find 4 similar points in FFT Array. For that the Re & Im parts of each of these 4 complex numbers are taken and added to index of middle element of FFT array and are considered as the indices of req point in FFT array.  That means, we get a number of set of 4 complex numbers like say [ 1+2i,3+4i,6+7i,9+5i]. Re & Im parts of these numbers are taken and used as indices (1,2),(3,4)(6,7)(9,5). Then elements from the FFT array with these indices are exracted. These 4 points  ( a number of set of 4 points are obtained) are then interpolated.

 

 

These are the final values which i need.

 

 

  • I am trying to use some of your code in interpolation. But the problem is I have already made a method for interpolation of 4 points.

 

 

Message Edited by Nghtcrwlr on 12-17-2008 02:15 PM
Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 29 of 31
(1,020 Views)

Nghtcrwlr wrote:

Yes for each complex point in 2D array, i need to find 4 closest points in (from) FFT array. I am doing this as follows:


 Well, you don't need to jump through all these hoops! As I said, my code already does that.


Nghtcrwlr wrote:

I am trying to use some of your code in interpolation. But the problem is I have already made a method for interpolation of 4 points.


Here's a quick example how you would get the four closest elements as a 2x2 array for each complex fractional coordinate. Just add your own interpolation code.

 

 

Here's how the bilinear interpolation would look like modified for complex inputs and outputs (draft, please verify correct operation!).

 

What kind of interpolation do you actually want?

 

Message Edited by altenbach on 12-17-2008 01:21 PM
Download All
Message 30 of 31
(1,007 Views)