Taking FFTs in NI-SCOPE Tasks

Updated Mar 1, 2018

Reported In



Issue Details

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?


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.


Not Helpful