LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading 1 coulumn .csv file and displaying its PSD

Solved!
Go to solution

Hello,

 

I have a .csv file that corresponds to readings (every 1 second) of voltage.

 

I am able to read it using LabView, I use Read Spreadsheet and take its output (All Rows) then select the first column only, then pass it to Build Waveform, then display Power Spectral Density.

 

Unfortunately, nothing appears.

 

Any ideas? The files just contains double numbers (e.g. 0.01234 etc). There are 50 thousand rows.

 

Thanks in advance.

0 Kudos
Message 1 of 7
(3,127 Views)

Your lack of a dt could be a major problem (default to 0).  The dt should be your sample rate (in seconds/sample).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 7
(3,111 Views)

It works fine for me.  

 

Some troubleshooting tips:

 

You need to make sure dt is set to a positive number (I just used 1).

 

Have you confirmed that you are passing a valid waveform to the FFT Power Spectrum and PSD.vi? The easiest way to do so would be to wire your input waveform to a graph and make sure it looks good. 

 

Does the FFT Power Spectrum and PSD.vi generate an error?

 

Sometime spectrums are hard to see on graph -- try creating an indicator from the block diagram (right click on the output and click "Create Indicator") and check to see if it is indeed returning nothing.

 

Hope this helps,

 

Simon

Message 3 of 7
(3,105 Views)

Hi,

 

Yes dt=1. And I output it to a graph and it works fine.

 

Please try the attached file, corresponding to first 1000 samples.

 

(change extension to csv)

Download All
0 Kudos
Message 4 of 7
(3,098 Views)

OK so I was able to get correct result. But still there seems to be something wrong.

 

When I plot the PSD the range is around 1m Hz to 0.5 Hz which is fine.

 

But then when is normalize the signal by dividing it over the square of the resistance, the freq. range change! It shouldn't! only the amplitude should be affected.

 

Please see the attachment yourself. Use the sample csv file in the previous post.

0 Kudos
Message 5 of 7
(3,091 Views)

I tried to edit the previous post but not possible.

 

Anyway, dividing the output of the PSD actually seems to affect x-axis instead of y-axis !!!

 

Don't know why!

0 Kudos
Message 6 of 7
(3,088 Views)
Solution
Accepted by topic author student_1

Hello,

 

I solved the problem by unbundeling the signal out of the PSD, then taking the magnitude subsignal and scaling it alone, then bundeling together.

0 Kudos
Message 7 of 7
(3,070 Views)