1

I need to send some data from a file by a frequency hopping USRP sink and receive by the USRP source. Both have to change the frequency synchronously and constantly after an amount of samples. How can I tell (especially) the USRP source in the python code to change the frequency?

https://www.gnuradio.org/doc/doxygen/page_uhd.html the UHD Source and Sink has an command port.

pmt::pmt_t command = pmt::cons( // Make a pair

    pmt::mp("freq"), // Key is 'freq' => sets the frequency
    pmt::mp(1.1e9) // Set the frequency to 1.1 GHz
);

// Now pass 'command' into the USRP block's command port

Sounds like a way to change it. But I don understand how I'll connect this to the USRP? And how to trigger it after an amount of samples. Does anybody has an example or suggestion? Thanks

XaC
  • 432
  • 3
  • 9
d.patsche
  • 11
  • 3

1 Answers1

2

First, you need to create a timed command to make the commands synchronuous:

https://www.gnuradio.org/doc/doxygen/page_uhd.html

Create a tune_request object and then the time command with a timestamp when it is to be executed on the USRP. Send the tune command with the tune_request object. Finish with time command and parameter PMT_NIL.

If the message is constant you could to a Message Strobe block. If the parameters change (like the center frequency), you need to use Python. Before creating your OOT module, you could consider the Python Block element in GRC which allows you to create these messages in python from within GRC.

divB
  • 896
  • 1
  • 11
  • 28