Hello,
I would like to implement the process as follows at the Rx side: Record
the time when the first sample arrived, and then wait for a certain
interval and then send ack back to Tx. Meanwhile, finish the cfo
calculating and compensating.
Here is my whole flow graph design. (Each means a block)
where pkt_dtc, grab_time_tag and cfo_calc was done myself with C++.
However, My question are:
Is it correct of my whole desgin (I want to implement them in one top
block) or are there any easier solutions ?
After the block grab_time_tag, how should I pass the time information
(directly got from the method get_tags_in_range) into the usrp_sink as a
parameter so as to send ack at the intended time? Should I write in
Python(but they are not the same level) or C++(but I can’t rewrite a
usrp_sink) ?
Any doubts or suggestions are highly appreciated !
why do you take the detour through a file? That looks unnecessary.
the USRP sink understands transmission times you specify using tags [1],
so this will be the easiest way to deal with this. You just need to
write a really short block (in C++ or python, whatever you prefer) which
takes the rx_time tag that the USRP source added to the sample stream
and generates a tag with the desired point in time [2].
There are some examples of the rx_time and tx_time tags usage in gr-uhd,
so just search for “tx_time” or “rx_time” in gnuradio/gr-uhd/examples/ .
Hi, Marcus,
I read the doc and examples you recommended, but I still don’t
understand fully how to implement my wok.
Sorry for my previous omission that the first line of my flow graph
design is:
usrp_source -> ptk_dtc -> grab_time_tag -> usrp_sink
Here is the work function of my grab_time_tag block(not finished), I
don’t know how to code next:
const float *sigin = (const float *) input_items[0];
const unsigned char *detect = (const unsigned char *)
input_items[1];
pmt::pmt_t *out = (pmt::pmt_t *) output_items[0];
I want to send acks at an intended time at usrp_sink, how to pass
this time information into usrp_sink?
I know a C++ method gr::uhd::usrp_sink::set_command_time, but don’t know
how to use it.
What also confuses me is:
if I construct a usrp_sink object in python, how to pass the time
information posted from grab_time_tag into it? (They are not at the same
level after all). IMHO, Python is not something valuable. It’s just to
build block objects and connect them.
but if I do the job in C++, does it mean I have to rewrite a new
usrp_sink block(sounds impratical) to receive the desired time value
posted from grab_time_tag ? or else?
BTW, the file_sink/source was just for testing.
I 'm purely a green hand. If something is wrongly understood, please
correct me with no hesitation.
Hope your kind reply in specific details on the two query above. Many
thanks!
const unsigned char *detect = (const unsigned char *) input_items[1];
}
2. I want to send acks at an intended time at usrp_sink, how to pass this
time information into usrp_sink?
You could tag your ACK burst with “tx_time” to send your ACK after a
prefered delay.
Please look in to Bastian’s packet-pad implementation or pre-cog for
reference