Hi all,

We have a X310 SDR and we are obtaining IQ samples from 4 channels. To do that we created 4 buffers to store them and for debug purposes write them in a file.

The problem we have is that at the beginning of the buffers they appear to be empty (full of zeros), the attached file contains a memory dump of all the buffers.

The following code is the initialization of the SDR, maybe we are forgetting to initialize some parameters.

    std::string device_args = "RIO0";
    std::string subdev = "A:0 A:1 B:0 B:1";
    std::string clock_source = "internal";

    usrp = uhd::usrp::multi_usrp::make(device_args);
    usrp->set_clock_source(clock_source);
    usrp->set_rx_subdev_spec(subdev);

    uhd::tune_request_t tune_request(freq);

    for (int i = 0; i < CHANNELS; i++) {
        usrp->set_rx_rate(rate,i);
        usrp->set_rx_freq(tune_request,i);
        usrp->set_rx_gain(gain,i);
        usrp->set_rx_bandwidth(bw,i);
    }

    uhd::stream_args_t stream_args("fc32", "sc16");
    stream_args.channels = {0, 1, 2, 3};
    stream_args.args["spp"] = "512";
    rx_stream = usrp->get_rx_stream(stream_args);
    const int spp = rx_stream->get_max_num_samps();

    std::vector<std::vector<std::complex<float>>> buffs (
        num_channels,
        std::vector<std::complex<float>> (spp)
    );

    for(int i = 0; i< buffs.size(); i++)
        buffPtrs.push_back(buffs[i].data());

uhd::stream_cmd_t stream_cmd = uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS;
    stream_cmd.stream_now = false;


//We suspect this block is causing the odd behavior
{
    stream_cmd.time_spec = uhd::time_spec_t (1.9);
    rx_stream->issue_stream_cmd(stream_cmd);
    std::this_thread::sleep_for(std::chrono::milliseconds(2000));
}

Then this function is called multiple times to gather the IQ samples

    read = rx_stream->recv(buffPtrs, 512, rx_metadata, 2);

Hope you can help us, thanks beforehand.

Pablo (Universidad Politécnica de Madrid)
Channel 0

0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 e4fe ff37 0000 0000 e4fe ffb7
0000 0000 2bff bf38 0000 0000 4eff 1fb9
0000 0000 60ff 8f39 e4fe ff37 08ff dfb9
e4fe ffb7 3dff 2f3a e4fe ff37 6eff 83ba

Channel 1

0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
e4fe ffb7 e4fe ff37 e4fe ff37 e4fe ffb7
e4fe 7fb8 e4fe 7f38 e4fe ff38 2bff bfb8
2bff 3fb9 2bff 3f39 4eff 9f39 60ff 8fb9
f6fe efb9 f6fe ef39 3dff 2f3a 3dff 2fba

Channel 2

0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
e4fe ff37 0000 0000 e4fe ffb7 0000 0000
2bff bf38 e4fe ffb7 4eff 1fb9 e4fe 7f38
60ff 8f39 e4fe ffb8 08ff dfb9 2bff 3f39
3dff 2f3a 60ff 8fb9 6eff 83ba 08ff df39


Channel 3

0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
e4fe ffb7 e4fe ffb7 e4fe ff37 e4fe ff37
e4fe 7fb8 e4fe 7fb8 2bff bf38 4eff 1f39
2bff 3fb9 08ff 5fb9 e4fe 7f39 2bff bf39
19ff cfb9 60ff 0fba 4eff 1f3a 08ff 5f3a
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to