Software Defined Radio

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Communications USRP RIO FPGA FFT Implementation

Overview

The USRP RIO and LabVIEW Communications can be used to design and prototype algorithms.  Multirate Diagrams can be easily moved from processing on the Host to processing on the FPGA. This VI example demonstrates implementing an FFT on the NI USRP-RIO 294x/295x device's FPGA.  It was built upon the Full Duplex Streaming Sample Project.The Tx and Rx of each channel are connected together using a 30dB attenuator to form a loopback.  The Tx will generate a tone of specified Amplitude and Frequency, which will be read on the Rx. These parameters can be modified during execution.

Description

The PC USRP RIO Streaming Template come with a FPGA VI and a Host VI.  The FPGA VI has been modified to stream the Rx data from the data acquisition loop to the Multirate Diagram.  The Multirate Diagram parse the input data, processes the point-by-point FFT, and outputs the information to the appropriate FIFOs.  The data of these FIFOs is then read and transfered to DMA FIFOs for the Host to read.

The Host VI has been modified to use the custom FPGA VI bitfile.  This changes the behavior of the FPGA and adds the ability for the Host to Read the newly configured DMA FIFOs.  The FIFOs can be found o the USRP RIO in the SystemDesigner.  In the data acquisition loop has the addition of the FFTs VIs.  The FPGA FFT Read is built off the Fetch Rx Data VI.  It reads 8192 samples from the 4 FFT FIFOs. The Host Side FFT VI uses the raw Rx data and applies an FFT.  The Plot Source Selection chase structure switches betwen plotting the Host FFT and the FPGA FFT results.  By toggling the front panel switch, the user can see that the results are the same.

Steps to Implement or Execute Code

1. Open the FFT.lvproject

2. Open the HardwareFFTLoopback.gvi

3.Find the USRP RIO device name in the Measurement & Automation Explorer (MAX). Change USRP RIO device control below to match the name in MAX.

4. Enable the desired channels and antenna. By default, both channels are enabled using the controls below. Make a loopback from Tx to Rx through a 30dB attenuator.

5. Run this VI, verify the received signals and observe the plot in the FFT tab.  Toggle between the Host and FPGA switch to change where the FFT is processed. Toggle the Amplitude and Tone Frequency to see the FFT respond.

Requirements

Software: LabVIEW Communications 1.0

Hardware: USRP-RIO 294x/295x



Thomas C.
FlexRIO Product Support Engineer
National Instruments
Comments
MattTarditti
Member
Member
on

I'm trying to run this project, but the typical project file extension is .lvproj.  The typical VI file extension is .vi.  Why are the files all .gvi, and why is the project .lvproject? 

tcap
NI Employee (retired)
on

Hello Matt,

This example is specifically for LabVIEW Communications, which uses new file formats.

Regards,

Thomas Capuano

Applications Engineer

National Instruments

Thomas C.
FlexRIO Product Support Engineer
National Instruments
reffahcs
Member
Member
on

I tried this with Communications Suite 1.1 and straight out of the zip file, the project won't compile because of a dependency issue in FFT.gmrd. I looked at FFT.gmrd and it's complaining about the input not having any source data. Looking at the block diagram, Streaming FFT looks like it's trying to pass the Write FIFO reference as the input to FFT.gmrd.

reffahcs
Member
Member
on

I was able to resolve this issue by manually setting the enabled switch on the panel for Write FIFO (Multi-Channel).gcdl to enable for both channels. But now I'm getting a slew of errors about I/O not occuring within the 40MHz clock domain. I suppose this is because I'm using a USRP X310 with 120MHz WBXs and not an actual 2940R?

reffahcs
Member
Member
on

I finally fixed the last of the errors. In Streaming FFT(FPGA).gvi I changed the clock speed of the Radio Settings Register Bus from data clock to 40 MHz, then I move RF 0 TX/RX Enable, RF 1 TX/RX Enable and RF Control Command Reset inside the Radio Settings Register Bus (moved them from Required Controls and Indicators).  In the file FFT.gmrd, I selected the Input terminal and changed it from CSV file to RANDOM. I'm not sure what affect that last part has on the operations, but I did not find a CSV file anywhere in the folder, and wasn't sure what was supposed to be in the CSV file... I'm assuming pairs of IQ values?

tcap
NI Employee (retired)
on

Hello raffahcs,

When I open the example, it tells me to change the FFT.gmrd from CSV to Random, but I do not have to change any other parts of the project.

The CSV only includes sample values for simulation and should not be required for deployment.

How are you interfacing the X310? You should not modify any other the Required Loops.

Regards,

tcap

Thomas C.
FlexRIO Product Support Engineer
National Instruments
Contributors