# Tx duty cycle using tagging and USRP sink

**URL:** <https://www.ruby-forum.com/t/tx-duty-cycle-using-tagging-and-usrp-sink/237210>\
**Category:** GNU Radio\
**Created:** [October 30, 2013, 12:09am UTC](https://www.ruby-forum.com/t/tx-duty-cycle-using-tagging-and-usrp-sink/237210 "2013-10-30T00:09:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [October 30, 2013, 12:09am UTC](https://www.ruby-forum.com/t/tx-duty-cycle-using-tagging-and-usrp-sink/237210/1 "2013-10-30T00:09:36Z")

</div>

I’d like to build a simple duty-cycle tagger for my outgoing Tx  
stream. I currently have a steady stream of outgoing packets that are  
continuously transmitted, but I would like to modify this so that N  
samples are sent, followed by a fixed-length gap, then the next N  
samples are sent, and so on.

I figure I can do this with a tagger, but where I get concerned is in  
the setup process and the process of remaining synchronized with the  
USRP’s internal clock. Pseudocode:

Set the tags at the start of the burst:  
tx\_time(absolute time reference in seconds and fractional seconds)  
tx\_sob(true)

At the end of the burst:  
tx\_eob(true)

The tx\_time for the next burst will be based on the sample rate, the  
length of the burst, and the burst period.

I figure I can implement my tagger as a sync block. The problem is  
determining the USRP’s clock value so that I can set tx\_time  
correctly. Options:

1. I could pass in a reference to the USRP sink block via make(),  
which would let me query the radio’s clock directly from my tagger  
block. Problem: I wouldn’t know how far into the USRP buffer it’s  
gotten, so it would be hard to know where, in time, my tagger is  
working relative to the USRP’s time.
2. I could pass in a “start time” reference to make() as a time\_spec  
object. It would be up to the block calling the constructor to fetch  
the time from the USRP and add an appropriate (???) delay to allow for  
startup connections to be built. Problem: non-determinism in the time  
between constructor/make() call and actual work start.
3. I pass in a reference to the USRP sink block via make(), then use  
the start() method to fetch the current USRP time. Again, I would need  
to add an appropriate delay to guess how much time will be needed  
before the work() function has set up the initial burst’s tags.

What is the best approach here? Basically I don’t care about the  
absolute time that a burst is transmitted, but rather the relative  
time between the bursts starting. It would be great to be able to tell  
the USRP to leave a silent gap, with a width defined as an integer  
number of samples (or even time\_spec). That would avoid me needing to  
keep track of all these absolute times that I don’t really care about.  
Is there an option like this? If not, what approach should I take?

How different would it be if I simply inserted zeroes into the  
outgoing IQ stream, rather than tagging my bursts?

Thanks in advance!

Ethan
