# Re: Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

**URL:** <https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193>\
**Category:** GNU Radio\
**Created:** [June 4, 2014, 11:53am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193 "2014-06-04T11:53:05Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_sam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7993a0/32.png) [@jason\_sam](https://www.ruby-forum.com/u/jason_sam)\
**Post date:** [June 4, 2014, 11:53am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/1 "2014-06-04T11:53:05Z")

</div>

On Wed, Jun 4, 2014 at 4:59 PM, David Halls  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi!
> 
> This shouldn’t be the case. But is there any easy way to allow different  
> rates on the two streams, so I could produce more zeros on stream 1 than  
> items on stream 0? Or vice versa?
> 
> David

Please stay on the list.

To have different rates on different inputs,  
[1]  
[http://lists.gnu.org/archive/html/discuss-gnuradio/2014-05/msg00166.html](http://lists.gnu.org/archive/html/discuss-gnuradio/2014-05/msg00166.html)  
[2] [http://gnuradio.4.n7.nabble.com/set-relative-rate-td46167.html](http://gnuradio.4.n7.nabble.com/set-relative-rate-td46167.html)

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 4, 2014, 11:56am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/2 "2014-06-04T11:56:38Z")

</div>

Sorry – I meant to hit reply all!

From: Activecat [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
Sent: 04 June 2014 10:51  
To: removed\_email\_address@domain.invalid  
Cc: David Halls  
Subject: Re: [Discuss-gnuradio] Scheduling a block even with no input  
items RE: Flow graph blocking when doing 2x1 transmission

On Wed, Jun 4, 2014 at 4:59 PM, David Halls  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
wrote:  
Hi!

This shouldn’t be the case. But is there any easy way to allow different  
rates on the two streams, so I could produce more zeros on stream 1 than  
items on stream 0? Or vice versa?

David

Please stay on the list.  
To have different rates on different inputs,  
[1]  
[http://lists.gnu.org/archive/html/discuss-gnuradio/2014-05/msg00166.html](http://lists.gnu.org/archive/html/discuss-gnuradio/2014-05/msg00166.html)  
[2] [http://gnuradio.4.n7.nabble.com/set-relative-rate-td46167.html](http://gnuradio.4.n7.nabble.com/set-relative-rate-td46167.html)

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 4, 2014, 12:42pm UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/3 "2014-06-04T12:42:35Z")

</div>

Hi,

Thank you for those links. Unfortunately the rates for the two ports are  
not an exact ratio, so I am not sure how this will work. Also I have

ninput\_items\_required[0] = noutput\_items;  
ninput\_items\_required[1] = 0;

I am not quite sure how to change this… Maybe it will help to show  
more clearly what I am doing.

Attached is a flow graph that shows how I have managed to achieve what I  
want - but clearly it is a real fudge.

I am doing a 2x1 transmission, so in time-domain (TD), I have [ Header 1  
(240 samples), Header 2 (240 samples), superimposed Payload Tx1 + Tx2  
(1280 samples) ] then this repeats.

Header TD Tx1, Header TD Tx2 and Payload TD Tx1 always have items  
available, _but_ Payload TD Tx2 has no items at time=0.

I would like the header data (both Tx1 and Tx2 to always be transmitted,  
so that even when Payload TD Tx2 is not available, the protocol/frame  
structure does not break down.

Regards,

David

* * *

From: Activecat [removed\_email\_address@domain.invalid]  
Sent: 04 June 2014 10:51  
To: removed\_email\_address@domain.invalid  
Cc: David Halls  
Subject: Re: [Discuss-gnuradio] Scheduling a block even with no input  
items RE: Flow graph blocking when doing 2x1 transmission

On Wed, Jun 4, 2014 at 4:59 PM, David Halls  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
wrote:  
Hi!

This shouldn’t be the case. But is there any easy way to allow different  
rates on the two streams, so I could produce more zeros on stream 1 than  
items on stream 0? Or vice versa?

David

Please stay on the list.

To have different rates on different inputs,  
[1]  
[http://lists.gnu.org/archive/html/discuss-gnuradio/2014-05/msg00166.html](http://lists.gnu.org/archive/html/discuss-gnuradio/2014-05/msg00166.html)  
[2] [http://gnuradio.4.n7.nabble.com/set-relative-rate-td46167.html](http://gnuradio.4.n7.nabble.com/set-relative-rate-td46167.html)

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 4, 2014, 1:12pm UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/4 "2014-06-04T13:12:05Z")

</div>

Activecat,

In fact my horrible hack doesn’t work properly. Once items start  
arriving at Payload TD Tx 2, they still don’t arrive as ‘consistently’  
(for want of a better word), as those from the Noise Source block, and  
thus zeros are inserted when they are not required!

David

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 4, 2014, 5:03pm UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/5 "2014-06-04T17:03:14Z")

</div>

Please do not top post.  
Refer  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/MailingLists#Guidelines-for-posting](http://gnuradio.org/redmine/projects/gnuradio/wiki/MailingLists#Guidelines-for-posting)

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 4, 2014, 7:10pm UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/6 "2014-06-04T19:10:38Z")

</div>

On Wed, Jun 4, 2014 at 7:10 PM, David Halls  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Activecat,
> 
> In fact my horrible hack doesn’t work properly. Once items start arriving  
> at Payload TD Tx 2, they still don’t arrive as ‘consistently’ (for want of  
> a better word), as those from the Noise Source block, and thus zeros are  
> inserted when they are not required!
> 
> David

David,

Could you please explain in details, what is this Payload TD Tx 2?  
How does it generate data, is it getting data from a hardware or  
console,  
why it sometime idle but sometime transmitting?

This is a virtual source. Where is it associated virtual sink?

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 4, 2014, 9:09pm UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/7 "2014-06-04T21:09:07Z")

</div>

Hi Activecat,

I have disconnected the rest of the flow graph because it is extremely  
complex.

In the system I have a Source, a Relay (1 rx USRP, 1 tx USRP), a  
Destination. S —\> R\_rx/R\_tx → D

The two transmitters that you see on that flow graph snippet I sent you  
are the the Source Tx and the Relay Tx.

Payload TD Tx 1 is derived from input codewords that are generated in  
MATLAB and stored in a file, then loaded into the flow graph. The  
payload is created in a similar fashion to Martin’s original OFDM\_tx.  
This is then transmitted from Source Tx.

Until this point, no packets are received by Relay Rx but once the  
source transmits, these packets are then received by Relay Rx, and then  
there is a decode-and-forward chain of blocks, and this then creates  
Payload TD Tx 2.

The full flow graph is attached, but may be missing many blocks for  
you…

David

* * *

From: Activecat [removed\_email\_address@domain.invalid]  
Sent: 04 June 2014 13:45  
To: removed\_email\_address@domain.invalid  
Cc: David Halls  
Subject: Re: [Discuss-gnuradio] Scheduling a block even with no input  
items RE: Flow graph blocking when doing 2x1 transmission

On Wed, Jun 4, 2014 at 7:10 PM, David Halls  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
wrote:  
Activecat,

In fact my horrible hack doesn’t work properly. Once items start  
arriving at Payload TD Tx 2, they still don’t arrive as ‘consistently’  
(for want of a better word), as those from the Noise Source block, and  
thus zeros are inserted when they are not required!

David

David,

Could you please explain in details, what is this Payload TD Tx 2?  
How does it generate data, is it getting data from a hardware or  
console, why it sometime idle but sometime transmitting?

This is a virtual source. Where is it associated virtual sink?

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 5, 2014, 12:53am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/8 "2014-06-05T00:53:42Z")

</div>

On Wed, Jun 4, 2014 at 8:53 PM, David Halls  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 

How many USRP are controlled by this flowgraph?  
It seems at least three, what is the exact number?

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 5, 2014, 12:57am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/9 "2014-06-05T00:57:49Z")

</div>

* * *

From: Activecat [removed\_email\_address@domain.invalid]  
Sent: 04 June 2014 15:21  
To: David Halls  
Cc: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: [Discuss-gnuradio] Scheduling a block even with no input  
items RE: Flow graph blocking when doing 2x1 transmission

On Wed, Jun 4, 2014 at 8:53 PM, David Halls  
\<[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
wrote:  
Hi Activecat,

I have disconnected the rest of the flow graph because it is extremely  
complex.

In the system I have a Source, a Relay (1 rx USRP, 1 tx USRP), a  
Destination. S —\> R\_rx/R\_tx → D

The two transmitters that you see on that flow graph snippet I sent you  
are the the Source Tx and the Relay Tx.

Payload TD Tx 1 is derived from input codewords that are generated in  
MATLAB and stored in a file, then loaded into the flow graph. The  
payload is created in a similar fashion to Martin’s original OFDM\_tx.  
This is then transmitted from Source Tx.

Until this point, no packets are received by Relay Rx but once the  
source transmits, these packets are then received by Relay Rx, and then  
there is a decode-and-forward chain of blocks, and this then creates  
Payload TD Tx 2.

The full flow graph is attached, but may be missing many blocks for  
you…

## How many USRP are controlled by this flowgraph? It seems at least three, what is the exact number?

Yes, there are 3. The Source Tx, the Relay Tx, and the Relay Rx.

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 5, 2014, 1:11am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/10 "2014-06-05T01:11:22Z")

</div>

On Wed, Jun 4, 2014 at 10:25 PM, David Halls  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Yes, there are 3. The Source Tx, the Relay Tx, and the Relay Rx.

To clarify,  
i). the “Source Tx” USRP may or may not receive data at any time  
interval.  
ii). the “Relay Tx” USRP transmit data only when the “Source Tx” USRP  
receive data, and there is a delay due to signal processing  
iii). the “Relay Rx” USRP will receive data only when the “Relay Tx”  
USRP  
transmit it,

is this correct?

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 4, 2014, 9:53pm UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/11 "2014-06-04T21:53:58Z")

</div>

On Wed, Jun 4, 2014 at 8:53 PM, David Halls  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 

Could you send the source code of the missing blocks to me?  
I am trying hard to help you out.

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 5, 2014, 1:24am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/12 "2014-06-05T01:24:20Z")

</div>

* * *

From: Activecat [removed\_email\_address@domain.invalid]  
Sent: 04 June 2014 15:39  
To: David Halls  
Cc: removed\_email\_address@domain.invalid  
Subject: Re: [Discuss-gnuradio] Scheduling a block even with no input  
items RE: Flow graph blocking when doing 2x1 transmission

On Wed, Jun 4, 2014 at 10:25 PM, David Halls  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
wrote:  
Yes, there are 3. The Source Tx, the Relay Tx, and the Relay Rx.

To clarify,  
i). the “Source Tx” USRP may or may not receive data at any time  
interval.  
ii). the “Relay Tx” USRP transmit data only when the “Source Tx” USRP  
receive data, and there is a delay due to signal processing  
iii). the “Relay Rx” USRP will receive data only when the “Relay Tx”  
USRP transmit it,

is this correct?

Not quite…

i). the “Source Tx” USRP has a constant stream of data, and is  
constantly transmitting. If the codewords in the file are exhausted it  
repeats.  
ii). the “Relay Tx” USRP transmits data only when data has been received  
by the “Relay Rx” (I will use tx\_time to control when the received burst  
is re-transmitted)  
iii). the “Relay Rx” USRP will receive data only when the “Source Tx”  
USRP transmits (section where Relay Tx’s too will be ignored),

