Questions about get_tags_in_range

Hi all:
I’m reading the source code ofdm_chanest_vcvc_impl.cc.And I
don’t know this command:
// Propagate tags
std::vectorgr::tag_t tags;
get_tags_in_range(tags, 0,nitems_read(0),
nitems_read(0)+framesize);

   I will try my best to explain my question more clearly.
  1. I read:
    void ofdm_chanest_vcvc_impl::forecast (int noutput_items,
    gr_vector_int &ninput_items_required)
    {
    ninput_items_required[0] = (noutput_items/d_n_data_syms) *
    (d_n_data_syms + d_n_sync_syms);
    }
    And I think ninput_items_required[0] = (1/1) * (1 + 2)=3.
    Then nitems_read(0)=3.Is it right?(nitems_read:Return the number of
    items read on input stream which_input. )
  2. const int framesize = d_n_sync_syms + d_n_data_syms;
    Then framesize=2+1=3.
    3.Then get_tags_in_range(tags, 0,nitems_read(0),
    nitems_read(0)+framesize);---->>>get_tags_in_range(tags, 0,3, 6);
    But:
    {0 1 2}—>>>blk—>>>{0}
    It don’t have 3 4 5 item.Can someone explain it to me?Thank you.
    Best regards,
    xd

Hi Xianda,

On 07.08.2014 08:10, xianda wrote:

   ninput_items_required[0] = (noutput_items/d_n_data_syms) * (d_n_data_syms 
  • d_n_sync_syms);
 }
 And I think ninput_items_required[0] = (1/1) * (1 + 2)=3.

If you say so?! I don’t know the value of any of these variables at the
time GNU Radio calls this. Usually, the scheduler doesn’t ask for a
single output item, but for more, so noutput_items >> 1.

 Then nitems_read(0)=3.Is it right?(nitems_read:Return the number of items 

read on input stream which_input. )
Wrong, nitems_read(0) is the number of items that have been consumed by
a block up to now. “read” is past tense, here.

  1. const int framesize = d_n_sync_syms + d_n_data_syms;
    Then framesize=2+1=3.
    this obviously depends on what your instance uses as number of sync
    symbols and data symbols.
    3.Then get_tags_in_range(tags, 0,nitems_read(0),
    nitems_read(0)+framesize);---->>>get_tags_in_range(tags, 0,3, 6);
    But:
    {0 1 2}—>>>blk—>>>{0}
    It don’t have 3 4 5 item.Can someone explain it to me?Thank you.
    Best regards,
    xd
    get_tags_in_range stores the tags in the tag vector you supply as first
    argument:

get_tags_in_range(tags, 0,nitems_read(0), nitems_read(0)+framesize);

The second argument is the input stream number (0), the third is the
start of the range, in this case the number of items that have already
been consumed in previous calls to work, which is the number of the
first item in the current call to work. The third argument is the end of
the range.

Hope that cleared things up a little!

Greetings,
Marcus

Xianda,

if you don’t know commands, you can look them up in the manual.
http://gnuradio.org/doc/doxygen/classgr_1_1block.html#aa0272555827fe26a1878e53ce4be092c

M

Hi:
Thanks Marcus and Martin.So kindly of you.Thanks.
Now I understand the command get_tags_in_range.Thank you.
But

  void ofdm_chanest_vcvc_impl::forecast (int noutput_items, gr_vector_int 

&ninput_items_required)

 {
   ninput_items_required[0] = (noutput_items/d_n_data_syms) * 

(d_n_data_syms + d_n_sync_syms);

 }
 And I think ninput_items_required[0] = (1/1) * (1 + 2)=3.

If you say so?! I don’t know the value of any of these variables at the
time GNU Radio calls this. Usually, the scheduler doesn’t ask for a
single output item, but for more, so noutput_items >> 1.

For the block:OFDM Channel Estimation,can I say noutput_items=1?Because
I know every time,the block output just one vector(item).Can you explain
it to me?Thank you so much.
Best regards,
xd