05-10-2011 02:16 AM
Hi I am using labview 7.1
I have an output of a device saved in a excel file. (which is basically voltage v/s time)
Now I wish to perform an FFT over this data ie. I want the variation of the signal with respect to frequency rather than time.
How should I do this in labview?
Solved! Go to Solution.
05-10-2011 03:17 AM - edited 05-12-2011 08:39 AM
Assuming that the samples are equally spaced in time, simply do a FFT of the signal as a 1D array.
Pick any two adjacent time points to calculate dt, from that you can calculate df, i.e. the frequency spacing of the transform.
df=1/(N*dt)
05-12-2011 01:05 AM
Hi...Thank you for your reply !!
Actually im new to labview so I had a small doubt as follows -
I have a large no. of points (around 6000)..so when I use the 'build waveform vi', i shall have to enter so many values of Y which is impractical..so can u please suggest me a better way to build a waveform using these 6000 points I have in an excel file.
Thanks!!!
05-12-2011 03:00 AM
Hi NitW!
Altenbach's last link has an error. Here is the same but without the http://http://.
Regarding reading from Excel, how is the data saved in that excel file? One way to read all the data is to save the excel file as a .csv file, and use "Read from spreadsheet file VI" to read the excel file. i have LV 2010 so I can't send you an example since you use LV 7.1, but I can post a picture:
My Excel sheet .csv Frontpanel and also the blockdiagram.
Now you have the data. I'm not so good with FFT. But the link should guide you further.
05-12-2011 08:45 AM
(Thanks, I corrected the link.)
There are many ways to read data from an excel file. If you don't want to use file I/O, and if you have the excel sheet already open in excel, simply select the desired column and paste it into a string control, then use "spreadsheet string to array" to convert to a numeric array.
05-16-2011 01:24 AM
Hi,
I have used the 'FFT (Mag-phase) vi'. Now I wanted to save these 2 outputs ( Magnitude and phase) in a spreadsheet file. I am not able to directly use the 'save to spreadsheet vi'
I would like to know how can I do the same.
Thanks a lot !!
05-16-2011 01:36 AM
Hi NitW,
What exactly is the trouble you are facing while trying to use Write to SpreadSheet function? Try building an array(2D) of your magnitudes and Phases and wire it to the "2D array" terminal of the Write to Spreadsheet function and then run it.
Regards,
Nitzz
(Kudos are always Welcome, Accept as a solution if it is the One;))
05-16-2011 02:12 AM - edited 05-16-2011 02:13 AM
NitW wrote:I have used the 'FFT (Mag-phase) vi'. Now I wanted to save these 2 outputs ( Magnitude and phase) in a spreadsheet file. I am not able to directly use the 'save to spreadsheet vi'
You need to unbundle the mag and phase 1D arrays (see image), built them into a 2D array, then write the result to a spreadsheet file. Transpose if desired.
05-16-2011 09:25 AM - edited 05-16-2011 09:26 AM