LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT of 1D waveform

I want to get FFT of a 1 D waveform. So I tried to use signal processing------transform-----FFT. My data is 1-D waveform, data type is UNCHAR 16bit integer. But after I connected it with FFT, the result seems wrong. So what component should I use to do FFT  of that kind of data?
0 Kudos
Message 1 of 9
(4,570 Views)
Is your data an actual waveform data type or is it just a 1D U16 array? A waveform data type has a y array that is dbl and it also includes a dt component. If you are just passing a U16 array to any FFT function, you need to provide this information.
0 Kudos
Message 2 of 9
(4,563 Views)
hi!
   Can you post your code? Or just a piece of it, just to show what is the 1D array of input, and why is it wrong?

   Have a nice day!

graziano

By the way... did you mean "unsigned 16 bit"? ...
0 Kudos
Message 3 of 9
(4,561 Views)
I used function generator board NI6711 to generate a Analog signal, which is sine wave with frequency 1000 and amplitude 1. And then I use a ADC to save it as a binary file "1wavef10.dat". Then I modified the example code " read binary file" to read the unsigned 16 bit integer. Now I need to get the FFT, So I just add "FFT" component after reading the file. Attached is the file and my FFT code. Just change the suffix of the first file to be ".dat", the second to be ".vi".
 
Thanks!
Download All
0 Kudos
Message 4 of 9
(4,521 Views)
Hi Sophia,

I am not able to read your files.  Are others having the same problem as well?
Kameralina

0 Kudos
Message 5 of 9
(4,494 Views)
Hi FieldKam & Sophia,

the jpg-files is empty, so there was a problem when uploading.
The doc-file is a LabView vi. Why did you (Sophia) rename it to *.doc?

@Sophia:
Please provide some test data to test your vi as it looks quite ok... You also should explain, why "the result seems wrong"!
Instead of rename files to (be able to) upload them you should use ZIP to bundle them in one (accepted) zip archiveSmiley Wink


Message Edited by GerdW on 03-30-2008 07:48 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(4,490 Views)
Hi! I have uploaded the test data, my vi and print the screen of result on the .doc file. The result seems wrong because the peak of my FFT is at about 200 but actually the frequency of the signal is 1000. I have used FFT.vi to do the transform. My signal is sine wave which is amplitude vs sample. Do I need to transform the signal to be amplitude vs time? I do not know how to scale the sample axis to be time axis. I know the relation between them is time=sample/ sampling frequency.
Message 7 of 9
(4,432 Views)
Hey there Sophia,
 
Here is an example written in LabVIEW 8.0.  The beginning of the block diagram just generates a 100 Hz sine wave,and extracts the 1D array of Y Values from the waveform.  We then reconstruct the waveform by using the 'Build Waveform' function, and inputting the 1D array of Y Values, as well as the time in between samples (dt = 1 / sampling frequency).  The VI then takes the FFT using two methods:
  1. Using the Spectral Measurements express VI, and 
  2. Using the FFT Spectrum VI located in Functions»Programming»Waveform»Analog Waveform»Waveform Measurements.  Run the VI, and observe a peak on both graphs at 100Hz. 

I hope that this helps!



Message Edited by Chris_G. on 04-11-2008 04:05 PM
Chris_G
Sr Test Engineer
Medtronic, Inc.
0 Kudos
Message 8 of 9
(4,383 Views)
Your data does look right.  You might want to do a couple things to improve how it looks.

1.  The FFT function has an input called shift?, set this to TRUE to rearrange the output of the FFT to something more familiar to you.
2.  The FFT output is complex numbers, add a complex to magnitude/phase function to see the magnitude of the spectrum.
3.  Since the data is unsigned, all the data is positive and therefore the FFT will have a large peak in the middle for the average value of the data.  You can convert the data to signed 32-bit and then subtract out 32767 from all the points to eliminate the  DC component.

See attached
Randall Pursley
0 Kudos
Message 9 of 9
(4,369 Views)