usrp-users@lists.ettus.com

Discussion and technical support related to USRP, UHD, RFNoC

View all threads

B205 mini i very high lo-leakage, image rejection and aggressive DC correction.

S
soring@ayecka.com
Wed, Mar 29, 2023 5:36 AM

I’ve uploaded a sample of the signal I generate at:

https://mega.nz/file/jEEgnBZL#Kr-qjSUXlYDNBmuVfFvSOwy1CJCBelmxsSsnS2a4aDQ

The file is binary. The signal is sampled at 5.76 MHz. The signal is complex interleaved, 16 bits signed.

I gather the signal as it is transmitted to the B205.

I use:  linux; GNU C++ version 9.4.0; Boost_107100; UHD_4.4.0.0-0-g5fac246b

Gain 80 db. BW 10 MHz. lo-offset 3e6. Rate 5.76MHz.

I measure an output power of 3 dbm. Image rejection about 25 db only.

I copied the code for the initialization of the USRP:

std::string device_args("num_send_frames=256");

std::string subdev("A:A");

std::string ant("TX/RX");

std::string ref("external");

std::cout << boost::format("Creating the usrp device with: %s...") % device_args << std::endl;

uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(device_args);

// Lock mboard clocks

std::cout << boost::format("Lock mboard clocks: %f") % ref << std::endl;

usrp->set_clock_source(ref);

//always select the subdevice first, the channel mapping affects the other settings

std::cout << boost::format("subdev set to: %f") % subdev << std::endl;

usrp->set_tx_subdev_spec(subdev);

std::cout << boost::format("Using Device: %s") % usrp->get_pp_string() << std::endl;

//set the sample rate

if (rate <= 0.0) {

    std::cerr << "Please specify a valid sample rate" << std::endl;

    return \~0;

}

// set sample rate

std::cout << boost::format("Setting TX Rate: %f Msps...") % (rate / 1e6) << std::endl;

usrp->set_tx_rate(rate);

std::cout << boost::format("Actual RX Rate: %f Msps...") % (usrp->get_tx_rate() / 1e6) << std::endl << std::endl;

// set freq

std::cout << boost::format("Setting RX Freq: %f MHz...") % (freq / 1e6) << std::endl;

uhd::tune_request_t tune_request(freq,lo_offset);

usrp->set_tx_freq(tune_request);

std::cout << boost::format("Actual TX Freq: %f MHz...") % (usrp->get_tx_freq() / 1e6) << std::endl << std::endl;

// set the rf gain

std::cout << boost::format("Setting TX Gain: %f dB...") % gain << std::endl;

usrp->set_tx_gain(gain);

std::cout << boost::format("Actual TX Gain: %f dB...") % usrp->get_tx_gain() << std::endl << std::endl;

// set the IF filter bandwidth

std::cout << boost::format("Setting TX Bandwidth: %f MHz...") % (bw / 1e6) << std::endl;

usrp->set_tx_bandwidth(bw);

std::cout << boost::format("Actual TX Bandwidth: %f MHz...") % (usrp->get_tx_bandwidth() / 1e6) << std::endl << std::endl;

// set the antenna

std::cout << boost::format("Setting TX Antenna: %s") % ant << std::endl;

usrp->set_tx_antenna(ant);

std::cout << boost::format("Actual TX Antenna: %s") % usrp->get_tx_antenna() << std::endl << std::endl;

std::string cpu_format ="sc16";

std::string wirefmt="sc16";

uhd::stream_args_t stream_args(cpu_format, wirefmt);

std::vector<size_t> channel_nums;

channel_nums.push_back(boost::lexical_cast<size_t>("0"));

stream_args.channels             = channel_nums;

It would be great to know how to get it work properly.

Thank you,

Sorin

