Changes between Initial Version and Version 1 of Tutorials/k0SDR/Tutorial14


Ignore:
Timestamp:
Sep 8, 2015, 6:08:27 PM (9 years ago)
Author:
prasanthi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/k0SDR/Tutorial14

    v1 v1  
     1== Spectrum sensing with USRP2 and wiserd ==
     2
     3[[TOC(Tutorials/k0SDR*)]]
     4
     5=== Description ===
     6This tutorial will utilize Wiserd to set up USRPs for signal transmission and reception.
     7
     8=== Hardware / Software Resources utilized ===
     9 1. Grid nodes with a USRP2 connect via Ethernet.
     10 2. ''ubuntu-14-04-64bit-sdr.ndz'': disk image loaded onto nodes.
     11 3. [http://wiser.orbit-lab.org/wiki/wiser/mSoftware/aWiserd Wiserd] - interface to configure and stream data to/from USRPs.
     12 4. octave - generate transmit data file and plot received data file.
     13
     14
     15=== Set up ===
     16 * To get started first make a reservation on the [https://www.orbit-lab.org/schedule/ Orbit Scheduler] for using the Grid.
     17
     18 * After logging into grid console, make sure all nodes are turned off
     19{{{
     20nilanjan@console.grid:~$ omf tell -a offh -t system:topo:all
     21}}}
     22
     23 * Verify state of node before continuing. Make sure all nodes are in the POWEROFF state.
     24{{{
     25nilanjan@console.grid:~$ omf stat
     26}}}
     27
     28 * Image nodes
     29{{{
     30nilanjan@console.grid:~$ omf load -i ubuntu-14-04-64bit-sdr.ndz -t node20-20,node19-19,node8-8 -r 20
     31}}}
     32
     33 * After nodes are imaged, verify that nodes are in POWEROFF state. Otherwise issue the following to turn them off for a reboot
     34{{{
     35nilanjan@console.grid:~$ omf tell -a offh -t system:topo:all
     36}}}
     37
     38 * Turn nodes back on and verify they are in POWERON state
     39{{{
     40nilanjan@console.grid:~$ omf tell -a on -t node20-20,node19-19,node8-8
     41}}}
     42
     43In this example node8-8 and node19-19 is used as the transmitting nodes and the node20-20 as the receiver
     44
     45=== Generate signal source file using octave ===
     46
     47On 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
     48{{{
     49root@node8-8:~# cd wiserd
     50root@node8-8:~/wiserd# octave
     51octave:1> signal = fGenFDSignal(256,50,10,'1half');
     52octave:2> saveToWiserdFile(signal,'s1.bin');
     53octave:3> exit
     54}}}
     55
     56The signal will look something like the following in the frequency domain - notice the first half of the spectrum is populated:
     57  || [[Image(s1.png, width=500px)]] ||
     58
     59Create a similar signal on node19-19 but with the 2nd half of the spectrum populated
     60{{{
     61octave:1> signal = fGenFDSignal(256,50,10,'2half');
     62octave:2> saveToWiserdFile(signal,'s2.bin');
     63}}}
     64  || [[Image(s2.png, width=500px)]] ||
     65
     66
     67=== Set up transmitting node ===
     68
     69
     70 * ssh into each node and start the wiserd interface:
     71{{{
     72root@node8-8> wiserd
     73linux; GNU C++ version 4.8.2; Boost_105400; UHD_003.008.002-86-g566dbc2b
     74
     75-- Opening a USRP2/N-Series device...
     76-- Current recv frame size: 1472 bytes
     77-- Current send frame size: 1472 bytes
     78-- Detecting internal GPSDO.... No GPSDO found
     79-- Successfully tuned to 900.000000 MHz
     80--
     81-- Successfully tuned to 900.000000 MHz
     82--
     83Ready!
     84>
     85}}}
     86
     87 * 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:
     88{{{
     89> --uhd_tx_freq 700e6 --uhd_tx_rate 5e6 --uhd_tx_gain 20 --tran_wavefilename s1.bin
     90-- Successfully tuned to 700.000000 MHz
     91uhd_tx_freq 700000000
     92uhd_tx_gain 20
     93uhd_tx_rate 5000000
     94> --addmodule signalfromfile
     95Consumer signalfromfile added
     96LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
     97>
     98}}}
     99
     100In order to set parameter values, multiple arguments can be used in one line:
     101
     102 ''--uhd_tx_freq'' set carrier frequenct to 700MHz
     103
     104 ''--uhd_tx_rate'' set sampling rate to 5M samples/sec
     105
     106 ''--uhd_tx_gain'' set transmit gain to 20dB.
     107
     108 ''--tran_wavefilename''  tells the links the transmitter source to a binary filename.
     109
     110''--addmodule signalfromfile'' opens the above filename, reads the samples and streams to the usrp.
     111
     112At this point the USRP will continuously transmit the signal util the delete command is issued:
     113
     114 ''--delmodule signalfromfile'' stops tranmitting signal.
     115
     116
     117Now set up the transmitter on node19-19 using similar commands.
     118
     119
     120
     121=== Set up receiving node(s) ===
     122On the receiving node (node20-20), run wiserd to capture a snapshot of the signal from both transmitters.
     123{{{
     124root@node20-20> wiserd
     125linux; GNU C++ version 4.8.2; Boost_105400; UHD_003.008.002-86-g566dbc2b
     126
     127-- Opening a USRP2/N-Series device...
     128-- Current recv frame size: 1472 bytes
     129-- Current send frame size: 1472 bytes
     130-- Detecting internal GPSDO.... No GPSDO found
     131-- Successfully tuned to 900.000000 MHz
     132--
     133-- Successfully tuned to 900.000000 MHz
     134--
     135Ready!
     136> --uhd_rx_freq 700e6 --uhd_rx_rate 5e6 --uhd_rx_gain 20 --recv_running_time 1000 --recv_output_filename rx_signal
     137-- Successfully tuned to 700.000000 MHz
     138--
     139recv_output_filename rx_signal
     140recv_running_time 1000
     141uhd_rx_freq 700000000
     142uhd_rx_gain 20
     143uhd_rx_rate 5000000
     144> --addmodule timesamplestofile --timed
     145Consumer timesamplestofile added
     146Consumer timesamplestofile finished
     147
     148> exit
     149}}}
     150
     151
     152Here the set command has an additional argument to limit capturing to 1000 milliseconds:
     153
     154 ''--recv_output_filename'' set receiving signal filename.
     155
     156 ''--recv_running_time''    set receiver run time in milliseconds. (optional)
     157
     158The --addmodule command options
     159
     160 ''--addmodule timesamplestofile'' streams data from receiver to file
     161
     162 ''--timed''             runs receiver for the specified amount of time. (optional)
     163
     164Received signal file name will automatically be appended with the frequency, rate and gain:
     165{{{
     166root@node20-20> ls -ltr *.bin
     167-rw-r--r-- 1 root root 40003072 May 21 10:56 rx_signal_freq700000000_rate5000000_gain20.bin
     168}}}
     169
     170Use octave to view the spectrum image:
     171{{{
     172octave:1> fReconFDSignal(readWiserdFile('rx_signal_freq700000000_rate5000000_gain20.bin', 256*500), 256);
     173}}}
     174
     175Received signal should look simiar to
     176  || [[Image(signal.png, width=500px)]] ||