# Iq balance calibration

**URL:** <https://www.ruby-forum.com/t/iq-balance-calibration/246354>\
**Category:** GNU Radio\
**Created:** [October 9, 2013, 1:16pm UTC](https://www.ruby-forum.com/t/iq-balance-calibration/246354 "2013-10-09T13:16:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [October 9, 2013, 1:16pm UTC](https://www.ruby-forum.com/t/iq-balance-calibration/246354/1 "2013-10-09T13:16:31Z")

</div>

Hello,

I am trying to adapt the existing cal\_tx/rx\_iq\_balance utility to a  
development daughterboard.

Initially, I am trying to just get the existing code running and then I  
intend to modify it if it is not compatible out-of-the-box with my  
dboard.

At the moment, I am working through a series of obstacles that throw  
errors  
of the “this device is not supported” nature.

I have found the code that has a hardcoded check list for known boards  
and  
am adding mine to the list.

There is one part in usrp\_cal\_utils.hpp that requires modification but  
I am  
unsure about it.

There is a section that checks motherboard names, USRP2, B100, E100, and  
E110.  
I can deal with the daughterboard issues, but do not know why the USRP1  
does  
not show up in the list of checks.

Also, if I was to simply add the USRP1 to the code, I’m not so sure what  
the  
tx/rx\_rates are referring to in the other boards, and what would be a  
suitable value for the USRP1.

This is the code section I am referring to:

static inline void set\_optimum\_defaults(uhd::usrp::multi\_usrp::sptr  
usrp){  
uhd::property\_tree::sptr tree = usrp-\>get\_device()-\>get\_tree();

```
const uhd::fs_path mb_path = "/mboards/0";
const std::string mb_name = tree->access<std::string>(mb_path /

```

“name”).get();  
if (mb\_name.find(“USRP2”) != std::string::npos or  
mb\_name.find(“N200”)  
!= std::string::npos or mb\_name.find(“N210”) != std::string::npos){  
usrp-\>set\_tx\_rate(12.5e6);  
usrp-\>set\_rx\_rate(12.5e6);  
}  
else if (mb\_name.find(“B100”) != std::string::npos){  
usrp-\>set\_tx\_rate(4e6);  
usrp-\>set\_rx\_rate(4e6);  
}  
else if (mb\_name.find(“E100”) != std::string::npos or  
mb\_name.find(“E110”) != std::string::npos){  
usrp-\>set\_tx\_rate(4e6);  
usrp-\>set\_rx\_rate(8e6);  
}  
else{  
throw std::runtime\_error(“self-calibration is not supported for  
this  
hardware”);  
^^^ THIS IS THE CASE RUN WITH USRP1 ^^^  
}

So in summary, my questions are:

1. Can I simply expand the code to include the USRP1 like so:

else if (mb\_name.find(“USRP1”) != std::string::npos){  
usrp-\>set\_tx\_rate(xxx);  
usrp-\>set\_rx\_rate(xxx);

Or is the USRP1 physically incompatible?

1. If it is compatible, what would be appropriate for values xxx, or at  
least what values in the radio system is this code setting?

Thanks in advance

Alex

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/iq-balance-calibration-tp44039.html](http://gnuradio.4.n7.nabble.com/iq-balance-calibration-tp44039.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 9, 2013, 2:43pm UTC](https://www.ruby-forum.com/t/iq-balance-calibration/246354/2 "2013-10-09T14:43:35Z")

</div>

I should point out that i have made the changes:

adding:

else if (mb\_name.find(“USRP1”) != std::string::npos){  
usrp-\>set\_tx\_rate(4e6);  
usrp-\>set\_rx\_rate(4e6);  
}

My questions still stand as i am not entirely sure of what concerns may  
exist in terms of compatibility, it strikes me as a bit strange that  
USRP1  
does not exist in the list by default…

The tx\_rate I am assuming to be the UHD ↔ USRP1 sample rate.

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/iq-balance-calibration-tp44039p44040.html](http://gnuradio.4.n7.nabble.com/iq-balance-calibration-tp44039p44040.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 9, 2013, 3:15pm UTC](https://www.ruby-forum.com/t/iq-balance-calibration/246354/3 "2013-10-09T15:15:44Z")

</div>

On 10/09/2013 07:15 AM, Alexander B wrote:

> ```
> const uhd::fs_path mb_path = "/mboards/0";
> }
> 
> ```
> 
> Or is the USRP1 physically incompatible?  
> The USRP1 doesn’t have the necessary support in the FPGA for this, which  
> is why it isn’t supported in these utilities.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 9, 2013, 3:28pm UTC](https://www.ruby-forum.com/t/iq-balance-calibration/246354/4 "2013-10-09T15:28:02Z")

</div>

Ahh… ok

Thank you Marcus. i’ll wait for my USRP2 we ordered then and try again.

Alex

–  
View this message in context:  
[http://gnuradio.4.n7.nabble.com/iq-balance-calibration-tp44039p44043.html](http://gnuradio.4.n7.nabble.com/iq-balance-calibration-tp44039p44043.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).