I’ve uploaded a sample of the signal I generate at: https://mega.nz/file/jEEgnBZL#Kr-qjSUXlYDNBmuVfFvSOwy1CJCBelmxsSsnS2a4aDQ The file is binary. The signal is sampled at 5.76 MHz. The signal is complex interleaved, 16 bits signed. I gather the signal as it is transmitted to the B205. I use: linux; GNU C++ version 9.4.0; Boost_107100; UHD_4.4.0.0-0-g5fac246b Gain 80 db. BW 10 MHz. lo-offset 3e6. Rate 5.76MHz. I measure an output power of 3 dbm. Image rejection about 25 db only.\ \ I copied the code for the initialization of the USRP: std::string device_args("num_send_frames=256"); std::string subdev("A:A"); std::string ant("TX/RX"); std::string ref("external"); std::cout << boost::format("Creating the usrp device with: %s...") % device_args << std::endl; uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(device_args); // Lock mboard clocks std::cout << boost::format("Lock mboard clocks: %f") % ref << std::endl; usrp->set_clock_source(ref); //always select the subdevice first, the channel mapping affects the other settings std::cout << boost::format("subdev set to: %f") % subdev << std::endl; usrp->set_tx_subdev_spec(subdev); std::cout << boost::format("Using Device: %s") % usrp->get_pp_string() << std::endl; //set the sample rate if (rate <= 0.0) { std::cerr << "Please specify a valid sample rate" << std::endl; return \~0; } // set sample rate std::cout << boost::format("Setting TX Rate: %f Msps...") % (rate / 1e6) << std::endl; usrp->set_tx_rate(rate); std::cout << boost::format("Actual RX Rate: %f Msps...") % (usrp->get_tx_rate() / 1e6) << std::endl << std::endl; // set freq std::cout << boost::format("Setting RX Freq: %f MHz...") % (freq / 1e6) << std::endl; uhd::tune_request_t tune_request(freq,lo_offset); usrp->set_tx_freq(tune_request); std::cout << boost::format("Actual TX Freq: %f MHz...") % (usrp->get_tx_freq() / 1e6) << std::endl << std::endl; // set the rf gain std::cout << boost::format("Setting TX Gain: %f dB...") % gain << std::endl; usrp->set_tx_gain(gain); std::cout << boost::format("Actual TX Gain: %f dB...") % usrp->get_tx_gain() << std::endl << std::endl; // set the IF filter bandwidth std::cout << boost::format("Setting TX Bandwidth: %f MHz...") % (bw / 1e6) << std::endl; usrp->set_tx_bandwidth(bw); std::cout << boost::format("Actual TX Bandwidth: %f MHz...") % (usrp->get_tx_bandwidth() / 1e6) << std::endl << std::endl; // set the antenna std::cout << boost::format("Setting TX Antenna: %s") % ant << std::endl; usrp->set_tx_antenna(ant); std::cout << boost::format("Actual TX Antenna: %s") % usrp->get_tx_antenna() << std::endl << std::endl; std::string cpu_format ="sc16"; std::string wirefmt="sc16"; uhd::stream_args_t stream_args(cpu_format, wirefmt); std::vector<size_t> channel_nums; channel_nums.push_back(boost::lexical_cast<size_t>("0")); stream_args.channels = channel_nums; It would be great to know how to get it work properly. Thank you, Sorin
S
soring@ayecka.com
Wed, Mar 29, 2023 5:36 AM

Thanks!

Sorin

Thanks! Sorin
MD
Marcus D. Leech
Wed, Mar 29, 2023 3:08 PM

On 29/03/2023 01:36, soring@ayecka.com wrote:

I’ve uploaded a sample of the signal I generate at:

https://mega.nz/file/jEEgnBZL#Kr-qjSUXlYDNBmuVfFvSOwy1CJCBelmxsSsnS2a4aDQ

The file is binary. The signal is sampled at 5.76 MHz. The signal is
complex interleaved, 16 bits signed.

I gather the signal as it is transmitted to the B205.

