Hopping Frequency Synchronization algorithm used in PRE-COG

I am working on hopping frequency data transfer for PU (RX-TX).

I need to have both rx tx aware of which channel to communicate with in
each hop.

I read about FHSS implementation in PRECOG.

Which algorithm is being used there to synchronize them?

Can I get a brief code walk through?

Jay Prakash

Jay,

Thanks for checking out pre-cog. I’m not sure what “algorithm” you’d
call
it, or if calling it an “algorithm” might be giving the implementation
more credit than it deserves, but here is the basic MO of the FHSS
blocks:

  1. All I/O is to/from the FHSS_hier implementations is done with
    message
    passing - currently of gr-extras variety. Someday, with Johnathan
    Corgan’s
    help this may get converted to the new message passing API in
    gnuradio.
  2. The TX blocks read the rx sample stream from the USRP, pull off
    stream tags, and count samples to maintain an awareness of the USRP
    time.
    It tracks this time, and when a target time elapses, the block issues
    a
    tuning command via XML_RPT, and a timed burst via tagged sample
    packets in
    a stream. After each time, we set the next time we want to transmit.
    In
    reality, the act of issuing the tune command and sending a burst
    happens
    some time (1-5 ms) before the actual burst occurs. The frequencies
    are
    provided to the block as a parameter - comma delimited text.
  3. On the receive side, the FHSS simply tunes the USRP to the first
    frequency of the frequency list. It waits here until it receives a
    valid
    packet - then it uses a similar process to (2) to start hopping in
    lock
    step.

This was a basic demo of how to use stream tags and message passing to
integrate control functions in a GRC flowgraph. There’s a lot of
potential
improvements - its slow, it could be converted to C++, etc. Once you’ve
got the basics up and running, I do invite contributions to pre-cog or
gnuradio.

I’ve attached files for an FHSS transceiver, but I’d start off with the
simplex examples in the repo.

-John

On Sat, Jun 8, 2013 at 8:42 AM, Jay Prakash

PU is basically a primary user.

I want to build frequency hopping transmitter receiver for PUs.

The primary users will be hopping in a given no of bands and secondary
users will opportunistically sense empty band and communicate with each
other.

Now the problem is how do I synchronize receiver and transmitter while
frequency hopping?

You wrote fssh_engine.py. But I did not understood much through it as I
am
not so well familiar with pmt,blob and gr-extras.

So I was interested in knowing the algorithm so that I can write codes
for
the hopping synchronization.

I am more interested in using python scripts and Gnu Radio support to
design the synchronized hopping.

Suppose the transmitter has a list of hopping frequencies and so does
receiver.Now primary starts transmitting and receiver has to sense which
channel primary is transmitting and insure locking.
There is certain lag associated with USRP and this should be taken in to
account for synchronization.

Jay Prakash
Senior Undergraduate
Electronics Engineering
IIT (BHU)
VARANASI

+91-9559475258

Josh,
I’m curious about how it tune the LO in USRP. Does it control the
LO via
‘post_msg(CTRL_PORT,pmt.pmt_string_to_symbol(‘usrp_sink.set_center_freq’)’?
Thanks.

Jay,

Based on what you said in your last paragraph I think you’ve got a good
high level understanding of how thing are working. I have to step out
for
a few hours, but I should be able to answer in more detail later. If
you’re going to be working in the mean time, you might read up on some
of
these topics:

New mesage passing API in gnuradio -
http://gnuradio.org/doc/doxygen/page_msg_passing.html

Stream tags -
http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CC0QFjAA&url=http%3A%2F%2Fgnuradio.org%2Fredmine%2Fattachments%2Fdownload%2F252%2F06-rondeau-stream_tags.pdf&ei=HXuzUfr9JOfziQL4hYGgDw&usg=AFQjCNEz0DNdc6a3I22sfgT5klNbrDVKYg&bvm=bv.47534661,d.cGE

On PMTs - http://gnuradio.org/redmine/projects/gnuradio/wiki/TypePMT

Until we correspond again - enjoy the material! Also, you might start
off
by trying to get simple_trx in precog to operate.

-John

On Sat, Jun 8, 2013 at 11:28 AM, Jay Prakash

On 06/24/2013 03:58 AM, Gong Z. wrote:

Josh,
I’m curious about how it tune the LO in USRP. Does it control the LO
via
‘post_msg(CTRL_PORT,pmt.pmt_string_to_symbol(‘usrp_sink.set_center_freq’)’?
Thanks.

Well, current pre-cog uses the v3.6 gr-extras out of tree message
passing to execute functions on the USRP python object. Basically the
control block would pass some sort of PMT to an output message port,
this would go to the input port of the PMT RPC block, which would then
execute a function on the usrp object in the python flowgraph.

Here is pre-cog making the call: This line:
https://github.com/jmalsbury/pre-cog/blob/master/python/fhss_engine_rx.py#L185

And the old PMT RPC block:

That works, but no one is really endorsing that particular method. Think
of it as a one-off to set things working. What I think we really want is
a good API friendly framework supported way to set properties on blocks.
Given that I have learned a lot from the pre-cog development struggles,
GRAS now has a programmatic way for blocks to register properties and
access the properties of other blocks.

Properties interface:

USRP control block to set properties on:

Now the code in fhss_engine, might look more like this (thanks Yogesh):
self.uhd_control_sink.set(“command_time”,uhd.time_spec_t(self.interval_start))
self.uhd_control_sink.set(“rx_freq”,uhd.tune_request_t(self.freq_list[self.hop_index]))
self.uhd_control_sink.set(“command_time”,uhd.time_spec_t(0.0))

sort of relevant discussion
http://www.ruby-forum.com/topic/4414817#1112615

-josh