Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-09 Thread Activecat
On Tue, Jun 3, 2014 at 11:08 PM, Activecat active...@gmail.com wrote:


 Create a general block with two inputs and two outputs.
 The two outputs connect to the USRP UHD sink. The first input connects to
 the constantly transmitting source while the second input connects to the
 non-consistent source.

 In your forecast function:

ninput_items_required[0] = noutput_items;
ninput_items_required[1] = 0;


 Then in your general_work function:

   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];

   for (int i=0; i  noutput_items; i++)
   out0[i] = in0[i];

   for (int i=0; i  ninput_items[1]; i++)
   out1[i] = in1[i]

for (int i=ninput_items[1]; i  noutput_items; i++)
   out1[i] = 0.0; // here you fill in the zeros, but won't
 over-filled.

   consume( 0, noutput_items);
   consume( 1, ninput_items[1]);

   return noutput_items;



I've tested out above idea, it works.
Its implementation source file is at
https://github.com/activecat/gr-test2/blob/master/lib/streamer1_impl.cc
To test it out, just run the flowgraph of
https://github.com/activecat/gr-test2/blob/master/examples/flowgraph_09.grc

https://github.com/activecat/gr-test2
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-07 Thread Activecat
On Thu, Jun 5, 2014 at 4:19 PM, David Halls david.ha...@toshiba-trel.com
wrote:

  Original message 
 From: Activecat
 Date:2014/06/05 7:57 AM (GMT+00:00)
 To: David Halls ,discuss-gnuradio@gnu.org
 Subject: Re: [Discuss-gnuradio] Scheduling a block even with no input
 items RE: Flow graph blocking when doing 2x1 transmission

 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 !

Great! Thanks active cat.  This will take some time, I'll will report
back once I have it working!! :)


Hi David,

I have a frequency counter block [1], could be used as an example.
The freq_counter1 is a general block, it was implemented as a sync block
in freq_counter2.
You may run examples/flowgraph_07.grc and flowgraph_08.grc to see their
outputs.

1. https://github.com/activecat/gr-test2
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-05 Thread Activecat
On Wed, Jun 4, 2014 at 7:10 PM, David Halls david.ha...@toshiba-trel.com
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 !
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-05 Thread David Halls


 Original message 
From: Activecat
Date:2014/06/05 7:57 AM (GMT+00:00)
To: David Halls ,discuss-gnuradio@gnu.org
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 
david.ha...@toshiba-trel.commailto:david.ha...@toshiba-trel.com 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 !


Great! Thanks active cat.  This will take some time, I'll will report back once 
I have it working!! :)



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
---
 This email has been scanned for email related threats and delivered safely by 
Mimecast.
 For more information please visit http://www.mimecast.com
---
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-05 Thread David Halls


From: xianda [mailto:wangxianda920...@163.com]
Sent: 05 June 2014 09:50
To: David Halls
Subject: Re:Re: [Discuss-gnuradio] Scheduling a block even with no input items 
RE: Flow graph blocking when doing 2x1 transmission

Hi David:
   Thank you in advance.
   I want to ask a question about 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. as you said.I want to ask how to gnerated  a dat document 
which is in MATLAB.What command you use in MATLAB?
  Thanks very much.
Best regards,
xianda


Hi Xianda,
Please find the zip file attached with files to read and write (to/from MATLAB) 
both complex, and byte types.
Syntax is
input = read_complex_binary('filename.dat')
input = read_char_binary('filename.dat')
write_complex_binary(data,'filename.dat')
write_char_binary(data,'filename.dat')
Regards,
David

At 2014-06-04 08:53:31, David Halls 
david.ha...@toshiba-trel.commailto:david.ha...@toshiba-trel.com 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...

David

From: Activecat [active...@gmail.commailto:active...@gmail.com]
Sent: 04 June 2014 13:45
To: discuss-gnuradio@gnu.orgmailto:discuss-gnuradio@gnu.org
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 
david.ha...@toshiba-trel.commailto:david.ha...@toshiba-trel.commailto:david.ha...@toshiba-trel.commailto:david.ha...@toshiba-trel.com
 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/trlhttp://www.toshiba.eu/research/trl


This email has been scanned for email related threats and delivered safely by 
Mimecast.
For more information please visit http://www.mimecast.com





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
---
 This email has been scanned for email related threats and delivered safely by 
Mimecast.
 For more information please visit http://www.mimecast.com
---




