discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] MIMO source - bursts


From: Josh Blum
Subject: Re: [Discuss-gnuradio] MIMO source - bursts
Date: Tue, 03 Aug 2010 09:14:41 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6



On 08/03/2010 08:35 AM, Zohair wrote:

Dear All,

Have anybody tried that using USRP2 to received bursts of data rather than
countinous?

I have tried doing this as the the sampling rate is very high and I have a
several blocks (that are calculation intensive) in my flow graphs. I am not
really interested in receiveing all the samples. reading a 1000 samples each
1 second is fine.  I tried doing this y modifying the MIMO sourse already
implemented. by doing this:

   void set_streaming(bool enb){

        if (enb){
            uhd::stream_cmd_t
stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_MORE);
            stream_cmd.stream_now = false;
            stream_cmd.num_samps=1000;
            stream_cmd.time_spec = get_time_now() +
uhd::time_spec_t((kk++)+0.05); // kk is 0 initially
          _dev->issue_stream_cmd(stream_cmd);
       }
   else
      _dev->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
      _is_streaming = enb;

  }

What happens is that it reads the first 1000 samples and this stops,
displaying a message that the block doen't produce any output.


The return values from the work function are important here. First, you get the 1000 samples. After that, a call to recv returns 0 samples and a timeout. A return value of zero to gnuradio means: stop the flowgraph and complain. However, if you return -1, the flowgraph will properly shutdown. So, you may want to maintain a count of received samples and return -1 after that amount has been accumulated.

Also, if you want to receive multiple 1000 sample bursts, you will have to issue multiple commands. If those busts are non-contiguous, you should use STREAM_MODE_NUM_SAMPS_AND_DONE

-Josh



reply via email to

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