Hello,
I am trying to use "rx_samples_to_file.cpp" in UHD to save samples received.
UHD seems save samples in complex integer format in c++.
However, it is not possible to read that format from Matlab.
I have checked the Matlab utilities in Gnuradio, but they were not useful.
Is that any simpler way to change the formats of the saving file so that
Matlab can easily read?

Another question is that why the saved samples are integer format? not
float?
Thanks for reading.

------------------------------------------------------------------------------------------------------------

    std::vector<std::complex<short> >
buff(dev->get_max_recv_samps_per_packet());
    std::ofstream outfile(file.c_str(), std::ofstream::binary);

    while(num_acc_samps < total_num_samps){
        size_t num_rx_samps = dev->recv(
            &buff.front(), buff.size(), md,
            uhd::io_type_t::COMPLEX_INT16,
            uhd::device::RECV_MODE_ONE_PACKET
        );

        outfile.write((const char*)&buff[0], num_rx_samps *
sizeof(std::complex<short>));


-- *
*
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to