Read_Write.rar
Description: Read_Write.rar
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-04 Thread Activecat
On Wed, Jun 4, 2014 at 4:59 PM, David Halls david.ha...@toshiba-trel.com
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
[2]  http://gnuradio.4.n7.nabble.com/set-relative-rate-td46167.html
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-04 Thread Activecat
On Wed, Jun 4, 2014 at 10:52 PM, David Halls david.ha...@toshiba-trel.com
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?
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-04 Thread Activecat
On Wed, Jun 4, 2014 at 10:52 PM, David Halls david.ha...@toshiba-trel.com
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?
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-04 Thread David Halls


From: Activecat [active...@gmail.com]
Sent: 04 June 2014 16:02
To: David Halls
Cc: discuss-gnuradio@gnu.org
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 
david.ha...@toshiba-trel.commailto:david.ha...@toshiba-trel.com 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
---
 This email has been scanned for email related threats and delivered safely by 
Mimecast.
 For more information please visit http://www.mimecast.com
---

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-04 Thread David Halls


From: Activecat [active...@gmail.com]
Sent: 04 June 2014 16:13
To: David Halls
Cc: discuss-gnuradio@gnu.org
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 
david.ha...@toshiba-trel.commailto:david.ha...@toshiba-trel.com 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
---
 This email has been scanned for email related threats and delivered safely by 
Mimecast.
 For more information please visit http://www.mimecast.com
---

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-04 Thread Activecat
On Wed, Jun 4, 2014 at 8:53 PM, David Halls david.ha...@toshiba-trel.com
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...



Could you send the source code of the missing blocks to me?
I am trying hard to help you out.
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-04 Thread Activecat
On Wed, Jun 4, 2014 at 7:10 PM, David Halls david.ha...@toshiba-trel.com
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?
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-04 Thread Activecat
On Wed, Jun 4, 2014 at 10:25 PM, David Halls david.ha...@toshiba-trel.com
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?
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-04 Thread Activecat
Please do not top post.
Refer
http://gnuradio.org/redmine/projects/gnuradio/wiki/MailingLists#Guidelines-for-posting
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-03 Thread David Halls
Dear All,

Had anyone tried to implementing a gnuradio block that will output zeros if 
there are no items at the input, and will simply copy the input to output 
otherwise?

I find that if there are no items at the input, the block never gets scheduled.

I want this block to feed zeros to my USRP until actual data is ready to be 
passed to it.

Regards,

David

-Original Message-
From: Marcus Müller [mailto:marcus.muel...@ettus.com]
Sent: 03 June 2014 07:45
To: David Halls; discuss-gnuradio@gnu.org
Subject: Re: [Discuss-gnuradio] Flow graph blocking when doing 2x1 transmission

Hi David,

I think you got that right.
Using msg_port_register_in(..) you could set up a message port, define a 
message handler, in which you set a class member (eg. d_datatosend) to the 
message'd content, and in your work check whether d_datatosend is empty or not, 
and in the latter case, emit that.

That's only one way to solve your non-constant streaming issue, and it's one of 
the most computationally intensive, so I don't really know if my advice was 
good...

