| 1 | == Multi channel sample collection with x310 == |
| 2 | |
| 3 | === Description === |
| 4 | We'll demonstrate using multiple USRPs to collect samples. |
| 5 | |
| 6 | === Set up === |
| 7 | 1. [https://www.orbit-lab.org/schedule Make a reservation] of the grid console. |
| 8 | 2. Verify availability of x310s of the grid, then power cycle the x310s with omf commands. |
| 9 | {{{ |
| 10 | grid> omf stat -t [23,1..8] |
| 11 | grid> omf tell -a offh -t [23,1..8] |
| 12 | grid> omf tell -a on -t [23,1..8] |
| 13 | }}} |
| 14 | |
| 15 | 3. In this example we'll use node21-1 to run the application to collect samples. This node will have access to all usrps on the grid's RF device column ie. ''-t [23,1..8]'' |
| 16 | |
| 17 | Load ''baseline-sdr.ndz'' image and then ssh into node21-1 |
| 18 | {{{ |
| 19 | grid> omf load -i baseline-sdr.ndz -t node21-1 |
| 20 | grid> omf tell -a on -t node21-1 |
| 21 | grid> ssh root@node21-1 |
| 22 | }}} |
| 23 | |
| 24 | 4. [Optional] Test the PPS input to x310s |
| 25 | {{{ |
| 26 | root@node21-1:~/uhd/host/build/examples# ./test_pps_input --args="addr=10.10.23.1" --source external |
| 27 | }}} |
| 28 | Output text should indicate "Success!" |
| 29 | |
| 30 | === Collect samples === |
| 31 | 1. The application to collect samples is ''rx_multi_receive''. Run this with --help to get a list of options. |
| 32 | {{{ |
| 33 | root@node21-1:~/RX_MULTI_RECEIVE# ./rx_multi_receive --help |
| 34 | linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.009.003-0-unknown |
| 35 | |
| 36 | UHD RX Multi Samples Allowed options: |
| 37 | --help help message |
| 38 | --args arg single uhd device address args |
| 39 | --secs arg (=1.5) number of seconds in the future to receive |
| 40 | --nsamps arg (=10000) total number of samples to receive |
| 41 | --freq arg (=900000000) RF center frequency in Hz for all channels |
| 42 | --rate arg (=6250000) rate of incoming samples for all channels |
| 43 | --gain arg (=0) gain for the RF chain for all channels |
| 44 | --prefix arg enables file output with filename prefix |
| 45 | --addr arg udp address: 10.10.0.10 |
| 46 | --port arg (=1337) udp port: 1337 |
| 47 | --sync arg (=now) synchronization method: now, pps, mimo |
| 48 | --subdev arg subdev spec (homogeneous across motherboards) |
| 49 | --dilv specify to disable inner-loop verbose |
| 50 | --int-n tune USRP with integer-N tuning |
| 51 | --channels arg (=0) which channel(s) to use (specify "0", "1", "0,1", |
| 52 | etc) |
| 53 | |
| 54 | }}} |
| 55 | |
| 56 | This app is very similar to ''rx_multi_sample'' provided in the UHD examples directory but with a few additional arguments: |
| 57 | * The values given with options --freq and --gain are specified across all channels. |
| 58 | * Use the option --prefix to collect samples from all channels to a file name tagged with the prefix and channel number. |
| 59 | * The samples can also be sent out via UDP by providing --addr and --port. |
| 60 | |
| 61 | 2. To collect samples with 3 x310s with both daughter boards (for a total of 6 channels) |
| 62 | {{{ |
| 63 | root@node21-1:~/RX_MULTI_RECEIVE# now="date +%Y%m%d"T"%H%M%S"Z" " |
| 64 | root@node21-1:~/RX_MULTI_RECEIVE# ./rx_multi_receive --nsamps 1024 --rate 5e6 --args="addr0=10.10.23.1,addr1=10.10.23.3,addr2=10.10.23.4" --subdev "A:0 B:0" --channels "0,1,2,3,4,5" --prefix "x310_`$now`_" --sync "pps" --secs 5 |
| 65 | }}} |
| 66 | |
| 67 | Each channel data is collected into an ascii file with meta information and a binary file with only sample data: |
| 68 | {{{ |
| 69 | -rw-r--r-- 1 root root 27262 May 6 14:28 x310_20160506T142807Z_ch_0_meta |
| 70 | -rw-r--r-- 1 root root 8192 May 6 14:28 x310_20160506T142807Z_ch_0_binary |
| 71 | -rw-r--r-- 1 root root 27643 May 6 14:28 x310_20160506T142807Z_ch_2_meta |
| 72 | -rw-r--r-- 1 root root 8192 May 6 14:28 x310_20160506T142807Z_ch_2_binary |
| 73 | -rw-r--r-- 1 root root 27735 May 6 14:28 x310_20160506T142807Z_ch_1_meta |
| 74 | -rw-r--r-- 1 root root 8192 May 6 14:28 x310_20160506T142807Z_ch_1_binary |
| 75 | -rw-r--r-- 1 root root 27360 May 6 14:28 x310_20160506T142807Z_ch_4_meta |
| 76 | -rw-r--r-- 1 root root 8192 May 6 14:28 x310_20160506T142807Z_ch_4_binary |
| 77 | -rw-r--r-- 1 root root 27678 May 6 14:28 x310_20160506T142807Z_ch_3_meta |
| 78 | -rw-r--r-- 1 root root 8192 May 6 14:28 x310_20160506T142807Z_ch_3_binary |
| 79 | -rw-r--r-- 1 root root 26868 May 6 14:28 x310_20160506T142807Z_ch_5_meta |
| 80 | -rw-r--r-- 1 root root 8192 May 6 14:28 x310_20160506T142807Z_ch_5_binary |
| 81 | }}} |
| 82 | |
| 83 | 3. Details of each channel in the meta file. The channel sample data is also appended in ascii text if the samples collected is less than ~16000. |
| 84 | {{{ |
| 85 | root@node21-1:~/RX_MULTI_RECEIVE# more x310_20160506T142807Z_ch_0_meta |
| 86 | channel : 0 |
| 87 | mboard id : X310 |
| 88 | mboard_serial : 30A3570 |
| 89 | mboard_name : Mercury |
| 90 | rx_id : UBX-160 v1 (0x007a) |
| 91 | rx_subdev_name : UBX RX |
| 92 | rx_subdev_spec : A:0 B:0 |
| 93 | total samples : 1024 |
| 94 | sample size : 8 |
| 95 | RX frequency (MHz) : 900 |
| 96 | RX sample rate (MHz) : 5 |
| 97 | RX gain (dB) : 0 |
| 98 | }}} |
| 99 | |
| 100 | 4. The channels complete sample data is located in the files labeled binary. To quickly view contents of the binary file: |
| 101 | {{{ |
| 102 | root@node21-1:~/RX_MULTI_RECEIVE# hexdump -v -e '"%010_ad [" 2/4 "%f " "]\n"' x310_20160506T142807Z_ch_0_binary |
| 103 | 0000000000 [0.000000 0.000031] |
| 104 | 0000000008 [-0.000244 -0.000092] |
| 105 | 0000000016 [-0.000153 0.000061] |
| 106 | 0000000024 [-0.000214 0.000061] |
| 107 | 0000000032 [-0.000122 0.000061] |
| 108 | 0000000040 [0.000031 0.000153] |
| 109 | 0000000048 [-0.000122 -0.000061] |
| 110 | 0000000056 [-0.000183 -0.000061] |
| 111 | 0000000064 [-0.000092 0.000153] |
| 112 | 0000000072 [-0.000031 0.000031] |
| 113 | 0000000080 [-0.000153 0.000000] |
| 114 | 0000000088 [0.000031 0.000061] |
| 115 | : |
| 116 | : |
| 117 | : |
| 118 | }}} |