From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT from XY array

Solved!
Go to solution

Hi, i cant handle with FFT from 2d array. I am converting data from excel. In labview it is a 2 columns with 10000 rows array. Then i am plotting XY graph from this array(using 'build XY graph') and it is well plotted. Now i need to use FFT on this and i really cant figure it out. When i use spectral measurments it shows something like a noise, or other random **bleep**. How my VI looks like is attached below. Sorry for my english

0 Kudos
Message 1 of 10
(4,333 Views)

The vi doesn't show the FFT diagram and it shows neither the time domain data nor the spectrum. I am a bit clueless how to help you.

 

Cheers

Edgar

0 Kudos
Message 2 of 10
(4,311 Views)

Thanks for your reply. Ive attached my VI, and 2 screens with setup of my VI. For being clear, i am choosing my excel file, my VI is getting datas from excel into array, then i am plotting XY graph from columns: 2 and 3(attached screens). And after this i need to get FFT plot. Cant handle it.

Download All
0 Kudos
Message 3 of 10
(4,301 Views)

Another post cause cant add more than 2 attachments

Download All
0 Kudos
Message 4 of 10
(4,299 Views)

Hi,

 

from the time domain plot I wouldn't expect much more than noise in the spectrum because the signal is very short and doesn't have a constant frequency. In an FFT you get distinct spectral lines if the signal contains a mixture of clean frequencies and you should have at least 10 signal periods in the dataset.

FFT requires periodic signals. You can deal with non-periodic signals to some degree with suitable windowing.

 

I can't open the VI because the machine I am working at has only LV2011 installed. In the picture, the spectral measurements are not connected to anything

 

Cheers

Edgar

0 Kudos
Message 5 of 10
(4,286 Views)

Spectral measurements expect an array of 1D doubles.  Just wire your 1D array into one of the FFT VIs.  Look at the examples to see how they're used.  Sorry I can't help you specifically with the Express VIs and DDT wires.  I never touch that stuff. Smiley Tongue  The examples will show you how to do it with the real VIs that are hiding behing the Express crap.

 

EDIT:  Yeah, I just graphed your data in Excel and ejkaiser makes a good point.  You might get a frequency peak from the 3rd column if you window off the end transitions but it's really not enough data to tell you much.  What are you trying to analyze here?

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 6 of 10
(4,282 Views)

I ve attached my VI which should work with your labview now. I didnt match Spectral Measurment because i have no idea how to match any kind of FFT with my plot. 

 

Thx for all replies

0 Kudos
Message 7 of 10
(4,267 Views)
Solution
Accepted by menomena

I added a Power Spectrum into your VI. The result looks like what you can expect.

 

Cheers

Edgar

Message 8 of 10
(4,252 Views)

Thx for ur reply, that is what i wanted. Have another one question, why do i see only 1-8 HZ(on frequency axis)

0 Kudos
Message 9 of 10
(4,242 Views)

Your sampling interval is 0.06 s, that is what I extracted from the spreadsheet. This corresponds to a sampling frequency of 16 Hz and thus due to the Nyquist theorem the maximum frequency in the spectrum is half the sampling frequency. If you have higher frequency components in the waveform, they will fold back as alias signals into the spectrum 0 ... 8 Hz. E.g. a 9 Hz (8+1) signal shows up at 7 Hz (8-1).

In this case you have to increase the sampling frequency or filter the signal before FFT.

 

Cheers

Edgar

 

Message 10 of 10
(4,233 Views)