Greetings,
Marcus
On 02.06.2014 23:30, David Halls wrote:
 Hi Marcus,

 I'm not sure if understand correctly then, how would you suggest it is
 possible to implement your suggestion

 'a block that (rate limitedly) produces zero-samples, unless data comes in on 
 a message port?'

 ...My new block is connected to the UHD sink - so this should consume the 
 output buffer of the block at a constant rate, and so my setup *should* work?

 Many thanks,

 David


  Original message 
 From: Marcus Müller
 Date:02/06/2014 19:56 (GMT+00:00)
 To: David Halls ,discuss-gnuradio@gnu.org
 Subject: Re: [Discuss-gnuradio] Flow graph blocking when doing 2x1
 transmission

 Hi David,

 you're right, the scheduler will only call your block when out- or
 input buffer situation have changed, and there's no elegant way to coerce 
 that.
 However, given a sink that consumes with a constant continous rate,
 that will never be a problem for a longer time.

 Greetings,
 Marcus

 On 02.06.2014 18:55, David Halls wrote:
 Hi All, Marcus

 I have created a simple block (not yet finished) to create zeros. How do I 
 get this to be scheduled if there are no items at the input? If I connect a 
 source to it, then it works, if I connect my 'sample source b' to it which 
 has no items at time zero, then the block is not scheduled.

 void
 avoid_block_impl::forecast (int noutput_items, gr_vector_int 
 ninput_items_required)
 {
 ninput_items_required[0] = noutput_items;
 }

 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 *in = (const gr_complex *) input_items[0];
 gr_complex *out = (gr_complex *) output_items[0];

 for(int idx=0; idx  noutput_items; idx++)
 {
 out[idx] = 0;
 }

 // Tell runtime system how many input items we consumed on
 // each input stream.
 consume_each (noutput_items);

 // Tell runtime system how many output items we produced.
 return noutput_items;
 }

 Regards,

 David
 
 From: Marcus Müller [marcus.muel...@ettus.com]
 Sent: 02 June 2014 17:16
 To: David Halls; discuss-gnuradio@gnu.org
 Subject: Re: [Discuss-gnuradio] Flow graph blocking when doing 2x1
 transmission

 Hi David,

 easiest way to achieve coherence on both USRP would be a MIMO
 cable, or GPSDO's.
 That being said, depending on your definition of sync, just setting
 the time at both USRPs would little to some little, yet existent error.
 This error should also occur when using the two USRPs with the same
 USRP Sink, as long as you don't physically synchronize them. You
 could then issue timed commands. The python code would look something like:

 zero_time = uhd.time_spec(0.0)
 usrp_sink0.set_time_now(zero_time)
 usrp_sink1.set_time_now(zero_time)

 If both can receive the same signal, you could synchronize on a
 signal that both receive; that would of course make your application
 more complex, and also needs to be done periodically, since it's
 physically impossible to keep clocks perfectly aligned over a long time.

 Greetings,
 Marcus

 On 02.06.2014 17:49, David Halls wrote:
 Hi Marcus,

 Yes, your diagram represents what I am trying to achieve.

 Using two sinks would be really nice! But I have had some problems with 
 achieving sync using time stamps (where as using one UHD sink is very 
 straightforward). For example, how do I obtain the current time from the 
 transmit USRPs, but from another block in the flow graph - in order to 
 create a tx_time with the right value? Where I have a UHD source its easy 
 as these output an rx_time tag...

 I thought that I could use

 

Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-03 Thread Martin Braun
On 06/03/2014 03:30 PM, David Halls wrote:
 Dear All,
 
 Had anyone tried to implementing a gnuradio block that will output zeros
 if there are no items at the input, and will simply copy the input to
 output otherwise?
 
 I find that if there are no items at the input, the block never gets
 scheduled.
 
 I want this block to feed zeros to my USRP until actual data is ready to
 be passed to it.

Hey David,

any reason you can't use eob/sob?

Also, did you set forecast accordingly?

Note that this can go wrong easily: If this blocks produces a bajillion
zeros very quickly, nothing will happen until the USRP has consumed them
all.

M


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-03 Thread David Halls
Hey Martin,

Good to hear from you as always. Gnuradio scheduling baffles me more than 
anything else on this planet. The day I get my head around it will be a happy 
day indeed. :0

The problem with using 'sob', 'eob' is because I have two inputs to the USRP 
UHD sink. One is constantly transmitting and has items coming in from time=0, 
but the other has no input items from time=0, they only arrive later on. As a 
result the sink seems to block waiting for items on *both* inputs before it 
will transmit anything. I don't want the USRP to have to wait for the second 
stream to be populated before it transmits anything...

I thought 'forecast' may help me out, but wasn't sure what to put in the 
function to make it schedule even when there are no input items?

David

-Original Message-
From: Martin Braun [mailto:martin.br...@ettus.com]
Sent: 03 June 2014 14:53
To: David Halls; discuss-gnuradio@gnu.org
Subject: Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: 
Flow graph blocking when doing 2x1 transmission

On 06/03/2014 03:30 PM, David Halls wrote:
 Dear All,

 Had anyone tried to implementing a gnuradio block that will output
 zeros if there are no items at the input, and will simply copy the
 input to output otherwise?

 I find that if there are no items at the input, the block never gets
 scheduled.

 I want this block to feed zeros to my USRP until actual data is ready
 to be passed to it.

Hey David,

any reason you can't use eob/sob?

Also, did you set forecast accordingly?

Note that this can go wrong easily: If this blocks produces a bajillion zeros 
very quickly, nothing will happen until the USRP has consumed them all.

M




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
---
 This email has been scanned for email related threats and delivered safely by 
Mimecast.
 For more information please visit http://www.mimecast.com
---

___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-03 Thread Martin Braun
On 06/03/2014 03:59 PM, David Halls wrote:
 Hey Martin,
 
 Good to hear from you as always. Gnuradio scheduling baffles me more
 than anything else on this planet. The day I get my head around it will
 be a happy day indeed. :0

Some things aren't meant for us mere mortals :)

 The problem with using 'sob', 'eob' is because I have two inputs to the
 USRP UHD sink. One is constantly transmitting and has items coming in
 from time=0, but the other has no input items from time=0, they only
 arrive later on. As a result the sink seems to block waiting for items
 on *both* inputs before it will transmit anything. I don't want the USRP
 to have to wait for the second stream to be populated before it
 transmits anything...

Hm, this is an interesting use case I think we might want to address at
some point. But this doesn't help you right now.

 I thought 'forecast' may help me out, but wasn't sure what to put in the
 function to make it schedule even when there are no input items?

Haven't tried this, but maybe you can just tell it that
ninput_items_required = 0 for some values of noutput_items.

Again, this might produce too many zeros. Maybe you need something more
sophisticated.

Cheers,
Martin

 
 David
 
 -Original Message-
 From: Martin Braun [mailto:martin.br...@ettus.com]
 Sent: 03 June 2014 14:53
 To: David Halls; discuss-gnuradio@gnu.org mailto:discuss-gnuradio@gnu.org
 Subject: Re: [Discuss-gnuradio] Scheduling a block even with no input
 items RE: Flow graph blocking when doing 2x1 transmission
 
 On 06/03/2014 03:30 PM, David Halls wrote:
 Dear All,

 Had anyone tried to implementing a gnuradio block that will output
 zeros if there are no items at the input, and will simply copy the
 input to output otherwise?

 I find that if there are no items at the input, the block never gets
 scheduled.

 I want this block to feed zeros to my USRP until actual data is ready
 to be passed to it.
 
 Hey David,
 
 any reason you can't use eob/sob?
 
 Also, did you set forecast accordingly?
 
 Note that this can go wrong easily: If this blocks produces a bajillion
 zeros very quickly, nothing will happen until the USRP has consumed them
 all.
 
 M
 
 
 
 
 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
 http://www.toshiba.eu/research/trl
 
 
 
 This email has been scanned for email related threats and delivered
 safely by Mimecast.
 For more information please visit http://www.mimecast.com
 


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-03 Thread Activecat
On Tue, Jun 3, 2014 at 9:59 PM, David Halls david.ha...@toshiba-trel.com
wrote:

 The problem with using 'sob', 'eob' is because I have two inputs to the
 USRP UHD sink. One is constantly transmitting and has items coming in from
 time=0, but the other has no input items from time=0, they only arrive
 later on. As a result the sink seems to block waiting for items on *both*
 inputs before it will transmit anything. I don't want the USRP to have to
 wait for the second stream to be populated before it transmits anything...



Create a general block with two inputs and two outputs.
The two outputs connect to the USRP UHD sink. The first input connects to
the constantly transmitting source while the second input connects to the
non-consistent source.

In your forecast function:

   ninput_items_required[0] = noutput_items;
   ninput_items_required[1] = 0;


Then in your general_work function:

  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];

  for (int i=0; i  noutput_items; i++)
  out0[i] = in0[i];

  for (int i=0; i  ninput_items[1]; i++)
  out1[i] = in1[i]

  for (int i=ninput_items[1]; i  noutput_items; i++)
  out1[i] = 0.0; // here you fill in the zeros, but won't
over-filled.

  consume( 0, noutput_items);
  consume( 1, ninput_items[1]);

  return noutput_items;


Hope this helps !
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Scheduling a block even with no input items RE: Flow graph blocking when doing 2x1 transmission

2014-06-03 Thread Activecat
On Tue, Jun 3, 2014 at 9:59 PM, David Halls david.ha...@toshiba-trel.com
wrote:

 The problem with using 'sob', 'eob' is because I have two inputs to the
 USRP UHD sink. One is constantly transmitting and has items coming in from
 time=0, but the other has no input items from time=0, they only arrive
 later on. As a result the sink seems to block waiting for items on *both*
 inputs before it will transmit anything. I don't want the USRP to have to
 wait for the second stream to be populated before it transmits anything...


David,

Just one consideration:
Says, in0 is the port getting constant input, whereas in1 is getting
the non-consistent input.
Will this happen where in1 is getting more input than in0 ?
When this happen do you want to fill in0 instead with zeros?
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio