# UHD: get\_center\_freq?

**URL:** <https://www.ruby-forum.com/t/uhd-get-center-freq/202642>\
**Category:** GNU Radio\
**Created:** [February 2, 2011, 9:57pm UTC](https://www.ruby-forum.com/t/uhd-get-center-freq/202642 "2011-02-02T21:57:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [February 2, 2011, 9:57pm UTC](https://www.ruby-forum.com/t/uhd-get-center-freq/202642/1 "2011-02-02T21:57:59Z")

</div>

gr-usrp has set\_tx\_freq and tx\_freq

uhd has set\_center\_freq but no get\_center\_freq or center\_freq- I’m  
trying to port some USRP1 python code to UHD and there doesn’t seem to  
be a clear analog.

Have I overlooked something?

Thanks for any input/help!

-Brett

---

<div class="post-metadata">

**Author:** ![Brett\_LSTrotter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@Brett\_LSTrotter](https://www.ruby-forum.com/u/Brett_LSTrotter)\
**Post date:** [February 2, 2011, 11:49pm UTC](https://www.ruby-forum.com/t/uhd-get-center-freq/202642/2 "2011-02-02T23:49:37Z")

</div>

On 02/02/2011 12:48 PM, Brett L. Trotter wrote:

> gr-usrp has set\_tx\_freq and tx\_freq
> 
> uhd has set\_center\_freq but no get\_center\_freq or center\_freq- I’m  
> trying to port some USRP1 python code to UHD and there doesn’t seem to  
> be a clear analog.

The uhd has a get/set\_rx/tx\_freq. Did I forget to swig up the get\_freq  
for the source and sink wrappers?

---

<div class="post-metadata">

**Author:** ![Brett\_LSTrotter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@Brett\_LSTrotter](https://www.ruby-forum.com/u/Brett_LSTrotter)\
**Post date:** [February 6, 2011, 8:53pm UTC](https://www.ruby-forum.com/t/uhd-get-center-freq/202642/3 "2011-02-06T20:53:22Z")

</div>

## Sorry for the delay- I sent this 02/02/11 from an email that’s not subscribed.

On 02/02/2011 04:48 PM, Josh B. wrote:

> On 02/02/2011 12:48 PM, Brett L. Trotter wrote:
> 
> > gr-usrp has set\_tx\_freq and tx\_freq
> > 
> > uhd has set\_center\_freq but no get\_center\_freq or center\_freq- I’m  
> > trying to port some USRP1 python code to UHD and there doesn’t seem to  
> > be a clear analog.
> 
> The uhd has a get/set\_rx/tx\_freq.  
> I couldn’t find one…

[root@aurora lib]# grep \_freq \*.h  
uhd\_multi\_usrp\_sink.h: virtual uhd::tune\_result\_t set\_center\_freq(  
uhd\_multi\_usrp\_sink.h: uhd::tune\_result\_t set\_center\_freq(double  
freq, size\_t chan){  
uhd\_multi\_usrp\_sink.h: return  
set\_center\_freq(uhd::tune\_request\_t(freq), chan);  
uhd\_multi\_usrp\_sink.h: virtual uhd::freq\_range\_t  
get\_freq\_range(size\_t chan) = 0;  
uhd\_multi\_usrp\_source.h: virtual uhd::tune\_result\_t set\_center\_freq(  
uhd\_multi\_usrp\_source.h: uhd::tune\_result\_t set\_center\_freq(double  
freq, size\_t chan){  
uhd\_multi\_usrp\_source.h: return  
set\_center\_freq(uhd::tune\_request\_t(freq), chan);  
uhd\_multi\_usrp\_source.h: virtual uhd::freq\_range\_t  
get\_freq\_range(size\_t chan) = 0;  
uhd\_single\_usrp\_sink.h: virtual uhd::tune\_result\_t set\_center\_freq(  
uhd\_single\_usrp\_sink.h: uhd::tune\_result\_t set\_center\_freq(double  
freq, size\_t chan){  
uhd\_single\_usrp\_sink.h: return  
set\_center\_freq(uhd::tune\_request\_t(freq), chan);  
uhd\_single\_usrp\_sink.h: virtual uhd::freq\_range\_t  
get\_freq\_range(size\_t chan = 0) = 0;  
uhd\_single\_usrp\_source.h: virtual uhd::tune\_result\_t set\_center\_freq(  
uhd\_single\_usrp\_source.h: uhd::tune\_result\_t set\_center\_freq(double  
freq, size\_t chan){  
uhd\_single\_usrp\_source.h: return  
set\_center\_freq(uhd::tune\_request\_t(freq), chan);  
uhd\_single\_usrp\_source.h: virtual uhd::freq\_range\_t  
get\_freq\_range(size\_t chan = 0) = 0;

> Did I forget to swig up the get\_freq  
> for the source and sink wrappers?

This is what I could find anyway…

[root@aurora swig]# pwd  
/root/gnuradio/gr-uhd/swig  
[root@aurora swig]# grep “def.\*\_freq” uhd\_swig.py  
def set\_center\_freq(self, \*args):  
def get\_freq\_range(self, \*args, \*\*kwargs):  
def set\_center\_freq(self, \*args):  
def get\_freq\_range(self, \*args, \*\*kwargs):  
def set\_center\_freq(self, \*args):  
def get\_freq\_range(self, chan = 0):  
def set\_center\_freq(self, \*args):  
def get\_freq\_range(self, chan = 0):

I’m usually missing something dumb when I put myself on the line and  
post, but I’m happy to take my grains of salt and have a solution 🙂
