Daniel Garcia wrote:
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 ii = 0; ii < noutput_items; ii++) {
          out[ii] = in[ii + 1] - in[ii];
        }
        for (int ii = 0; ii < noutput_items; ii++) {
          d_cumsum = out[i] + d_cumsum;
          out[ii] = d_cumsum;
        }

        return noutput_items;
}
I haven't actually tried to figure out the answer to your question, but

1) That out[i] bothers me. Shouldn't it be out[ii]?

2) Is there a good reason for doing this in two passes with two stores to each memory location? You can do this in one pass with another temp variable to hold the first value of out[ii]. The compiler might optimize it for you, and then again it might not...

-Dan


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to