How to use tune function?

The code I am basically using for capturing samples is this:
http://gnuradio.org/trac/wiki/UsrpFAQ/CppInterface

As my code is completely based on C++, I can’t use usrp.tune(self.u, 0,
self.subdev,106.2e6), instead can I use the following method from
usrp_standard:

bool usrp_standard_rx::tune(int chan, db_base_sptr db, double
target_freq,
usrp_tune_result *result)

in this manner:

// Set DDC center frequency
urx->set_rx_freq (0, center_freq);
//What should be my center_freq here?

//Set Tuning Frequency
urx->tune(0, db, 106.2e6, result)

// How should I pass the value of db and result?

// Set Number of channels
urx->set_nchannels(1);

// Set ADC PGA gain
urx->set_pga(0,gain);

// Set FPGA Mux
urx->set_mux(0x32103210); // Board A only

// Set DDC decimation rate
urx->set_decim_rate(decim);

// Set DDC phase
urx->set_ddc_phase(0,0);

I use following code to tune db A, subdevice 0 :

usrp_tune_result result;
int site = 0; // site A

db_base_sptr dbsrx = urx->db(site)[0];
urx->tune(0, dbsrx, freq, &result);

Where freq is your desired center frequency.

To check the applied configuration you can use:

printf(“baseband_freq: %f, ddc_freq: %f, residual_freq: %f\n”,
result.baseband_freq, result.dxc_freq, result.residual_freq);

ujala wrote:

urx->set_decim_rate(decim);

// Set DDC phase
urx->set_ddc_phase(0,0);


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


View this message in context:
http://www.nabble.com/How-to-use-tune-function--tp23812754p23813850.html
Sent from the GnuRadio mailing list archive at Nabble.com.