I think I’ve misunderstood they way GR_SYNC_BLOCK
works. Can someone set me strait?
I’ve called set_history(1) in the constructor; I have
one input and one output. I assumed that the in buffer
would contain noutput_items + 1 samples; with in[0]
being the history (overlap) from the previous.
I’m trying to take a diff then do a cumsum on the
stream.
Can someone point me in the right direction?
-Daniel
work (
int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
}
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
That out[i] bothers me. Shouldn’t it be out[ii]?
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…
On Wed, Mar 07, 2007 at 09:59:02AM -0800, Daniel G. wrote:
stream.
Can someone point me in the right direction?
You are off by one. The nomenclature might not be the best in the
world, but it’s what we’ve got.
history refers to how many samples you need to look at to compute a
single output (ignoring decimation and interpolation). Thus, the
normal case is 1. That is y[i] = f(x[i]).
If you want noutput_samples + 1, then set_history(2).
Yes, it should. I edited the snippet in the email to
remove a bunch of std::cout junk… mucked that up in
the process.
Is there a good reason for doing this in two
passes with two stores
to each memory location?
There is a very good reason for doing it in two
passes: it doesn’t work. I’m just trying to write it
as straight-forward was possible. After it works, I
can optimize it.