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: Thu, 29 Oct 2015 19:44:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

As mentioned, the stream-to-message-passing gr-eventstream approach is
right for you.

Best regards,
Marcus

On 10/29/2015 01:47 PM, address@hidden wrote:
> Thank you Marcus. I am trying to simulate a network with 2 transmitters and 
> one receiver. The TX's transmit streams at random times and the RX receives 
> the sum of the signals from both the TX's. The adder block however doesn't 
> give any output when one of its input stream is empty (i.e. when both the 
> inputs are not available at the same time) . That's why I'm trying to create 
> an intermediate block for each TX that takes in an input and outputs zeros if 
> the input is empty. This way the adder block would always have something to 
> add. Thanks.
>
> Subrata
>
>> On Oct 28, 2015, at 17:36, Marcus Müller <address@hidden> wrote:
>>
>> 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
>>
>> _______________________________________________
>> 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]