Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Taking FFTs with Data from NI-SCOPE Tasks

Primary Software: LabVIEW Development Systems>>LabVIEW Base Package
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: Driver Software>>NI-SCOPE
Hardware: Switches>>General-Purpose>>PXI-2567

Problem:
I am programming my digitizer with the NI-SCOPE API, and trying to take a Fast Fourier Transform (FFT) of the data using a VI like FFT Spectrum.vi, or the Spectral Measurements Express VI. It seems as though the data coming from these reads will not wire to my FFT VIs. How can I take the FFT of the incoming signal?

Solution:
The reason that the data will not wire to the input of these VIs is because the data type coming from the NI-SCOPE VIs does not match the data type of the input to the FFT VIs. The FFT VIs take in only a waveform data type, while the NI-SCOPE VIs can output a waveform, array of numeric, or cluster data type. In order to take the FFT of the incoming signal, you can either force the NI-SCOPE VIs to output a waveform data type, or just assemble a waveform out of the information output from the NI-SCOPE VI.

Selecting Waveform as the Output Data Type

When using either niScope Read.vi or niScope Fetch.vi, select the polymorphic instance of the VI which is Single Waveform»Waveform Data Type, or Multi Waveform»1D Waveform Data Type, depending on whether you are reading one or more channels from the digitizer.

Assembling the Waveform

If you do not want to choose the VI to output a waveform data type from the NI SCOPE VIs, you can still assemble a waveform data type from the output of their other polymorphic instances. If building from a cluster output, you can use the Unbundle By Name function (found under Programming»Cluster, Class, & Variant in the functions palette) to extract the waveform data points and timing information, and then Build Waveform (found under Programming»Waveform in the functions palette) to create a waveform data type with that information, as seen below.
For niScope Fetch.vi, you can output the data as a 1D array of I8, I16, I32, or DBL, which does not have this timing information. In this case, you can still extract the timing information of the waveform from the wfm info output of the niScope Fetch.vi, and cast the output array of samples to DBL if needed, as seen below.
The function used to cast to DBL representation is To Double Precision Float, which is found in the functions palette under Programming»Numeric»Conversion.

Related Links:
KnowledgeBase 34HM8NF: How Do I Use the FFT and Inverse FFT VIs in LabVIEW?
KnowledgeBase 47QC624G: How Can I Acquire Pretrigger Samples with NI-SCOPE?

Attachments:
fetchFFT.jpg
clusterToWfm.jpg





Report Date: 05/14/2009
Last Updated: 05/22/2009
Document ID: 4XDG4Q1V

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit