LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Which FFT to use?

Solved!
Go to solution

Hi, I know there are several ways to perform fourier transform in LabVIEW but I do not know which to use correctly.

 

I have a signal that is in array and I want that signal to be analyzed using fourier transform.

 

I've tried the Spectral Measurement Express VI, Power Spectrum.vi, FFT Power Spectrum and PSD.vi, FFT Spectrum (Mag-Phase).vi, and FFT.vi (don't know the correct FFT size to use here, I just used 128).

 

 

Which should I use?

 

 

Thanks!

0 Kudos
Message 1 of 13
(4,286 Views)

If you have a 1D array of DBL, the plain FFT is probably easiest.

How many points are in your array? Just leave the "size" disconnected!

 

Typically it is more important what you want to know about the sgnal, not what function to use.

Are you interested in the complex transform? the magnitude? Something else?

 

A plain FFT just operates on the data, which is assumed to be equally spaced in time and the transform will be equally spaced in frequency.. The "df" of the transform is determined by the "dt" of the original signal.

Message 2 of 13
(4,265 Views)

Okay I'll just use the plain FFT and leave the "size" untouched. I'll probably look at the real part of the transform. I am going to use the "Complex To Re/Im".

 

Thank you! 🙂

0 Kudos
Message 3 of 13
(4,252 Views)

@JersonJose wrote:

I am going to use the "Complex To Re/Im".

 


To do what?

0 Kudos
Message 4 of 13
(4,244 Views)

So I can just look at real portion of the FFT result. Then get the highest magnitude from that portion.

0 Kudos
Message 5 of 13
(4,233 Views)

The real portion does not give you the highest magnitude in general. It could all be in the imaginary part or anywhere in-between.

To get the magnitude, take the eabsolute value of the complex FFT result instead.

 

Are you also interested in the phase?

0 Kudos
Message 6 of 13
(4,224 Views)

Oh I see didn't know that. I'll do what you said. Thank you.

 

No. I am not interested in the phase. Actually, what I am really trying to get is the frequency with the highest magnitude. Any idea how I can get that?

0 Kudos
Message 7 of 13
(4,215 Views)

You should probably spend some time to make sure you understand the mathematics behind spectral analysis. Without that understanding it may be very easy to use one or several of the FFT-based tools to get completely meaninless or misleading results.

 

Since it appears that you are not very aware of the mathematics, it might be better to convert your array of data to a waveform (both Y and dt) and then use FFT Spectrum (Mag-Phase).vi.  One of its outputs is the magnitude cluster which includes the array of magnitudes by frequency bin, df (the frequency resolution0 and f0 (the initial frequency). It takes care of all the things you would need to know how to do yourself.  The phase information is also available if you should need it in the future.  You can ignore inputs like window and averaging.  The defaults will be fine to get you started.

 

Lynn

Message 8 of 13
(4,183 Views)

@johnsold wrote:

You should probably spend some time to make sure you understand the mathematics behind spectral analysis. Without that understanding it may be very easy to use one or several of the FFT-based tools to get completely meaninless or misleading results.

 

Since it appears that you are not very aware of the mathematics ...


And therein lies the real problem.  How many times have we seen questions on the Forum about fairly complex topics that require some understanding of What is Going On (either Signal Theory, Image Analysis techniques, how to connect the wires from a piece of equipment to an A/D converter to get meaningful data) and find neophytes who are seduced by "how Easy it is to use LabVIEW, with all its Express VIs to do the Thinking For You, powerful Spectral Techniques I don't need to understand, etc." and come here to have us explain the underlying principles.  Sigh.  

 

Bob (Curmudgeon) Schor

0 Kudos
Message 9 of 13
(4,165 Views)
Solution
Accepted by JersonJose

Bob,

 

Try to keep reminding yourself that without students, you would be without a job.  Interesting that all of the responses so far have been from people with extensive experience in academia.

 

JersonJose,

 

After looking at your latest post, it occurs to me that possibly Extract Single Tone Information.vi might work for you also.  To use that you need to create a waveform from your data as I described above.

 

Lynn

Message 10 of 13
(4,152 Views)