discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] How to change center frequency automatically in r


From: Lambertz, Thomas
Subject: Re: [Discuss-gnuradio] How to change center frequency automatically in rx usrp?
Date: Tue, 13 Jun 2017 11:48:21 +0000

Hey Sinta,


I have actually just Implemented a Spectrum Sweep using USRP and GNU Radio.


One possible, though very ugly approach can be implemented using a Probe Signal and Function Probe. The idea being, that you have a Signal Source generating a Saw-Tooth Signal which gets fed into the Probe Signal. The Function Probe then sets the Frequency of another Signal Source/USRP Block to this probed value.

But this way you cannot tune to exact frequencies, because you don't know when the Function Probe will probe the Saw-Tooth. But if you only want to use the output visually, this might be enough.

I have attached a working example.


A much nicer approach would be to write your own OutOfTree Block. The port on the left of your USRP Source is a Message Command port. You can pass it messages and it handles the frequency changing for you. More Information on that can be found on the GNURadio Wiki and Doxygen pages:

https://wiki.gnuradio.org/index.php/Guided_Tutorial_GNU_Radio_in_C%2B%2B

https://wiki.gnuradio.org/index.php/OutOfTreeModules

https://gnuradio.org/doc/doxygen/page_msg_passing.html

https://gnuradio.org/doc/doxygen/page_uhd.html#uhd_command_syntax


Basically, you would create a Block which periodically sends a "tune" Message. You can then simply connect this block to the USRP's Command Port in GNURadio and do not have to edit the generated Python script each time you make a change in GNURadio.

The Message Strobe block is not configurable enough to do this, since it can only send one pre-set message.


Depending on how you want to store the data you might also want to add Stream Tags, which additional blocks down the chain can use to determine at which frequency the samples were recorded:

https://gnuradio.org/doc/doxygen/page_stream_tags.html

That would require a sync-block which just hands the samples along and tags accordingly.


Best Regards,


Thomas

Attachment: sweep_test.grc
Description: sweep_test.grc


reply via email to

[Prev in Thread] Current Thread [Next in Thread]