Overview
This VI takes an signal from an analog input channel on an R-Series card, takes the FFT of that signal, and calculates the phase from the FFT. It then outputs the phase on one of the analog output channels.
Description
The VI is configured to run at 1MHz, although that rate may decrease for R-Series cards with lower maximum sampling rates. The VI reads in the raw data from the R-Series card as a 16-bit signed integer and applies the appripriate conversion logic to convert the integer data into a usable decimal value (note: the conversion implmeneted in this VI is specific for a PCIe-7852R; the conversion logic may change for other R-Series cards based on the input resolution and analog voltage range for a give card).
The decimal value is the input into the FFT Express VI. Once the output of the FFT is valid, the phase is calculated by arctan(Im/Re). That value is then fed through the reverse of the conversion process and output from the card on an analog output channel.

Steps to Implement or Execute Code
Requirements
Software
LabVIEW 2013, 2012, 2011, 2010
LabVIEW FPGA Module
NI-RIO
Hardware
R-Series Card (optional)
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.