LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT of recorded waveforms

Solved!
Go to solution

Does the .csv file happen to have two commas between the columns of data?  Like this:

 

-0.0125,,-0.04

-0.0125,,-0.02

 

The empty field between the commas would show up in the array with default values, specifically zero for numerics. Also, the field might not be empty but have non-numeric characters such as "volts."

 

Lynn 

Message 11 of 31
(2,051 Views)

Thank you for the reply again. I obtained a waveform using Tektronix Oscilloscope, then got the 12.csv file (attached herewith) by interfacing the oscilloscope with the computer using a software provided by Tektronix. I cannot use LabView for this since I do not have an interfacing card or the software Signal Express Tektronix 😞

 

 From this file you can find information about signal, (I am not sure which of this info will be useful for Labview)

 

Then I developed a VI (attached as test.vi) to read the spreadsheet. To make it readable by Labview, I then copy and pasted the data from 12.csv to a new spread sheet test.csv (attached).

 

But when I plot the waveform the amplitude variation is as per my data supplied but the time axis uses 2500 points instead of actual data supplied by the first column of test.csv and this can be seen by running the test.vi (to plot the waveform, I also needed to take the tanspose of the array in the waveform indicator).

 

Now, am i missing a trick to not to get the exact x-axis info (time axis)????

 

And how to take the FFT of this now????

 

Thank you for your patience.

 

Best regards,

Haroon

 

 

Download All
0 Kudos
Message 12 of 31
(2,032 Views)

If you have software from Tek to connect and control the scope, then you can certainly do it with LabVIEW.

 

Yes, you are missing some fundamental knowledge about LabVIEW. You have to actually provide the dt information to the graph. There are a couple of ways to get the correct x  axis. In your case, since you want to do an FFT, create a waveform data type. An index array function will get column 0 and column 1. Another index array function will get elements 0 and from from column 0 (the time column). A subtraction will give you dt. However, your text file does not have the resolution for this so it would seem you did not save the file with the correct options. You could of course, manually provide the dt or resave the data.

 

Once you a the data in a waveform data type, you can pass it to one of the FFT functions that accept this.

 

Message Edited by Dennis Knutson on 02-28-2010 10:10 AM
Message 13 of 31
(2,024 Views)

I have data in excel which I would like to pull in labview and represent in the form of array. I developed code as per your suggestion below. I managed to get first column on array but I am struggling with the second column.

Please find below the code and excel sheet. I'd appreciate if you have a look and feedback.

Cheers

 

Download All
0 Kudos
Message 14 of 31
(2,004 Views)

kwaris,

 

Your file is not comma separated. It is tab separated so delete the comma you have for the Read From Spreadsheet. Also eliminate the while loop and the second read. You'll need to remove the first element from each array (the column headers).

Message 15 of 31
(1,998 Views)

Thanks Dennis, I removed comma and it works, and I also removed unnecessary while loop and other read pallete. I ran myself into another problem. I turned highlight execution on to check data flow, then in the second test, I had highlight execution on and I did single stepping. Single stepping took the flow into subvis of read pallette, I finished single stepping and wished to run the code again without single stepping because I didn't want to go into subvis and single step within subvis. Unfortunately, everytime I run vi now it automatically takes me into subvis of read pallete no matter if single stepping is on or not.

Please help me.

I would like to not go through the screens of subvis when I debug it with highlight execution on both with without single stepping.

Many thanks

Cheers

 

0 Kudos
Message 16 of 31
(1,967 Views)

Thanks for the replying again.

 

I have modified the vi(attached as test.vi) as per your reply.

 

but still the x-axis information is missing from the waveform.Moreover when I perform the FFT analysis of it, it is not working properly

 

I have re-saved the data attached herewith as 23.csv so that if some information can be used from it.

 

I do get the right info using XY graph but I am unable to perform FFT analysis of that 😞

 

As you said: "If you have software from Tek to connect and control the scope, then you can certainly do it with LabVIEW" Could you please guide me in this regard as well.

 

Anticipating a positive response.

Best regards,

Haroon

 

P.S. I am just beginning to learn the Labview and signal processing, so I can be a bit clueless about the information required at times.

Download All
0 Kudos
Message 17 of 31
(1,958 Views)

kwaris,

 

Sounds like you set a breakpoint. Go to Edit>Breakpoint Manager to clear it.

 

Harkoon2k9,

 

You've changed the format of the csv file and the columns are now different. You will want columns 3 and 4 only and rows 17 or higher. The time data is not any better but at least the sample rate (1.00e-5) seems to be stored in the file. Use that for dt.

 

If you want help with controlling the scope with LabVIEW, you need to provide the make and model of scope and how it is connected to the pc.

Message 18 of 31
(1,949 Views)

Thanks for the reply. I am using Tektronix TDS3054C and it is connected to the PC using ethernet (using cross-cable).

 

cheers

0 Kudos
Message 19 of 31
(1,937 Views)

Hi Dennis, Although I gave you kudos already for this problem because when I read your post it made sense to me. Unfortunately, when I went back to perform it, I got same problem. I have attached the code below, on running it seems as if the code runs through hierachy vis, this is what I want to get rid of. Secondly, the purpose of the code is to take the subtraction of adjacent average values, build them in array. This array values, later on I intend to use as dt to plot against current values.

Thanks for patience

Best regards

 

Download All
0 Kudos
Message 20 of 31
(1,929 Views)