I use: linux; GNU C++ version 9.4.0; Boost_107100; UHD_4.4.0.0-0-g5fac246b

Gain 80 db. BW 10 MHz. lo-offset 3e6. Rate 5.76MHz.

I measure an output power of 3 dbm. Image rejection about 25 db only.

I copied the code for the initialization of the USRP:

std::string device_args("num_send_frames=256");

std::string subdev("A:A");

std::string ant("TX/RX");

std::string ref("external");

std::cout << boost::format("Creating the usrp device with: %s...") %
device_args << std::endl;

uhd::usrp::multi_usrp::sptr usrp =
uhd::usrp::multi_usrp::make(device_args);

// Lock mboard clocks

std::cout << boost::format("Lock mboard clocks: %f") % ref << std::endl;

usrp->set_clock_source(ref);

//always select the subdevice first, the channel mapping affects the
other settings

std::cout << boost::format("subdev set to: %f") % subdev << std::endl;

usrp->set_tx_subdev_spec(subdev);

std::cout << boost::format("Using Device: %s") % usrp->get_pp_string()
<< std::endl;

//set the sample rate

if (rate <= 0.0) {

std::cerr << "Please specify a valid sample rate" << std::endl;

return ~0;

}

// set sample rate

std::cout << boost::format("Setting TX Rate: %f Msps...") % (rate /
1e6) << std::endl;

usrp->set_tx_rate(rate);

std::cout << boost::format("Actual RX Rate: %f Msps...") %
(usrp->get_tx_rate() / 1e6) << std::endl << std::endl;

// set freq

std::cout << boost::format("Setting RX Freq: %f MHz...") % (freq /
1e6) << std::endl;

uhd::tune_request_t tune_request(freq,lo_offset);

usrp->set_tx_freq(tune_request);

std::cout << boost::format("Actual TX Freq: %f MHz...") %
(usrp->get_tx_freq() / 1e6) << std::endl << std::endl;

// set the rf gain

std::cout << boost::format("Setting TX Gain: %f dB...") % gain <<
std::endl;

usrp->set_tx_gain(gain);

std::cout << boost::format("Actual TX Gain: %f dB...") %
usrp->get_tx_gain() << std::endl << std::endl;

// set the IF filter bandwidth

std::cout << boost::format("Setting TX Bandwidth: %f MHz...") % (bw /
1e6) << std::endl;

usrp->set_tx_bandwidth(bw);

std::cout << boost::format("Actual TX Bandwidth: %f MHz...") %
(usrp->get_tx_bandwidth() / 1e6) << std::endl << std::endl;

// set the antenna

std::cout << boost::format("Setting TX Antenna: %s") % ant << std::endl;

usrp->set_tx_antenna(ant);

std::cout << boost::format("Actual TX Antenna: %s") %
usrp->get_tx_antenna() << std::endl << std::endl;

std::string cpu_format ="sc16";

std::string wirefmt="sc16";

uhd::stream_args_t stream_args(cpu_format, wirefmt);

std::vector<size_t> channel_nums;

channel_nums.push_back(boost::lexical_cast<size_t>("0"));

stream_args.channels = channel_nums;

It would be great to know how to get it work properly.

Thank you,

Sorin

You should be able to use the tx_samples_from_file example for this
simple test, which includes the ability to set an LO offset.
  This will tell you whether its your setup or something else.

Make sure that your sample amplitudes aren't saturated (that is, don't
approach more than perhaps +/- 20000 or so).

On 29/03/2023 01:36, soring@ayecka.com wrote: > > I’ve uploaded a sample of the signal I generate at: > > https://mega.nz/file/jEEgnBZL#Kr-qjSUXlYDNBmuVfFvSOwy1CJCBelmxsSsnS2a4aDQ > > The file is binary. The signal is sampled at 5.76 MHz. The signal is > complex interleaved, 16 bits signed. > > I gather the signal as it is transmitted to the B205. > > I use: linux; GNU C++ version 9.4.0; Boost_107100; UHD_4.4.0.0-0-g5fac246b > > Gain 80 db. BW 10 MHz. lo-offset 3e6. Rate 5.76MHz. > > I measure an output power of 3 dbm. Image rejection about 25 db only. > > I copied the code for the initialization of the USRP: > > std::string device_args("num_send_frames=256"); > > std::string subdev("A:A"); > > std::string ant("TX/RX"); > > std::string ref("external"); > > > std::cout << boost::format("Creating the usrp device with: %s...") % > device_args << std::endl; > > uhd::usrp::multi_usrp::sptr usrp = > uhd::usrp::multi_usrp::make(device_args); > > // Lock mboard clocks > > std::cout << boost::format("Lock mboard clocks: %f") % ref << std::endl; > > usrp->set_clock_source(ref); > > //always select the subdevice first, the channel mapping affects the > other settings > > std::cout << boost::format("subdev set to: %f") % subdev << std::endl; > > usrp->set_tx_subdev_spec(subdev); > > std::cout << boost::format("Using Device: %s") % usrp->get_pp_string() > << std::endl; > > //set the sample rate > > if (rate <= 0.0) { > > std::cerr << "Please specify a valid sample rate" << std::endl; > > return ~0; > > } > > // set sample rate > > std::cout << boost::format("Setting TX Rate: %f Msps...") % (rate / > 1e6) << std::endl; > > usrp->set_tx_rate(rate); > > std::cout << boost::format("Actual RX Rate: %f Msps...") % > (usrp->get_tx_rate() / 1e6) << std::endl << std::endl; > > // set freq > > std::cout << boost::format("Setting RX Freq: %f MHz...") % (freq / > 1e6) << std::endl; > > uhd::tune_request_t tune_request(freq,lo_offset); > > usrp->set_tx_freq(tune_request); > > std::cout << boost::format("Actual TX Freq: %f MHz...") % > (usrp->get_tx_freq() / 1e6) << std::endl << std::endl; > > // set the rf gain > > std::cout << boost::format("Setting TX Gain: %f dB...") % gain << > std::endl; > > usrp->set_tx_gain(gain); > > std::cout << boost::format("Actual TX Gain: %f dB...") % > usrp->get_tx_gain() << std::endl << std::endl; > > // set the IF filter bandwidth > > std::cout << boost::format("Setting TX Bandwidth: %f MHz...") % (bw / > 1e6) << std::endl; > > usrp->set_tx_bandwidth(bw); > > std::cout << boost::format("Actual TX Bandwidth: %f MHz...") % > (usrp->get_tx_bandwidth() / 1e6) << std::endl << std::endl; > > // set the antenna > > std::cout << boost::format("Setting TX Antenna: %s") % ant << std::endl; > > usrp->set_tx_antenna(ant); > > std::cout << boost::format("Actual TX Antenna: %s") % > usrp->get_tx_antenna() << std::endl << std::endl; > > std::string cpu_format ="sc16"; > > std::string wirefmt="sc16"; > > uhd::stream_args_t stream_args(cpu_format, wirefmt); > > std::vector<size_t> channel_nums; > > channel_nums.push_back(boost::lexical_cast<size_t>("0")); > > stream_args.channels = channel_nums; > > > It would be great to know how to get it work properly. > > Thank you, > > Sorin > > You should be able to use the tx_samples_from_file example for this simple test, which includes the ability to set an LO offset.   This will tell you whether its your setup or something else. Make sure that your sample amplitudes aren't saturated (that is, don't approach more than perhaps +/- 20000 or so).
S
soring@ayecka.com
Sun, Apr 2, 2023 6:38 AM

Seems that by mistake I used wirefmt = sc16 instead of sc12. Switching to sc12 made the difference.

Seems that by mistake I used wirefmt = sc16 instead of sc12. Switching to sc12 made the difference.