On 08/18/2017 11:24 AM, Matheou, Konstantin J. (GRC-LCI0)[ZIN TECHNOLOGIES INC] via USRP-users wrote:

Thanks for any help…

I ran the example file from Ettus called rx_samples_to_file.cpp.

I ran the file and it did extract a binary file that I named.

When I analyzed it in matlab using the function ‘read_float_binary.m’, I received much Nan’s and zeros with actual data…

When I ran the function ‘read_cfloat_binary.m’, I received data that makes sense.. but is it the correct way???

I realize the binary file has complex value that is interleaved….

But when I looked at the code rx_samples_to_file.cpp at the end of it as shown below…

    //recv to file

if (type == "double") recv_to_file<std::complex<double> >(usrp, uhd::io_type_t::COMPLEX_FLOAT64, file, spb);

else if (type == "float") recv_to_file<std::complex<float> >(usrp, uhd::io_type_t::COMPLEX_FLOAT32, file, spb);

else if (type == "short") recv_to_file<std::complex<short> >(usrp, uhd::io_type_t::COMPLEX_INT16, file, spb);

    else throw std::runtime_error("Unknown type " + type);

Where is the type defined? I could not find it in the code? Is it in a header file? I could not find that either…

Each of the UHD examples support a "--help" option. For rx_samples_to_file, you get:

[INFO] [UHD] linux; GNU C++ version 4.8.3 20140911 (Red Hat 4.8.3-7); Boost_105400; UHD_4.0.0.rfnoc-devel-239-g89427e8c
UHD RX samples to file Allowed options:
  --help                         help message
  --args arg                     multi uhd device address args
--file arg (=usrp_samples.dat) name of the file to write binary samples to
  --type arg (=short)            sample type: double, float, or short
  --nsamps arg (=0)              total number of samples to receive
  --duration arg (=0)            total number of seconds to receive
--time arg (DEPRECATED) will go away soon! Use --duration
                                 instead
  --spb arg (=10000)             samples per buffer
  --rate arg (=1000000)          rate of incoming samples
  --freq arg (=0)                RF center frequency in Hz
  --gain arg                     gain for the RF chain
  --ant arg                      antenna selection
  --subdev arg                   subdevice specification
  --bw arg                       analog frontend filter bandwidth in Hz
--ref arg (=internal) reference source (internal, external, mimo)
  --wirefmt arg (=sc16)          wire format (sc8 or sc16)
  --setup arg (=1)               seconds of setup time
  --progress                     periodically display short-term bandwidth
  --stats                        show average bandwidth on exit
--sizemap track packet size and display breakdown on
                                 exit
  --null                         run without writing to file
  --continue                     don't abort on a bad packet
  --skip-lo                      skip checking LO lock status
  --int-n                        tune USRP with integer-N tuning


This application streams data from a single channel of a USRP device to a file.

You can see the default in parenthesis--which in the case of "--type" defaults to "short".


There is this if then tree within the matlab finction….

It seems that the Int16 was used because ‘short’ was used in the Matlab complex function as shown below….

if(f < 0)

    cv = 0;

else

    v = fread (f, count, 'short');

    fclose (f);

    cv = v(1:2:end)+v(2:2:end)*j;

end

This was the output of the constellation…. Thus, noting was over +/-32 in the ineger side. Since this kis a 16 bit representation do we have 10 bits fractional resolution? S5.10 ???



_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
  • [US... Matheou, Konstantin J. (GRC-LCI0)[ZIN TECHNOLOGIES INC] via USRP-users
    • ... Marcus D. Leech via USRP-users

Reply via email to