LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

import CSV files and FFT Graph

Hello All,

 

I'm a relatively new to labview and need some help. I have some .csv files with multiple columns of data that i need to do a fourier transform to see what frequency i need to filter the data through. I've been messing with some commands and blocks in labview, but haven't had much luck connecting them. I'm trying to have some way to be able to choose which column of data in the csv file is going through the FFT function at a time. I don't really know how to start.... any help would be appreciated.

 

Thanks!

0 Kudos
Message 1 of 6
(4,016 Views)

What have you gotten so far? I'm assuming you're using the Read From Spreadsheet File VI? That will give you a 2D array of values. If your data is in columns, Index Array can be used to pick off specific columns. Just feed it the 2D array, wire a constant to the "column" input (remember that arrays are zero-based indexed), and leave the "row" input blank. This will give you a 1D array that is that column.

0 Kudos
Message 2 of 6
(4,009 Views)

Below is what I have so far. I'm not sure on two things:

 

1) How do I use the index array block to select which column of data i want to use?

 

2) How can i connect that data to get a frequency spectrum graph?

 

Thank you for your quick response!

 

current_vi.PNG

0 Kudos
Message 3 of 6
(4,005 Views)

Always have the Context Help window open when you are starting out learning LabVIEW. Did you do the tutorials? I'm sure they cover arrays. As I said, you need to wire a constant to the "column" input. See that little black square on the left of the Index Array? That's the "row" input. The one below it is the "column" input. So, either:

  • put a numeric constant on the block diagram (integer), and connect it to that input, and set the constant to the column you want
  • right-click on that input and select Create -> Constant. That will give you a numeric constant that you can then set.

As for the graph, that's not the correct way to use a waveform graph. It appears as if you are trying to do an XY thing. That's what the Build Cluster is used for. If you hover the cursor over the waveform graph terminal on the block diagram, and have the Context Help window open then it will show you how to build data for it. There are also shippiung examples on the various types of graphs.

Message 4 of 6
(3,998 Views)

Thank you for the help.

 

I've been looking through some other examples but haven't found any of the tutorials. I can now import the csv files. Is there a better method to graph the output of the fft than a waveform graph?

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

To learn more about LabVIEW you go can through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.

 

In terms of the graph, you can use an XY graph instead of a waveform graph. A waveform graph is designed to be used with equally-spaced datapoint. An XY graph is not. You wire your array of freqencies to the top terminal of the Bundle function.

Message 6 of 6
(3,959 Views)