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 - Analysis

Hi,

I would like to do a FFT - Analysis of my data.

I acquire data via RS232 sample rate is 5Hz.

But I don't know how make it :-).

Can anybody help me?

Thanks a lot!

Binoldino
0 Kudos
Message 1 of 12
(7,317 Views)
There is a VI for the FFT located in the Signal Processing-->Transforms palette.  That VI will compute the FFT, but if you want to scale the frequencies to show on a plot, there is something additional you need to do.  I have attached a VI that I found in the help.  I used this to set up a FFT graph just the other day, so I know it works.

Jay Mathews
CPP, Inc.
Wind Engineering and Air Quality Consultants
Message 2 of 12
(7,279 Views)
 Hello Binoldino

You sample signal 5 S/s so it is 2[Hz] band (Nyquist fsampling=2.56*fband). What do You wont to get ? What do you do FFT analysis for ?


Message 3 of 12
(7,278 Views)
Hello,

Thanks for your reply.

I want to see the high frequencies in my data and if there is a repeatability.
In the moment I have a sample rate of 1Hz, but I guess this is for the FFT not so good. I think 5Hz is better, right?
What is the highest frequency which I can see with 5Hz?

Thanks
0 Kudos
Message 4 of 12
(7,260 Views)
I believe when doing the FFT the frequency resolution is limited to half the sample rate.  So, if you're sampling at 5 kHz then you would be able to see up to 2.5 kHz.
Message 5 of 12
(7,253 Views)
I think so too.

How can I find out which are my highest frequency? with spectrum analysis?
0 Kudos
Message 6 of 12
(7,248 Views)

"How can I find out which are my highest frequency? "

You should sample the signal with higher frequency then 5[Hz], but you ought foresee the highest frequency first (define band) in other to avoid aliasing (using antialiasing filter is recommend).

For example: you anticipated that the band would be 1-10[Hz] so you set rate min. 20[Hz] (25[Hz] recommend). The highest frequency possible to read will be 10[Hz].

 


Message 7 of 12
(7,231 Views)
The highest sample of the signal is 5Hz, because of my device. :-(!
So my highest frequency will be 2,5Hz, probably 2Hz!

But I have still the problem of the programming. I acquire data via RS232 and show this on a waveform chart.
Now I want to save this data in a Array so that I can make the FFT afterwards.

Can anybody help me?

0 Kudos
Message 8 of 12
(7,178 Views)
You can find many examples in help LV. Look at this attachment.
0 Kudos
Message 9 of 12
(7,168 Views)

He was asking how to create the array, not how to save data.

The easiest way to create an array is to simply wire the data to the edge of the while loop and where it exits, click on it and select 'Enable Indexing'. I removed the case statements to make it simple and I didn't really see much need for them. If you need them, then you can use a shift register and the build array function. Please note that with a while loop, the LabVIEW compiler does not have any idea of the size of the array that will be required. This means that memory will be constantly be reallocated as the VI runs and will not have optimal performance.

0 Kudos
Message 10 of 12
(7,138 Views)