Re: [Discuss-gnuradio] gr_block::set_history()

2012-10-01 Thread Tom Rondeau
On Mon, Sep 24, 2012 at 12:47 PM, cjpatton wrote: > Hello Tom, > > I have a follow-up question about how history works in gnuradio. Making no > assumptions about the input/output ratio of a gr_block, is it safe to assume > that noutput_items is the number of new data given to the block? I.e., Does

Re: [Discuss-gnuradio] gr_block::set_history()

2012-09-24 Thread cjpatton
Hello Tom, I have a follow-up question about how history works in gnuradio. Making no assumptions about the input/output ratio of a gr_block, is it safe to assume that noutput_items is the number of new data given to the block? I.e., Does calling 'consume(noutput_items)' consume all the new data

Re: [Discuss-gnuradio] gr_block::set_history()

2012-09-21 Thread Tom Rondeau
On Fri, Sep 21, 2012 at 1:47 PM, cjpatton wrote: > Hello Tom, > > Of course, how could I forget? I had to modify your code a bit to get to > work, however: > >const float *in = (const float *) &((const > float*)input_items[0])[history()-1]; > > It just needed a type cast in there. My code work

Re: [Discuss-gnuradio] gr_block::set_history()

2012-09-21 Thread cjpatton
Hello Tom, Of course, how could I forget? I had to modify your code a bit to get to work, however: const float *in = (const float *) &((const float*)input_items[0])[history()-1]; It just needed a type cast in there. My code works now. The suggestion about gr_quadrature_demod_cf is very helpfu

Re: [Discuss-gnuradio] gr_block::set_history()

2012-09-21 Thread Tom Rondeau
On Fri, Sep 21, 2012 at 1:18 PM, cjpatton wrote: > Tom and Kyle, > > Thanks for your replies. Suppose I want in[0] to refer to the beginning of > the new data. Then I could do this: > >const float *in = (const float *) input_items[history()-1]; > > So in[noutput_items-1] is the last? Thanks! >

Re: [Discuss-gnuradio] gr_block::set_history()

2012-09-21 Thread cjpatton
Tom and Kyle, Thanks for your replies. Suppose I want in[0] to refer to the beginning of the new data. Then I could do this: const float *in = (const float *) input_items[history()-1]; So in[noutput_items-1] is the last? Thanks! Chris -- View this message in context: http://gnuradio

Re: [Discuss-gnuradio] gr_block::set_history()

2012-09-21 Thread Tom Rondeau
On Thu, Sep 20, 2012 at 8:15 PM, Kyle Zhou wrote: > > > I have a general work function for which I will use GNU Radio's history > > functionality. In the block's constructor, I call set_history( m ). I cast > the input buffer in the standard way: > > const float *in = (const float *) input_items

Re: [Discuss-gnuradio] gr_block::set_history()

2012-09-20 Thread Kyle Zhou
> I have a general work function for which I will use GNU Radio's history functionality. In the block's constructor, I call set_history( m ). I cast the input buffer in the standard way: const float *in = (const float *) input_items[0]; My question is wheere in[0] refers to in the buffer. It

[Discuss-gnuradio] gr_block::set_history()

2012-09-20 Thread cjpatton
I have a general work function for which I will use GNU Radio's history functionality. In the block's constructor, I call set_history( m ). I cast the input buffer in the standard way: const float *in = (const float *) input_items[0]; My question is wheere in[0] refers to in the buffer. It woul