Changes between Version 9 and Version 10 of Tutorials/k0SDR/Tutorial20


Ignore:
Timestamp:
Feb 16, 2017, 6:19:07 PM (8 years ago)
Author:
nilanjan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/k0SDR/Tutorial20

    v9 v10  
    772) controller node (ie. node21-1) imaged with ''ubuntu-14-04-64bit-uhd-003.010.001-gnu-3.7.10.ndz'' \\
    883) OML - Orbit Measurement Library to record measurements into database \\
    9 4) rf_hw_intf - application to configure a set of USRPs for receiving samples at a specified frequency, samples rate, gain, etc... \\
     94) rf_hw_intf - this a multi-channel uhd streaming application to configure a set of USRPs for receiving samples at a specified frequency, samples rate, gain, etc... \\
    10105) sigproc_avg_bw_pwr - application for processing received samples and writing in OML database \\
    1111
    12 Details on the applications can be found on this page.
     12Details on the streaming applications can be found on this page.
    1313
    1414=== Receive multi channel signal for processing and plotting ===
     
    9494
    9595 || [[Image(mimo_rx.png, width=600px)]] ||
     96
     97
     98
     99
     100
     101
     102== Multi-channel Uhd STreamer ==
     103
     104=== Description ===
     105A high-level application to stream real-time samples from multiple IP addressable USRP devices.
     106
     107=== How it works (without going into the source-code :-D ===
     108Application is split into two run-time objects:
     109 1) hardware interface application - talks to radio and manages sample streaming\\
     110 2) signal handler application - a customized application to process streams samples.
     111
     112The hardware interface application controls and initializes the USRP devices with configuration parameters, enables a remote-commander for run-time query and limited parameter updates and configures a circular queue of shared memory buffers (similar to IPC) for continuous real-time sample streaming to/from the device. At the moment this can run in one mode: receive OR transmit streaming. This object uses an XML file containing a list of devices with configuration parameters to set up all the devices. Once all the devices are configured, this starts a continuous receive / transmit streaming thread for the signal handler application.
     113
     114The second object attaches to the already created shared memory buffer and allows customized processing of the streaming samples in the receive direction or construction of samples in the transmit direction.
     115
     116=== Source code & compilation ===
     117Download the source code from here.
     118
     119Install the required libraries using the package manager and then use ''make'' to generate the executable.
     120{{{
     121> apt-get update
     122> apt-get install libboost-all-dev libpugixml-dev libpugixml1 liblog4cxx10 liblog4cxx10-dev
     123
     124> make
     125}}}
     126
     127Upon successful compilation the following apps will be generated:
     128 1) ''rf_hw_intf''          - the hardware interface application \\
     129 2) ''sigproc_avg_bw_pwr''  - example signal handler application for processing received samples \\
     130 3) ''sigtran''             - example transmit side signal handler application for transmitting
     131\\
     132
     133
     134== Hardware interface application ==
     135
     136The ''rf_hw_intf'' must be specified with an an xml file for device configuration and direction for sample processing.
     137For a list of arguments use ''--help'':
     138{{{
     139linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.010.001.000-0-unknown
     140
     141Multi-channel Uhd STreamer v000.001.000
     142 Allowed options:
     143  --help                 help message
     144  --conf arg             specify xml device configuration file and path
     145                         "devices.xml,/devices/active"
     146  --print-conf           print device conf
     147  --rx-only              enable receive direction only
     148  --tx-only              enable transmit direction only
     149  --cmd-port arg (=5180) command server port
     150}}}
     151
     152
     153
     154=== XML file ===
     155The XML file template is described below. A description of the xml nodes and attributes are in the table.
     156{{{
     157 <devices>
     158  <_grp_rx_ sync="now" rx_freq="1900e6" rx_rate="5e6" rx_gain="10">
     159    <device type="n210" ip="192.168.101.102">
     160      <ch rx_bw="25e6" rx_ant="RX2"
     161          tx_gain="20" tx_bw="25e6" tx_ant="TX/RX" />
     162    </device>
     163
     164    <device type="x310" ip="10.10.23.2">
     165      <ch rx_bw="25e6" rx_ant="RX2"
     166          tx_gain="20" tx_bw="25e6" tx_ant="TX/RX" />
     167    </device>
     168  </_grp_rx_>
     169 <devices>
     170
     171}}}
     172
     173
     174 ||'''Group (parent) nodes / attributes'''  || Description ||
     175 || _grp_rx || specify a group name for a cluster of devices  ||
     176 || sync || clock/time source options \\ now - use internal clock,\\  pps - use external clock and external time source  ||
     177
     178 ||'''Device (child) nodes / attributes'''  || Description ||
     179 || device || specifies a unique radio  ||
     180 || type || device category \\ b200 - this USB based devices. ie. no IP address \\ n210 - IP addressable, must specify sttribute: ip \\ x310 - IP addressable, must specify sttribute: ip  ||
     181 || ip || address of device  ||
     182
     183 ||'''Group / channel attributes, \\ channel attribute takes precedence '''  || Description ||
     184 || ch || specifies a unique radio within device  ||
     185 || rx_freq || receiver carrier frequency  ||
     186 || rx_gain || receiver gain  ||
     187 || rx_rate || receiver rate  ||
     188 || rx_bw   || receiver bandwidth  ||
     189 || rx_ant  || receiver antenna options: \\ TX/RX \\ RX2 ||
     190 || tx_freq || transmit carrier frequency  ||
     191 || tx_gain || transmit gain  ||
     192 || tx_rate || transmit rate  ||
     193 || tx_bw   || transmit bandwidth  ||
     194 || tx_ant  || transmit antenna options: \\ TX/RX ||
     195
     196
     197=== Command server ===
     198The command server can be used to communicate with the application and issue a limited set of control and query commands. This a way to remotely control the device settings during runtime.
     199 ||''' RC commands '''  || Description ||
     200 || rxfreq all || get rx carrier frequency for all channels ||
     201 || rxgain all || get rx gain for all channels ||
     202 || rxrate all || get rx rate for all channels ||
     203 || rxfreq all <freq> || set rx carrier frequency for all channels ||
     204 || rxgain all <gain> || set rx gain for all channels ||
     205 || ---- || set rx rate is not supported during runtime ||
     206
     207 || txfreq all || get tx carrier frequency for all channels ||
     208 || txgain all || get tx gain for all channels ||
     209 || txrate all || get tx rate for all channels ||
     210 || txfreq all <freq> || set tx carrier frequency for all channels ||
     211 || txgain all <gain> || set tx gain for all channels ||
     212 || ---- || set tx rate is not supported during runtime ||
     213
     214
     215=== Usage Example===
     216To stream samples in the receive direction from the device group in /devices/mimo_rx with a command server listening on port 5111.
     217{{{
     218node21-1> ./rf_hw_intf --conf "mimo1.xml,/devices/mimo_rx" --rx-only --cmd-port 5111
     219}}}
     220
     221Stream samples in the transmit direction:
     222{{{
     223node1-1> ./rf_hw_intf --conf "devices.xml,/devices/grid_tx" --tx-only --cmd-port 5112
     224}}}
     225
     226Use the python script to run commands via the hardware interface's command port:
     227{{{
     228console> python rc.py node21-1 5111 "rxfreq all"
     229console> python rc.py node21-1 5111 "rxfreq all 2800e6"
     230}}}
     231
     232== Signal handler applications ==
     233The signal handler application attaches the shared memory buffer allocated by the hardware interface app.
     234Both receive and transmit direction have separate shared memory buffers. The signal handler applications are meant to be run for several iterations without stopping the hardware interface.
     235
     236An example of a receive direction signal handler is provided. Running is app will attach to the receive side shared memory buffer and perform some processing on the received samples. This app (or some variation of it with a different signal handler) can be run for several iterations without stopping the hardware interface application.
     237{{{
     238node21-1> ./sigproc_avg_bw_pwr --time 15
     239}}}
     240
     241
     242Likewise a signal handler for the transmit direction is provided as an example. This attaches to the transmit direction shared memory buffer and populates with predefined samples passed in as an argument.
     243{{{
     244node1-1> samps="octave -qf awgn256.m"
     245node1-1> ./sigtran --sig "`$samps`" --intv 500
     246}}}
     247
     248== Tutorials ==
     249* Multi Channel Sample Processing & Visualization