discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] forecast and general work function


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] forecast and general work function
Date: Wed, 28 Oct 2015 22:36:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Hi Subrata,

while what you plan to do is possible if you build a block with a
general_work method and a forecast. In fact, here the forecast
implementation will probably be pretty crucial, but also be pretty
simple -- just always require the same amount of samples from input0 as
you're asked to produce output, and don't require anything from input1.

However, I'm pretty certain GNU Radio won't schedule your block as you
want to (in fact, I just wrote a minimal test case to verify[1]).

My general recommendation would be to write a minimal block that takes a
stream and converts it to messages, and passes those to
gr-eventstream[2]. gr-eventstream has blocks to do exactly that: produce
a zero-signal when there's no (message) input, produce the content of
the message input otherwise; you could just take that output and add it
to your input1, and be done :)

Best regards,
Marcus


[1] https://github.com/marcusmueller/gr-demo_assymetric_input clone, and
run ./qa_prioritizer.py in the python/ folder
[2] http://oshearesearch.com/tag/gr-eventstream/
On 28.10.2015 21:26, address@hidden wrote:
> I am trying to create a block that has two input and one output. Its like a 
> priority multiplexer; if input0 is empty then output = input1 else output = 
> input0 ( input0 always has samples) its a stream based block. 
> How do I declare the work function, because the number of samples needed from 
> each input to produce noutput_items depends on whether input0 is empty. 
> Any help in the general work function is also greatly appreciated.
>
> Thanks
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




reply via email to

[Prev in Thread] Current Thread [Next in Thread]