|Subject:||Re: [Discuss-gnuradio] Threaded GRC blocks|
|Date:||Fri, 16 Jan 2015 20:38:23 +0100|
|User-agent:||Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0|
On 01/16/2015 08:19 PM, Jon West wrote:
Thanks for the reply again, I'm still a little confused. I have a process interval of 1 second, meaning every 1 seconds I grab n samples and run my ranging algorithm which can take a while a little while, in the mean time I need to keep track of the absolute sample count so I know the sample number of the first sample in those n samples so that I ca keep track of time , everything I see says every chunk of data coming in is processed.No, you don't have to keep track of anything; GNU Radio does that for you. If you're in a block, you can call the nitems_read (or nitems_written) methods, which will give you the number of consumed (or produced) so far.
So I'd still need my block to keep track of every sample coming in, but only use a buffer when I need to based on time so something needs to keep counting samples while something else waits, and I don't know how to do that in two blocksI think I don't really understand your point, I'm afraid.
If I get you correctly, though, then what you want to do is not to continously stream samples, and process every one of them, but look at short "bursts" of n samples in regular intervals of let's say 500ms.
You could do something
RF source block (@f_sample) -> stream_to_vector (vectors of n) -> keep_n_in_m (keep 1 out of every 500ms/f_sample/n vectors) -> your block -> visualization_or_file_sink_or_something_of_the_like
Would that fit what you would need, somehow?
|[Prev in Thread]||Current Thread||[Next in Thread]|