# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Which FFT to use?

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!

Message 1 of 13
(2,014 Views)

## Re: Which FFT to use?

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.

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 2 of 13
(1,993 Views)

## Re: Which FFT to use?

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! 🙂

Message 3 of 13
(1,980 Views)

## Re: Which FFT to use?

@JersonJose wrote:

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

To do what?

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 4 of 13
(1,972 Views)

## Re: Which FFT to use?

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

Message 5 of 13
(1,961 Views)

## Re: Which FFT to use?

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?

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 6 of 13
(1,952 Views)

## Re: Which FFT to use?

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?

Message 7 of 13
(1,943 Views)

## Re: Which FFT to use?

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
(1,911 Views)

## Re: Which FFT to use?

@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

Message 9 of 13
(1,893 Views)
Solution
Accepted by topic author JersonJose

## Re: Which FFT to use?

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
(1,880 Views)