On Wed, Jun 18, 2014 at 9:14 PM, Nowlan, Sean <sean.now...@gtri.gatech.edu>
wrote:

>  If you’d rather use stock GR blocks or you would like a flowgraph with
> identical functionality, you can hook up a Vector to Stream block (with
> num_items=vector_length) to an Integrate block (with
> decimation=vector_length).
>
>
>
> …
>
> vector_length = 10
>
> self.vec2stream = blocks.vector_to_stream(gr.sizeof_gr_complex,
> vector_length)
>
> self.integrate = blocks.integrate_cc(vector_length)
>
> self.connect((self.vec2stream, 0), (self.integrate, 0))
>
> …
>
>
>
> Sean
>


I agree, that the Integrate block is a decimator block that implement this
perfectly.
Just that she may want to use integrate_ff rather than integrate_cc,
depending on her needs.
Also we are assuming that the intake vectors are fixed in length.

    int
    integrate_ff_impl::work(int noutput_items,
              gr_vector_const_void_star &input_items,
              gr_vector_void_star &output_items)
    {
      const float *in = (const float *)input_items[0];
      float *out = (float *)output_items[0];

      for (int i = 0; i < noutput_items; i++) {
        out[i] = (float)0;
        for (int j = 0; j < d_decim; j++)
          out[i] += in[i*d_decim+j];
      }

      return noutput_items;
    }
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to