wiki:Tutorials/k0SDR/Tutorial04a

Version 29 (modified by nilanjan, 10 years ago) ( diff )

Spectrum sensing with USRP2

Table of Contents

  1. SDR Tutorials
    1. Working with USRP2 - Universal Software Radio Peripheral
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Usage
      5. Capture waveform and record to file & add time-domain plot of waveform
      6. Troubleshooting
    1. Working with USRP X310
      1. Description
      2. Hardware / Software Resources Utilized
      3. Set Up
        1. Imaging
        2. Accessing the Nodes
        3. Configuring the Network Interface
        4. Setting up GNU Radio
      4. Building the GNU Radio Flowgraphs
        1. Transmitter
        2. Receiver
      5. Running the Experiment
      6. Troubleshooting
        1. xterm Executable Not Found
        2. FPGA Compatibility Mismatch
    1. Simple radio example with GNURADIO benchmark scripts
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Running GNU Radio benchmark scripts
      5. Outputs from transmitter and receiver
      6. Troubleshooting
    1. Simple radio example with GNURADIO benchmark scripts (OEDL)
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Running OEDL script and viewing results
      5. OEDL script
    1. OFDM radio example with GNURADIO benchmark scripts
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Running OEDL script
    1. Spectrum sensing with USRP2
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Generate signal source file using octave
      5. Set up transmitting node
      6. Set up receiving node(s)
    1. Spectrum sensing with USRP2 and wiserd (OEDL and OML)
      1. Description
      2. Hardware / Software Resources utilized
      3. Transmit predefined tone
      4. Record spectrum data to an OML file
      5. Performing the experiment using OEDL
    1. Transmitting wideband signals using USRP X310 and wiserd
      1. Description
      2. Transmitting a signal using wiserd
      3. Creating the signal
    1. Running DSC match script from the grid console
    1. Working with GNURadio and Nutaq ZeptoSDR
      1. Description
      2. Set up
      3. Run the GRC scripts
    1. Realtek 2832 EZCap - A Frugal SDR
      1. Prereqs
      2. A cheap spectrum analyzer
    1. MacSwitch (Obsolete)
      1. Prerequisites
      2. Start Mac Switch
    1. Zynq-based WISER platform - Start-up test
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Loading the Zedboard
      5. Running a start up test
    1. Zynq-based WISER platform - Spectrum Sensing
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Start spectrum sensing
    1. Zynq-based WISER platform - Spectrum sensing with multiple nodes (OEDL)
      1. Description
      2. Hardware / Software Resources utilized
      3. Spectrum sensing with an OEDL script
    1. Zynq-based WISER platform - Building the Firmware
      1. Description
      2. Getting the FPGA source code
      3. Building the FPGA design
      4. Building ARM core software
    1. Nutaq - PicoSDR start-up and configuration
      1. Description
      2. Set up
      3. Launch demo scripts
    1. Multi channel sample collection with x310
      1. Description
      2. Set up
      3. Collect samples
    1. Getting started with RFNoC X310
      1. Description
      2. Set up
      3. Find USRP X310s
      4. Program the FPGA
    1. Multi Channel Sample Processing & Visualization
      1. Hardware / software resources utilized
      2. Receive multi channel signal for processing and plotting
      3. Transmit a signal using a single usrp
    2. Plot the IQ Constellation of received signal
      1. Multi-channel Uhd STreamer (MUST)
      2. Description
      3. How it works (without going into the source-code :-D
      4. Source code & compilation
      5. Hardware interface application
      6. XML file
      7. Command server
      8. Usage Example
      9. Signal handler applications
      10. Tutorials
    1. Using two RFNoC streams simultaneously on a single USRP device
      1. Description
      2. Set Up
      3. Running the Simulation
    1. Using 2 transmit or 2 receive antennas simultaneously
      1. Description
      2. Set Up
      3. Running the Experiment
    1. Generate random transmissions emulating Primary Transmitters
      1. Description
      2. Set Up
      3. Running the Experiment
    1. RFNoC Spectrum Sensing
      1. Description
      2. Set Up
        1. Prepare Receive Node
        2. Prepare Receive USRPs
        3. Prepare Transmit Node
        4. Prepare Transmit USRP
        5. Set up SSH tunnel from your local port 5100 to grid.orbit-lab.org:5100
        6. Set up a web proxy for the receive node
      3. Run the experiment
    1. Full-Duplex Wireless using USRP N210
      1. Description
        1. Technical Report
        2. Updates
      2. Hardware / Software Resources Utilized
      3. Set Up
      4. Run the Experiments
      5. Example Experiment 1: A Real-Time Full-Duplex Radio with OFDM PHY (GNU …
      6. Example Experiment 2: A Simple Full-Duplex Radio Experiment (Terminal …
        1. In Terminal 1
          1. In Terminal 2 (SUB-20)
        2. A Secondary Transmitter Using Node13-8
        3. Acknowledgements
    1. LTE Traffic Trace Collection
      1. Description
      2. Setup OAI emulation framework
      3. Connecting UE to LTE network
      4. Connecting Multiple UEs
      5. Enabling OAI logging Module
      6. Application Design
      7. Running OAI using scripts
    1. Simple Radio Example with USRP X310 on ORBIT Sandbox 2
      1. Description
      2. Set Up
        1. Prepare the nodes
        2. Prepare network setup for USRP access
      3. Run the experiment
    1. Wideband Channel Sounding with USRP X310s
      1. Description
      2. Set Up
        1. Prepare Receive Node
        2. Prepare Receive USRPs
        3. Prepare Transmit Node
        4. Prepare Transmit USRP
        5. Set up SSH tunnel from your local port 5100 to grid.orbit-lab.org:5100
        6. Set up a web proxy for the receive node
      3. Run the experiment

Description

This tutorial will give a walk through on how to used Wiserd to set up USRPs for signal transmission and reception.

Hardware / Software Resources utilized

  1. Grid nodes with a USRP2 connect via Ethernet.
  2. ubuntu-14-04-64bit-sdr.ndz: disk image loaded onto nodes.
  3. Wiserd - interface to configure and stream data to/from USRPs.
  4. octave - generate transmit data file and plot received data file.

Set up

  • After logging into grid console, make sure all nodes are turned off
    nilanjan@console.grid:~$ omf tell -a offh -t system:topo:all
    
  • Verify state of node before continuing. Make sure all nodes are in the POWEROFF state.
    nilanjan@console.grid:~$ omf stat
    
  • Image nodes
    nilanjan@console.grid:~$ omf load -i ubuntu-14-04-64bit-sdr.ndz -t node20-20,node19-19,node8-8 -r 20
    
  • After nodes are imaged, verify that nodes are in POWEROFF state. Otherwise issue the following to turn them off for a

reboot

nilanjan@console.grid:~$ omf tell -a offh -t system:topo:all
  • Turn nodes back on and verify they are in POWERON state
    nilanjan@console.grid:~$ omf tell -a on -t node20-20,node19-19,node8-8
    

In this example node8-8 and node19-19 is used as the transmitting nodes and the node20-20 as the receiver

Generate signal source file using octave

On each transmiting node, create a signal file using octave. You can use the scripts provided here as an example. On node8-8 create a file s1.bin using the lines below

root@node8-8:~# cd wiserd
root@node8-8:~/wiserd# octave
octave:1> signal = fGenFDSignal(256,50,10,'1half');
octave:2> saveToWiserdFile(signal,'s1.bin');
octave:3> exit

The signal will look something like the following in the frequency domain - notice the first half of the spectrum is populate:

Create a similar signal on node19-19 but with the 2nd half of the spectrum populated

octave:1> signal = fGenFDSignal(256,50,10,'2half');
octave:2> saveToWiserdFile(signal,'s2.bin');

Set up transmitting node

  • ssh into each node and start the wiserd interface:
    root@node8-8> wiserd
    linux; GNU C++ version 4.8.2; Boost_105400; UHD_003.008.002-86-g566dbc2b
    
    -- Opening a USRP2/N-Series device...
    -- Current recv frame size: 1472 bytes
    -- Current send frame size: 1472 bytes
    -- Detecting internal GPSDO.... No GPSDO found
    -- Successfully tuned to 900.000000 MHz
    --
    -- Successfully tuned to 900.000000 MHz
    --
    Ready!
    >
    
  • At the wiserd prompt set the carrier frequency, sampling rate & gain. Then link the transmitter to the signal source which

is the binary file generated in octave from prior step:

> set --uhd_tx_freq 700e6 --uhd_tx_rate 5e6 --uhd_tx_gain 20 --tran_wavefilename s1.bin
-- Successfully tuned to 700.000000 MHz
--
tran_wavefilename s2.bin
uhd_tx_freq 700000000
uhd_tx_gain 20
uhd_tx_rate 5000000
> add --signalfromfile
Consumer signalfromfile added
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
>

The set command is used with multiple arguments in one line: —uhd_tx_freq set carrier frequenct to 700MHz —uhd_tx_rate set sampling rate to 5M samples/sec —uhd_tx_gain set transmit gain to 20dB. —tran_wavefilename tells the links the transmitter source to a binary filename.

add —signalfromfile opens the above filename, reads the samples and streams to the usrp.

At this point the USRP will continuously transmit the signal util the delete command is issued: delete —signalfromfile stops tranmitting signal.

Now set up the transmitter on node19-19 using similar commands.

Set up receiving node(s)

On the receiving node (node20-20), run wiserd to capture a snapshot of the signal from both transmitters.

root@node20-20> wiserd
linux; GNU C++ version 4.8.2; Boost_105400; UHD_003.008.002-86-g566dbc2b

-- Opening a USRP2/N-Series device...
-- Current recv frame size: 1472 bytes
-- Current send frame size: 1472 bytes
-- Detecting internal GPSDO.... No GPSDO found
-- Successfully tuned to 900.000000 MHz
--
-- Successfully tuned to 900.000000 MHz
--
Ready!
> set --uhd_rx_freq 700e6 --uhd_rx_rate 5e6 --uhd_rx_gain 20 --recv_running_time 1000 --recv_output_filename rx_signal
-- Successfully tuned to 700.000000 MHz
--
recv_output_filename rx_signal
recv_running_time 1000
uhd_rx_freq 700000000
uhd_rx_gain 20
uhd_rx_rate 5000000
> add --timesamplestofile --timed
Consumer timesamplestofile added
Consumer timesamplestofile finished

> exit

Here the set command has an additional argument to limit capturing to 1000 milliseconds: —recv_output_filename set receiving signal filename. —recv_running_time set receiver run time in milliseconds. (optional)

The add command options —timesamplestofile streams data from receiver to file —timed runs receiver for the specified amount of time. (optional)

Received signal file should should be prepended with the frequency, rate and gain:

root@node20-20> ls -ltr *.bin
-rw-r--r-- 1 root root 40003072 May 21 10:56 rx_signal_freq700000000_rate5000000_gain20.bin

Use octave to view the spectrum image:

octave:1> fReconFDSignal(readWiserdFile('rx_signal_freq700000000_rate5000000_gain20.bin', 256*500), 256);

Received signal should look simiar to

No image "rx_signal.png" attached to Tutorials/k0SDR/Tutorial04a

Attachments (11)

Note: See TracWiki for help on using the wiki.