Changes between Version 12 and Version 13 of Tutorials/Wireless/Measurement Tool


Ignore:
Timestamp:
May 11, 2020, 1:02:24 AM (4 years ago)
Author:
msherman
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/Wireless/Measurement Tool

    v12 v13  
    88
    99=== Prerequisites ===
    10 In order to access the test bed, create a reservation and have it approved by the reservation service. Access to the resources are granted after the reservation is confirmed. Please follow the process shown on [wiki:cosmos_workflow the COSMOS work flow page] to get started.
     10In order to access the test bed, create a reservation and have it approved by the reservation service. Access to the resources are granted after the reservation is confirmed. Please follow the process shown on [wiki:CosmosOverview/Workflow the COSMOS work flow page] to get started.
    1111
    1212=== Set up ===
    1313 1. Sign up for a [https://cosmos-lab.org/portal-2/ COSMOS account]
    1414 2. [UserGuide/CreateRes Create a resource reservation on sandbox 1]
    15  3. [Documentation/Short/Login Login into your reserved domain.]
    16  4. Load merif.ndz.ndz on your resource. [UserGuide/OmfQuickStart  - this is done via OMF commands.]
     15 3. [UserGuide/RemoteAccess/Console Login to your reserved domain.]
     16 4. Load merif.ndz on your resource. [UserGuide/OmfQuickStart  - this is done via OMF commands.]
    1717
    1818  * After loading the image, if utilizing a network based SDR radio (ie. ethernet with IP address) then follow the instructions [https://wiki.cosmos-lab.org/wiki/tutorials/n310_usage here to configure the network interface and detect the radio.]
     
    2727
    2828Use the --help option to display all the variables ''rx_multi_receive'' accepts.
    29 {{{
     29{{{#!shell-session
    3030root@node:~/RX_MULTI_RECEIVE# ./rx_multi_receive --help
    3131UHD RX Multi Receive Allowed options:
     
    5555
    5656To use ''rx_multi_receive'' standalone on an experiment server we can using the following options
    57 {{{
     57{{{#!shell-session
    5858root@node:~/RX_MULTI_RECEIVE# ./rx_multi_receive --args="type=x300" --nsamps 1024000 --freq 2440e6 --rate 100e6 --gain 15 --dilv
    5959}}}
     
    6767
    6868Executing the application with only the above options will only configure the USRP's radio parameters and read in the specified number of samples. However the samples will be lost once the application exits. You should see output similar to the following.
    69 {{{
     69{{{#!shell-session
    7070root@node:~/RX_MULTI_RECEIVE#
    7171
     
    136136Rerun the application with these and we'll see a few additional lines of output at the end indicating a connection to the OML database server.
    137137
    138 {{{
     138{{{#!shell-session
    139139
    140140Writing FFT blocks into rx_multi_samples.sq3 @ 10.113.0.10:3003
     
    149149
    150150 1. A handle to the radio is constructed and is used thoughout the source to make reference to the radio.
    151 {{{
     151{{{#!c++
    152152    std::cout << std::endl;
    153153    std::cout << boost::format("Creating the usrp device with: %s...") % args << std::endl;
     
    156156
    157157 2. Use the handle to configure the radio paramters passed in from the command line.
    158 {{{
    159 
     158{{{#!c++
    160159    //set the rx sample rate (sets across all channels)
    161160    std::cout << boost::format("Setting RX Rate: %f Msps...") % (rate/1e6) << std::endl;
     
    176175      usrp->set_rx_gain(gain,ch);
    177176    std::cout << boost::format("Actual RX Gain: %f dB...") % usrp->get_rx_gain() << std::endl << std::endl;
    178 
    179 
    180 
    181177}}}
    182178
    183179
    184180 3. A receive streamer is created and a loop is used to read out complex samples into a large buffer that is used during post processing samples.
    185 {{{
    186 
     181{{{#!c++
    187182    //setup streaming
    188183    std::cout << std::endl;
     
    219214    } // while()
    220215
    221 
    222216}}}
    223217
     
    226220
    227221 Inside this block, we create an object that performs 1024pt FFTs.
    228 {{{
     222{{{#!c++
    229223   std::vector<std::complex<float> > time_buff( samps_per_buff );
    230224   std::vector<std::complex<float> > freq_buff( samps_per_buff );
     
    239233
    240234 We also construct an object for writing data to an OML server. Initialize the OML object with the OML options described above.
    241 {{{
     235{{{#!c++
    242236      // OML object for sending data
    243237      CWriteOml oml;
     
    246240
    247241 Create keyed-values that will be sent for storage. Here we specify a string label (for the key, ie. a variable) with an OML data type. After all the keyed-value pairs have been defined, we start a connection with the OML service.
    248  {{{
     242 {{{#!c++
    249243      // Register measurement points
    250244      oml.register_mp("mboard_id",        OML_STRING_VALUE);
     
    272266 Once all the keyed-valued pairs are updated with set_key(), they are sented over to the OML server by issuing the insert command.
    273267 This is done repeatedly until the entire buffer has been processed.
    274  {{{
    275 
     268 {{{#!c++
    276269        oml.set_mp("rx_id",            (void*)usrp_info["rx_id"].c_str() );
    277270        oml.set_mp("rx_subdev_name",   (void*)usrp_info["rx_subdev_name"].c_str() );
     
    319312
    320313      } // end for()
    321 
    322 
    323314 }}}
    324315
     
    352343
    353344We can recover the contents of the FFT data for each channel and save them into a binary file for viewing in octave.
    354 {{{
    355 console> ./db_parse --file /var/lib/oml2/rx_multi_samples.sq3 --blob2bin ch0_data.bin --ch 0 --table  _mp__rx_multi_samples --key
     345{{{#!shell-session
     346console:~$ ./db_parse --file /var/lib/oml2/rx_multi_samples.sq3 --blob2bin ch0_data.bin --ch 0 --table  _mp__rx_multi_samples --key
    356347Bins
    357348
     
    361352
    362353In the console we should have a binary file by the name ch0_data.bin. This can be loaded and viewed in ocatve.
    363 {{{
     354{{{#!octave
    364355octave> mag0 = fReadBinaryFile('ch0_data.bin','single');
    365356octave> mag0 = reshape(mag0, 1024, length(mag0)/1024);