discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] one question about gr_chunks_to_symbols_bc


From: jiangfan shi
Subject: [Discuss-gnuradio] one question about gr_chunks_to_symbols_bc
Date: Thu, 18 Sep 2008 12:16:47 -0500

Hi, All,

I looked through the gr_chunks_to_symbols_bc code, my understanding is
that it handles a two-dimension array. Based on the following work()
function, my understanding is that  each input_items[m] is a list of
chunk (called stream in this function), and the input_items itself is
a list of stream. Then the function maps each chunk to a complex based
on the symbol table.  Am I right?

=============================
int
gr_chunks_to_symbols_bc::work (int noutput_items,
                        gr_vector_const_void_star &input_items,
                        gr_vector_void_star &output_items)
{
  assert (noutput_items % d_D == 0);
  assert (input_items.size() == output_items.size());
  int nstreams = input_items.size();

  for (int m=0;m<nstreams;m++) {
    const unsigned char *in = (unsigned char *) input_items[m];
    gr_complex *out = (gr_complex *) output_items[m];

    // per stream processing
    for (int i = 0; i < noutput_items / d_D; i++){
      assert (((unsigned int)in[i]*d_D+d_D) <= d_symbol_table.size());
      memcpy(out, &d_symbol_table[(unsigned int)in[i]*d_D],
d_D*sizeof(gr_complex));
      out+=d_D;
    }
    // end of per stream processing

  }
  return noutput_items;
}

==========================

Another question is that what the gr_chunks_to_symbols_bc constructor
means? Based on the following code, I do not understand d_D(D) and
d_symbol_table (symbol_table). I know gr_sync_interpolator() is called
explicitly in gr_chunks_to_symbols_bc's constructor. are d_D and
d_symbol_table other classes? or something else?

=========================
gr_chunks_to_symbols_bc::gr_chunks_to_symbols_bc (const
std::vector<gr_complex> &symbol_table, const int D)
  : gr_sync_interpolator ("chunks_to_symbols_bc",
                          gr_make_io_signature (1, -1, sizeof (unsigned char)),
                          gr_make_io_signature (1, -1, sizeof (gr_complex)),
                          D),
  d_D (D),
  d_symbol_table (symbol_table)
{
}

=========================

Thanks for your help.

Jiangfan




reply via email to

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