discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Example: rx_samples_to_file.py


From: Marcus D. Leech
Subject: Re: [Discuss-gnuradio] Example: rx_samples_to_file.py
Date: Mon, 06 May 2013 07:52:41 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16


Dear Marcus,

I a working under windows now. I have modified the the example "rx_samples_to_file.cpp" by including the following lines

usrp->set_time_source("external");
usrp->set_time_unknown_pps(uhd::time_spec_t(0.0));
boost::this_thread::sleep(boost::posix_time::seconds(1));

for (size_t chan = 0; chan < usrp->get_rx_num_channels(); chan++)
        stream_args.channels.push_back(chan);
uhd::rx_streamer::sptr rx_stream = usrp->get_rx_stream(stream_args);

std::vector<std::vector<std::complex<float> > > buffs( usrp->get_rx_num_channels(), std::vector<std::complex<float> >(samps_per_buff)   );

 std::vector<std::complex<float> *> buff_ptrs;
    for (size_t i = 0; i < buffs.size(); i++)
         buff_ptrs.push_back(&buffs[i].front());

while(not stop_signal_called and (num_requested_samples != num_total_samps or num_requested_samples == 0)){
        size_t num_rx_samps = rx_stream->recv(buff_ptrs, samps_per_buff, md, 2.0);
        outfile1.write((const char*)buff_ptrs[0], num_rx_samps*sizeof(float));
        outfile2.write((const char*)buff_ptrs[1], num_rx_samps*sizeof(float));
        outfile3.write((const char*)buff_ptrs[2], num_rx_samps*sizeof(float));
    }

    outfile1.close();
    outfile2.close();
    outfile3.close();


I am feeding a split sinusoid to these boards so I expected to see similar values in these three files. However, i only see a sinusoid in the first file and some random noise in the 2nd and 3rd files. I am not sure how the metadata saves from the three boards. Would you check the lines above and reply if you have any insights, please?
I wasn't able to verify sync.

Best regards,

Zo
Where are you actually doing the setup on the 3 N210s?  Via a mult-usrp object?

Seriously, you can do this in GRC in about five minutes.


-- 
Marcus Leech
Principal Investigator
Shirleys Bay Radio Astronomy Consortium
http://www.sbrac.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]