Software Defined Radio

Showing results for 
Search instead for 
Did you mean: 

USRP 2945 and USRP 2955 Direction Finding


This example implements the MUSIC algorithm to do direction finding using a single USRP-2945 or USRP-2955 reciever. 




Hardware Requirements




USRP-2945 or USRP-2955


Receive target signals over the air and the reference tone (for calibration).

NI USRP-2920 (or any USRP that can send a signal in the frequency range of operation.  Current demo uses 462.625 MHz)


One device to generate the ref tone for phase synchronization and one device to generate the target tone.

4 way splitter


To distribute the ref tone signal.

Short matched length SMA cables


4 to connect antennas to the 2945 ports.  1 to connect the 4 way splitter to Tx ref signal port of the USRP-2920.



Receive the target signal over the air.

Handheld radio (walkie-talkie) capable of transmitting on 462.625 MHz (Ch 22).


Transmit the signal to the antenna array (this is the target that is being located).

Short LO sharing cables


Share LOs across channels. These ship with the USRP-2945 and USRP-2955


System Diagram.JPG

Software Requirements

-LabVIEW 2016 or later

-Mathscript Module

-USRP 16.1 driver or later


Steps to Implement or Execute Code

Powering on the Device and Opening Up the Application

  1. Make sure the USRP 2945/2955 is powered on first
  2. Power up your laptop/PC/PXI chassis
  3. Open up USRP 2945 & 2955 AoA Direction Finding.lvproj


The front panel of the application

Running the Phase Calibration Routine

  1. Connect a signal source (USRP-2920 or other) to the 4-way splitter, and then connect each output to channels 0-3 of the USRP-2945/2955. The signal source will provide a constant tone that can then be used to calibrate the phase offset between each channel. 
  2. Run “Calculate Phase Calibration”
  3. Set the carrier frequency to the frequency you'd like to use. (For a walkie-talkie, use 462.652 MHz) and run the program (it will take a moment).
  4. Write these constants down and close the VI.
  5. Launch “USRP-2945-2955 AoA Detection RX Localization using” and enter the constants on the left-hand side.
  6. Disconnect all of the SMA cables from the splitter and re-connect the antennas to channel 0-3 of the USRP-2945/2955.  
  7. Important: each antenna much be exactly 1/2 wavelength apart. At 462.652 MHz, that's approximately 0.648 meters

Running the Application

  1. Important: before running the example, place a copy of all of the .m files in the LabVIEW Data directory. This is typically located at "C:\Users\<your username here>\Documents\LabVIEW Data"
  2. Open up “USRP-2945-2955 AoA Detection RX Localization using”.
  3. Ensure that the Device Name is set to that of your USRP 2945/2955. Typically, it's “RIO0” (That’s R-I-O-the number zero).
  4. If the phase constants have not already been placed in the left-hand side from the calibration steps, fill those in.
  5. Run the VI.
  6. If you are using a walkie-talkie, follow the steps below. If you are using another signal, start transmission and bring the source close to your antenna array. The direction will not update until the program senses the signal source. Specifically, it is looking for a single-tone signal source that is at a 100kHz offset above the designated center frequency. 
  7. Power up the walkie-talkie and set to channel 22.
  8. When the talk button on the walkie-talkie is depressed it will transmit the signal that the application is receiving and should respond to the direction you are holding it in relation to the antenna array.
  9. Demonstrate the location-finding by passing the walkie-talkie back and forth (parallel to the array).

Additional Information or References

More information on the USRP 2945/2955

More information on the MUSIC algorithm

Frequency/Wavelength calculator


Known Issues:



Filter coefficient calculation (FIR) sometimes results in error from Math-script node

Use the "FROMFILE" or "IIR"option for coefficients.

The angle of arrival changes suddenly (discontinuous) when moving the Tx antenna.

This is potentially due to the reflections taking place in the test location. Try testing in an open space.

The VI loads with a broken run arrow and mathscript errors

Make sure you copy the .m files to the LabVIEW Data folder

The "location" output does not have a data type associated with it

Add the path function above the "[temp location]=peak(Z,M,'number');" line and point to the location of the .m files. Then, right click on the location output and manually specify the data type as a 1D array of doubles. Once this is done and you've run the program once, you may be able to delete the path  function. 

NI Employee (retired)


I was trying to use the same code on LabVIEW 2016 with Mathscript RT module installed and activated and USRP 16.1 drivers installed.

The problem is that the code gives error with respect to syntax in the Mathscript node. Please find the snapshots attached at 

These commands are:

1. peak

2. phasesyn

3. reallocation


When I tried searching on the web for these commands, I could not get anything on Matlab help for them.

Am I doing something wrong?



NI Employee (retired)


The problem got resolved. Seemed to be some driver related issue.



I'm facing error:


niUSRP Open Rx<ERR>A runtime or configuration error occurred.
Code: 1299
Details: LookupError: KeyError: No devices found for ----->
Device Address:
type: b200
name: RIO0


I'm using USRP 2940R , Is this error due to USRP ??

Please help


Is it possible to RUN this code using NI-USRP 2940R instead of USRP 2945 or USRP 2955  ???

Any suggestions ???

Active Participant
Active Participant

Hi Moaz_130,


No, there is no way to run this code without significant modification on the 2940R. This code takes advantage of the four RX ports of the USRP 2945 and 2955.


You can find a more general example here that requires two USRPs:



Michael Bilyk
Former NI Software Engineer (IT)

Good demo, i'm planning to utilize 8 channels, can I use another 2955 and plug it in?

WHat about the software, any modifications I need to take note?

How will be the connection for the LO?

Is the connection below correct?





Proven Zealot
Proven Zealot

Please follow the same setup on this link:



Applications Engineer | National Instruments
Singapore (65) 6226 5886 | Malaysia (60) 3 7948 2000 | Thailand (66) 2 298 4800
Philippines (63) 2 659 1722 | Vietnam (84) 28 3911 3150 | Indonesia (62) 21 2783 2355


I have a customer really interested in the setup and application.

We have a number of uncertainties whether this would be a solution for his needs, therefore would be great if you could help with the below:


What is the phase stability in relationship with time and temperature for this setup, after calibration?

What is the degree of initial alignment after calibration?

For the particular setup (2x USRP-2955), does recalibration have to happen after restart/reset/retune?

Thank you,




I am a student planning to test this.

I have a USRP 2954 available, is it possible to use that for this project.


I have LabVIEW 2017 with ni usrp 2019 drivers and math script rt module but I have the following error occur in math script node, I copy the .m files to LabVIEW data folder.

mathnode error.JPG