I have changed the block you suggested, to avoid inserting 0’s mid  
burst.

```
void
avoid_block_impl::forecast (int noutput_items, gr_vector_int 

```

&ninput\_items\_required)  
{  
ninput\_items\_required[0] = noutput\_items;  
ninput\_items\_required[1] = 0;  
}

```
int
avoid_block_impl::general_work (int noutput_items,
                   gr_vector_int &ninput_items,
                   gr_vector_const_void_star &input_items,
                   gr_vector_void_star &output_items)
{
            const gr_complex *in0 = (const gr_complex*) 

```

input\_items[0];  
const gr\_complex _in1 = (const gr\_complex_)  
input\_items[1];  
gr\_complex _out0 = (gr\_complex_) output\_items[0];  
gr\_complex _out1 = (gr\_complex_) output\_items[1];

```
            //if(DEBUG) fprintf(stderr, " noutput_items = %d, 

```

ninput\_items[0] = %d, ninput\_items[1] = %d.\n", noutput\_items,  
ninput\_items[0], ninput\_items[1]);

```
            // For first input, just copy
            for (int i=0; i < noutput_items; i++)
                    out0[i] = in0[i];

            // Count number of output items
            int num_out1 = 0;

            // If items available for second input, copy
            for (int i=0; i < ninput_items[1]; i++)
            {
                    out1[i] = in1[i];
                    if(!d_burst)
                    {
                            if(DEBUG) fprintf(stderr, " Entering 

```

