Example Code

Frequency Domain Cluster (Power Spectrum, FFT) to 2D Array in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI will take any cluster of frequency domain data, such as a Power Spectrum or FFT, and converts it into a 2 dimensional array which can be saved to Excel or a text file.

 

Description 

The frequency domain cluster contains three components: f0 (initial frequency), df (frequency step along X-axis), and magnitude (1D array of magnitude values).

This VI uses f0 and df to create a 1D array of frequency values, and then combines that with the 1D magnitude array.

The result is a 2D array, where the first dimension is frequency data and the second dimension will contain the magnitude at the respective frequency.

 

Requirements: LabVIEW Base Development System 2012 or compatible

 

Steps to Implement or Execute Code

  1. Enter the Frequency Domain Cluster array or Use this VI as subVI
  2. Run the VI

 

Additional Information or References

VI Block Diagram

 9981.PNG


 **This document has been updated to meet the current required format for the NI Code Exchange. **

 

 

Eric S.
AE Specialist | Global Support
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.