Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

03-26-2016 10:07 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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!

Solved! Go to Solution.

03-26-2016 11:20 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

03-26-2016 11:53 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

03-27-2016 12:00 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@JersonJose wrote:I am going to use the "Complex To Re/Im".

To do what?

03-27-2016 12:04 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

03-27-2016 12:11 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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?

03-27-2016 12:31 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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?

03-27-2016 08:54 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

03-27-2016 10:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@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

Solution

Accepted by topic author JersonJose

03-27-2016 10:20 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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