LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I separately extract the amplitude and frequency data from a signal?

I already have the FFT of my data, that worked fine. Now I have a formula I want to use that needs both the amplitude and the frequency as inputs. How do I separate the FFT signal into those separate pieces so I can enter them into the formula?
0 Kudos
Message 1 of 15
(5,577 Views)
Hi Intern_Liz,

The FFT will give you a frequency spectrum of your signal. When you say you need the amplitude and frequency, do you mean the amp and freq of the principal frequency component of your signal? Can you post your sample data,code and formula?
0 Kudos
Message 2 of 15
(5,558 Views)

I am trying to stick the information from that signal into a formula that is: amplitude*386.2/(frequency*2*pi).

I just can't figure out how to tell it that formula because it needs the speficif frequency for each amplitude.  Right now my code is very simple because I keep hitting a road block trying to think of the logic of this.

 

Download All
0 Kudos
Message 3 of 15
(5,544 Views)
Hi Intern_Liz,

Can you save your VI for previous version 8.2 and post again? Your VI is in 8.5 and I am working in 8.2.

If you know the sampling frequency (fs) and length of FFT (N), the frequency of each index (n) is: f = (fs*n)/N.
0 Kudos
Message 4 of 15
(5,533 Views)
I have saved it in 8.2 version. Hopefully that will help. i am beginning to suspect that I have giong to have to turn my data into some type of an array and use a loop to plug it into the formula. Does that seem accurate?
0 Kudos
Message 5 of 15
(5,525 Views)
In the Waveform Measurements palette, there is a vi called Extract Tones.  This vi will extract frequency and amplitude and provide them as separate outputs.  It works with a waveform data type.  I think it will work with a Dynamic Data type, but I'm not sure.  Try it.
- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 15
(5,517 Views)
I tried out the extract tones vi. It kind of works. I used the same file I attached earlier to read data from and the vi gave me 3 sets of data before it quit and just started putting zeros. Also I am not completely sure how to unbundle the data from that point into the components I need. I am relatively new at LabVIEW so I don't know much about dealing with clusters and arrays.
0 Kudos
Message 7 of 15
(5,511 Views)
Sorry here is an attachment with vi where I tried to extract the tones and a copy of the text file again.
Download All
0 Kudos
Message 8 of 15
(5,509 Views)
Hi Intern Liz,

I tried to open the 8.2 VI, but got missing file errors.

I have attached a LabVIEW example modified with your formula node included. The result at zero index is infinity because the formula has frequency in the denominator. I think if you duplicate the for loop in your code, you should get the desired results.

0 Kudos
Message 9 of 15
(5,503 Views)

Intern Liz:

 

Intern Liz,

The output of the extract tones vi that you used is an array of clusters which contain an array of clusters.  Mighty confusing.  You must index the array, then unbundle, then index again, then unbundle again.  The final result is three elements:  frequency, amplitude, and phase:

 



Message Edited by tbob on 03-07-2008 03:26 PM
- tbob

Inventor of the WORM Global
0 Kudos
Message 10 of 15
(5,497 Views)