burst…\n");  
d\_burst = true;  
}  
// Number of (actual) items tx’d this call  
num\_out1++;  
// Total number of items in burst transmitted so  
far  
d\_items\_sent++;  
}

```
            // For the rest of second output, fill with zeros
            if(!d_burst)
            {
                    for (int i=ninput_items[1]; i < noutput_items ; 

```

i++)  
{  
// Fill zeros  
out1[i] = 0.0;  
// Number of (zero) items tx’d this call  
num\_out1++;  
}  
}

```
            // Mark end of burst
            if(d_items_sent >= 1280*6) //TODO change to external 

```

burst length parameter  
{  
if(DEBUG) fprintf(stderr, " Finishing  
burst…\n");  
d\_burst = false;  
d\_items\_sent = 0;  
}

```
            consume( 0, noutput_items);
            consume( 1, ninput_items[1]); // Consume all available 

```

items

```
            produce( 0, noutput_items);
            produce( 1, num_out1); // Only produce the required 

```

number of items

```
            return WORK_CALLED_PRODUCE;
}

```

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 5, 2014, 1:34am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/13 "2014-06-05T01:34:56Z")

</div>

On Wed, Jun 4, 2014 at 10:52 PM, David Halls  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Not quite…
> 
> i). the “Source Tx” USRP has a constant stream of data, and is constantly  
> transmitting. If the codewords in the file are exhausted it repeats.  
> ii). the “Relay Tx” USRP transmits data only when data has been received  
> by the “Relay Rx” (I will use tx\_time to control when the received burst is  
> re-transmitted)  
> iii). the “Relay Rx” USRP will receive data only when the “Source Tx” USRP  
> transmits (section where Relay Tx’s too will be ignored),

What do you mean by “section where Relay Tx’s too will be ignored” ?

> I have changed the block you suggested, to avoid inserting 0’s mid burst.

So does this give better results?

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 5, 2014, 1:45am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/14 "2014-06-05T01:45:32Z")

</div>

On Wed, Jun 4, 2014 at 10:52 PM, David Halls  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Not quite…
> 
> i). the “Source Tx” USRP has a constant stream of data, and is constantly  
> transmitting. If the codewords in the file are exhausted it repeats.  
> ii). the “Relay Tx” USRP transmits data only when data has been received  
> by the “Relay Rx” (I will use tx\_time to control when the received burst is  
> re-transmitted)  
> iii). the “Relay Rx” USRP will receive data only when the “Source Tx” USRP  
> transmits (section where Relay Tx’s too will be ignored),

To clarify, is it true that both the “Source TX” USRP and “Relay Tx”  
USRP  
are controlled by the same UHD Sink in the flowgraph?

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 5, 2014, 1:57am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/15 "2014-06-05T01:57:19Z")

</div>

* * *

From: Activecat [removed\_email\_address@domain.invalid]  
Sent: 04 June 2014 16:02  
To: David Halls  
Cc: removed\_email\_address@domain.invalid  
Subject: Re: [Discuss-gnuradio] Scheduling a block even with no input  
items RE: Flow graph blocking when doing 2x1 transmission

On Wed, Jun 4, 2014 at 10:52 PM, David Halls  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
wrote:  
Not quite…

i). the “Source Tx” USRP has a constant stream of data, and is  
constantly transmitting. If the codewords in the file are exhausted it  
repeats.  
ii). the “Relay Tx” USRP transmits data only when data has been received  
by the “Relay Rx” (I will use tx\_time to control when the received burst  
is re-transmitted)  
iii). the “Relay Rx” USRP will receive data only when the “Source Tx”  
USRP transmits (section where Relay Tx’s too will be ignored),

What do you mean by “section where Relay Tx’s too will be ignored” ?

I have changed the block you suggested, to avoid inserting 0’s mid  
burst.

So does this give better results?

1. this is to avoid loop interference, the Relay Rx will ignore the  
received signal during the time that the Relay Tx is transmitting.
2. Yes avoiding adding 0’s gives me pretty much the performance I  
require, I need to work on some other parts of the implementation to be  
sure. (it is definitely not the neatest way yet!!)

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 5, 2014, 8:58am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/16 "2014-06-05T08:58:44Z")

