LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from a file to a waveform

Any body please help me.
I'm having 1024 samples in text file.I want to find FFT of those samples.For that i have build waveform and give it to FFT block.I dont find any logic for that since I"m new to that.Anybody please help me.
0 Kudos
Message 1 of 7
(3,334 Views)
You first need to read the file and convert it to a 1D array of numerics (Read From Spreadsheet File might work for you). Then use the Build Waveform function on the Waveform palette. Right click on the Build Waveform and choose Select Item>Y and wire your 1D array to it. Right click the Build Waveform function and choose Add Element or just drag it down to create a new element and select dt (delta time) for the new element. Wire your sample rate to that.
0 Kudos
Message 2 of 7
(3,334 Views)
With this i'm attaching the text file from which i want to read and a vi to find fft.I'm able to read the file but i'm not getting fft.I think i'm wrong in mentioning the waveform components.Specify me the components.
Download All
0 Kudos
Message 3 of 7
(3,334 Views)
You dt and t0 don't make any sense. You've done the sampling every 1024 seconds? Since you didn't save tha ctual sample rate in the file, I hope that it was you that did the scquisition and remember what you actually did.

P.S. You could have used a single Read From Spreadsheet File function to read the file.
0 Kudos
Message 4 of 7
(3,334 Views)
Actually i didnt do that sampling.That wass the requirement camt to me.
Any i'll enquire and do that.What about to.
And since it is a single column its okay.How to set the vi to read to any selectable column i f many columns were there.
0 Kudos
Message 5 of 7
(3,334 Views)
If u have any example please attach it
0 Kudos
Message 6 of 7
(3,334 Views)
If you open Read From Spreadsheet File and run it, all you have to do is select your file when prompted. The all rows 2D array indicator has the data in column one (using your example file). Different columns of text data will be in different columns of the 2D array. Simply index the array to get the data you want. The only thing you would have to modify is the delimeter to match what is in your file and the format to match the precision of the data you want. An back on the subject of an FFT, there is the Real FFT function on the Analyze>Signal Processing>Frequency Domain palette. You don't need to convert a 1D array to a waveform datatype to use it but I would think that eventually you would want to know the sampling rate
.
0 Kudos
Message 7 of 7
(3,334 Views)