LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write FFT data to a spreadsheet/text file

Hallo all

This might be a simple question but I need to log the FFT data into either a text or excel file.

I need time averaging, and I will be running the program for a while (about 1h), so I do not want to log too much data. I would prefer to log only the data from the graph.

 

0 Kudos
Message 1 of 6
(5,544 Views)

Learn LabVIEW.  Then you can do what you want to do without using Express VIs, which make many assumptions, hide functionality from you, but are quick, "easy", and limited.  I believe there is a "Write to Excel" option in Measurement File (I've never used this Express VI, so have no first-hand experience).  Since you are running LabVIEW 2015, you do have access to the Report Generation Toolkit, which supports writing Excel Worksheets (.xlsx files).  If you manage the data yourself, you can control what gets written, how much gets written, how often it gets written, etc.

 

Bob Schor

0 Kudos
Message 2 of 6
(5,506 Views)

Hej BOB I am trying to learn labview, but this takes time, I unfortunately need a working solution for work that I have to do relatively soon.

I have tried to write the file in a few ways, but I keep strugling with how to break the dynamic data up into managable parts, and average them over time, and set the frequency range to something manageable, since I only need the frequency data in a limited range. 

0 Kudos
Message 3 of 6
(5,490 Views)

@Artapel wrote:

Hej BOB I am trying to learn labview, but this takes time, I unfortunately need a working solution for work that I have to do relatively soon.

I have tried to write the file in a few ways, but I keep strugling with how to break the dynamic data up into managable parts, and average them over time, and set the frequency range to something manageable, since I only need the frequency data in a limited range. 


You have 3 options:

  1. Pay a programmer who will make the code for you for money
  2. Pray and wait for someone who will do the code for you for free
  3. Make some effort, and start to program your VI properly, not using Express VIs, and avoiding dynamic data type. Start to check some examples shipped with LabVIEW, and learn from the available resources...

If you told us what is the actual task your code need to do, we could suggest some LV example as a starting point. In the VI which you show you just simulate a sinus wave. What will be the actual source of data in your final vi?

0 Kudos
Message 4 of 6
(5,480 Views)

I will be getting high frequency sound data from an analoug input (I am using a USB-6343 DAQ), resulting in something similar to the sine input signal. I then need a FFT analysis to get an intensity vs frequency range. I then simply need to log the data in a readable format, maybe CSV or excel. Any help would be appreciated

0 Kudos
Message 5 of 6
(5,460 Views)

@Artapel wrote:

I will be getting high frequency sound data from an analoug input (I am using a USB-6343 DAQ), resulting in something similar to the sine input signal. I then need a FFT analysis to get an intensity vs frequency range. I then simply need to log the data in a readable format, maybe CSV or excel. Any help would be appreciated


Now it is more clear what you would like. You need to specify some more parameters:

  1. what is the expected voltage range? The USB-6343 can work with +-10 Volts signal
  2. What is the required max frequency in your FFT procedure? This DAQ device has only a maximum sampling rate of 500 kHz (divided over all input channels, but if you use only one channel, you get this sampling). Keep in mind the "Nyquist criterion" ( http://www.ni.com/white-paper/4278/en/#toc2 ) It means the maximum frequency which you can study with this hardware is only 250 kHz (or rather below).

You could use the following example as a starting point: https://decibel.ni.com/content/docs/DOC-2431

You need to change the DAQ to single channel sampling, and the idea is that, you do the FFT inside the Consumer loop, on certain chunks of the incoming data. After the FFT is done, you can save some reduced size representation of the results in a txt file for example, but I would recommend using TDMS files, since they are easy to import into Excel, but since they are binary, you can access the stored data from LabVIEW faster later...

 

edit: there is one flaw in the above Producer/consumer example, namely the graphing should be moved from the Producer to the Consumer loop. Usually it is best not to have anything inside the Producer loop, only the DAQmx Read function, and the Enqueue function...

0 Kudos
Message 6 of 6
(5,448 Views)