</div>

On Wed, Jun 4, 2014 at 7:10 PM, David Halls  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Activecat,  
> In fact my horrible hack doesn’t work properly. Once items start arriving  
> at Payload TD Tx 2, they still don’t arrive as ‘consistently’ (for want of  
> a better word), as those from the Noise Source block, and thus zeros are  
> inserted when they are not required!
> 
> David

David,

Basically my idea to solve the problem may involve an overhaul of your  
existing flowgraph, as below:

1). You must understand that the output of UHD source is at constant  
rate.  
In particular I am referring to the “Relay Rx” USRP.  
Even when the USRP does not receive any RF signal, it keeps  
sending  
out zeros (plus noise) as its output, at constant rate.

```
  Try to make all your blocks behave in this way. I am referring to 

```

the  
blocks between the “Relay Rx” and “Relay Tx”.  
The idea is: keep transmitting, don’t produce no output at any  
time.  
If nothing need to be produced, then output zeros at constant rate.  
In this case all your custom blocks are either sync block,  
decimation  
or interpolation blocks. You don’t need any general block.

2). With above condition fulfilled, we could ensure that the data fed  
into  
the “Relay Tx” USRP is at constant rate, and we could then determine  
this  
rate by simple calculations.  
The data stream into the “Relay Tx” USRP will not stop at any  
instance. It is ‘consistent’.

3). You want the “Relay Rx” USRP ignores the received signal during the  
time that the “Relay Tx” USRP is transmitting, that is fine.  
But just try to make the downstream block of “Relay Rx” USRP keep  
transmitting zeros rather than stop transmitting during this period.

4). With these, you will have both “Relay Tx” USRP and “Source” USRP  
transmitting at constant data rate and nonstop.  
They could be transmitting at different rates, that is ok, and  
this  
is not difficult to handle.

With this, you avoid the initial problem (problem of occasionally there  
is  
no items at one of the inputs) mentioned in this thread, which is the  
root  
cause of your problem.  
Then your problem is solved !

---

<div class="post-metadata">

**Author:** ![activecat\_k](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c57346/32.png) [@activecat\_k](https://www.ruby-forum.com/u/activecat_k)\
**Post date:** [June 5, 2014, 1:58am UTC](https://www.ruby-forum.com/t/re-scheduling-a-block-even-with-no-input-items-re-flow-graph-blocking-when-doing-2x1-transmission/230193/17 "2014-06-05T01:58:30Z")

</div>

* * *

From: Activecat [removed\_email\_address@domain.invalid]  
Sent: 04 June 2014 16:13  
To: David Halls  
Cc: removed\_email\_address@domain.invalid  
Subject: Re: [Discuss-gnuradio] Scheduling a block even with no input  
items RE: Flow graph blocking when doing 2x1 transmission

On Wed, Jun 4, 2014 at 10:52 PM, David Halls  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\>  
wrote:  
Not quite…

i). the “Source Tx” USRP has a constant stream of data, and is  
constantly transmitting. If the codewords in the file are exhausted it  
repeats.  
ii). the “Relay Tx” USRP transmits data only when data has been received  
by the “Relay Rx” (I will use tx\_time to control when the received burst  
is re-transmitted)  
iii). the “Relay Rx” USRP will receive data only when the “Source Tx”  
USRP transmits (section where Relay Tx’s too will be ignored),

To clarify, is it true that both the “Source TX” USRP and “Relay Tx”  
USRP are controlled by the same UHD Sink in the flowgraph?

Yes, they are both controlled by the same UHD sink. This ensures, in a  
simple fashion, that the Source Tx and Relay Tx transmissions have  
sample-level synchronicity - a must for my Quantize Map and Forward  
scheme.

* * *

NOTE: The information in this email and any attachments may be  
confidential and/or legally privileged. This message may be read, copied  
and used only by the intended recipient. If you are not the intended  
recipient, please destroy this message, delete any copies held on your  
system and notify the sender immediately.

Toshiba Research Europe Limited, registered in England and Wales  
(2519556). Registered Office 208 Cambridge Science Park, Milton Road,  
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl
