LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT of data in an array

Solved!
Go to solution

I would like to carry out an FFT on a periodic sampled digital signal.  At the moment, my signal is stored as an 8192 element array of 16bit integer values (0-65534).

 

I have tried connecting this array directly to the X input of the fft.vi, but the data that comes out of FFT{X} seems to make little sense (array of length 8192 with peaks both the start and end of it).

 

Any advice would be much appreciated.

Dan
CLD
0 Kudos
Message 1 of 7
(7,500 Views)

DanB1983 wrote:

I would like to carry out an FFT on a periodic sampled digital signal. [...]


I think you missed the very basics of FFT..... using FFT on digital signals is nonsense.

I asume that you are interested in one of the two following specs:

a) The timing of a single bit, also known as bitrate, which is infact your samplerate....

b) The signal is a "block" which repeats itself. So you want to know how fast the blocks are repeated.

 

As written, a) is simply the samplerate because if samplerate does not match the bitrate, there is no chance to detect that....

Regarding b), it's simply analysis of the digital signal in its content (H and L level changes).

 

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 7
(7,494 Views)

Norbert,

 

Thanks for the prompt reply - I feel I need to clarify slightly.

 

I have produced the array to simulate a sampled signal that I want to analyse.  That is to say that it is supposed to represent a stream of 8192 values coming from an ADC.  In this very simple case, it is a single sine wave.

 

Therefore, I would expect the FFT to have a single peak at the associated frequency.

 

See the attached text file for the actual data used.

 

 

 

 

Dan
CLD
0 Kudos
Message 3 of 7
(7,483 Views)

Hi DanB1983 (and Norbert 😉 )

You do not have to go to Wiki for a FFT tutorial. NI have some excellent papers on the topic like this http://zone.ni.com/devzone/cda/tut/p/id/4278

After reading this I think you will understand more about the topic. Also browse through the Labview examples. In the toolbar go to help and Find Examples then search for FFT. I am sure you will find an example here that can make a base for your application. Just remember to use the "save as" option so you do not overwrite the example.

And the last thing. Then you start a Labview session, do not forget do enable context help (CTRL+h)

 

Message Edited by Coq Rouge on 07-30-2009 02:12 PM


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 7
(7,464 Views)
Solution
Accepted by topic author DanB1983

Ok, this is better 🙂

 

The reason why you are seeing not the expected FFT result is easy:

a) You have an offset of 8000 in your signal. This is the peak at 0.

b) Your signal does include about 2.6 periods. Since FFT virtually concatenates your signal from -inf to +inf in the time domain, your signal has "jumps" in it which create peaks in your frequency domain "somewhere". In order to prevent this you can either use windowing or cut your time domain signal to contain an integer number of periods (which would be aroung 6400 samples then).

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 7
(7,446 Views)

Hello,

 

You are probably wanting to take an FFT and display the results in the power spectrum. This will give you a peak at 200hz, for an input sine signal of 200hz.

 

So I suggest this VI:

 

fftPower.PNG

Have a play with the attached VI...

 

(The windowed VI is useful if your input data has high frequency discontinuities at the beginning or end)

Message Edited by macaba on 07-30-2009 07:36 AM
Download All
Message 6 of 7
(7,445 Views)
Excellent, thanks very much gents.
Dan
CLD
0 Kudos
Message 7 of 7
(7,436 Views)