LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read complex number

I'd like to try IFFT by my experimental data file, which has frequency, Real + Im numbers.
I tried  the Read from Spreadsheet File.vi to read the complex numbers from my data.
Real parts are read but Im parts are not read? Could you tell me how to read whole complex number(s)?
The attached is my data file.
 
0 Kudos
Message 1 of 10
(5,619 Views)
Complex numbers must be treated differently.  I don't know of any LV function that will convert a complex string into a complex number, but here is a vi that will do the trick.  The string must end in i (23.4-14.2i).  The vi separates the real and imaginary parts, and concatenates the signs with the parts.  Then the two strings are converted into regular DBL numbers.  The function Re/Im To Complex (found in Numeric - Complex palette) converts the two numbers into one complex number.  The numeric indicator representation is set for CDB.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 10
(5,599 Views)
Hi tbob,
 
Could you post that as 7.0 format?? I was trying to solve it also.
0 Kudos
Message 3 of 10
(5,592 Views)
Grain of salt here as I am not very familiar with using complex numbers in LabVIEW.  But I would assume you would need to seperate the real and imaginary parts and create a complex number from the two.
 
 
0 Kudos
Message 4 of 10
(5,592 Views)


you would need to seperate the real and imaginary parts and create a complex number from the two


Chaos, if you would read my post you will see that this is exactly what I did.

Here is the 7.0 version.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 10
(5,578 Views)
Yeah tbob I know Smiley Mad
 
I was replying (and then I got busy doing something else) and when I finally submitted there were replys already.  I probably should have edited the message and removed everything but I did not have the time so I just left it there.  Oh well Smiley Happy cant win them all...
0 Kudos
Message 6 of 10
(5,571 Views)
Here is what I did to read it from the file.
0 Kudos
Message 7 of 10
(5,547 Views)

Thank you All.

What I did was separate the complex number in 2 columns (considered as

2 real numbers and use Re/Im To Complex function to read as a complex number.

My vi is attached.

0 Kudos
Message 8 of 10
(5,515 Views)

Thank you for your time.

What I did was separate the complex number in 2 columns (considered as

2 real numbers and use Re/Im To Complex function to read as a complex number.

My vi is attached.

0 Kudos
Message 9 of 10
(5,513 Views)
 
0 Kudos
Message 10 of 10
(5,512 Views)